Computing Atlas

How Computing Was Built
Sign In
Text size
100%
Theme
Algorithm

Top-p sampling

Machine Learning Algorithm

Top-p sampling, also called nucleus sampling, is a stochastic decoding strategy used to generate sequences from autoregressive probabilistic models such as large language models. At each step the model gives a probability to every possible next token. The method sorts these tokens by probability, keeps the smallest set whose cumulative probability exceeds a chosen threshold p, rescales the probabilities inside that set so they sum to one, and then draws the next token at random from it. Because the size of this set shrinks when the model is confident and grows when it is uncertain, the technique adapts to the situation and is more flexible than top-k sampling, which always draws from a fixed number of candidates. It was originally proposed by Ari Holtzman, Yejin Choi and colleagues in 2019 to reduce the repetitive and nonsensical text that deterministic methods such as beam search tend to produce, and it has since spread to protein engineering, drug design and geophysical denoising.

Facts
Deterministic or Randomised
Randomised 1
Problem Solved
Repetitive and nonsensical text from deterministic decoding methods such as beam search 1
Connections

Credited To

Yejin Choi, Pioneers
Source Top-p sampling (Wikipedia)

In Field

Source Top-p sampling (Wikipedia)

Invented

Yejin Choi, Pioneers
Source Top-p sampling (Wikipedia)

Uses Design Technique

Source Top-p sampling (Wikipedia)
Sources
1. Top-p sampling (Wikipedia)
  • Lead
    Top-p sampling, also known as nucleus sampling, is a stochastic decoding strategy for generating sequences from autoregressive probabilistic models
  • Lead, purpose
    to address the issue of repetitive and nonsensical text generated by other common decoding methods like beam search
  • Invented: Yejin Choi, Lead, origin
    It was originally proposed by Ari Holtzman, Yejin Choi and colleagues in 2019
  • Credited To: Yejin Choi, Lead, credit
    It was originally proposed by Ari Holtzman, Yejin Choi and colleagues in 2019
  • In Field: Natural Language Processing, Lead, domain
    originally proposed by Ari Holtzman, Yejin Choi and colleagues in 2019 for natural language generation
  • Uses Design Technique: Randomized Algorithms, Technique section
    Top-p sampling introduces randomness to avoid these issues while maintaining quality.
  • In Group: Probabilistic Inference and Sampling Algorithms, Lead, stochastic sampling
    is a stochastic decoding strategy for generating sequences from autoregressive probabilistic models
View the Source
Comments (0)
No comments yet. Be the first to share a thought.
Reader Challenges (0)
No disputes yet. Spotted an error or a better source? Open the first one.