Launching soon — get early access:
Technical

Top-P Sampling

Definition

A text generation technique that samples from the smallest set of tokens whose cumulative probability exceeds threshold P.

In-Depth Explanation

Also called nucleus sampling, top-p dynamically adjusts the candidate token pool based on probability distribution. With top-p=0.9, the model considers tokens covering 90% of the probability mass. This often produces more natural text than temperature alone by excluding unlikely tokens.

Real-World Example

Top-p of 0.95 excludes very unlikely tokens while maintaining diversity in generation.

4 views0 found helpful