Top-p (Nucleus) Sampling

What is Top-p (Nucleus) Sampling?

Top-p sampling selects from the smallest set of tokens whose cumulative probability exceeds 'p'. This dynamically adjusts the pool size based on the model's confidence.

Where did the term "Top-p (Nucleus) Sampling" come from?

Introduced to solve issues with rigid Top-k limits.

How is "Top-p (Nucleus) Sampling" used today?

Preferred over Top-k for generating creative text.

Related Terms