Top-p (Nucleus Sampling)
Also called: nucleus sampling
An alternative randomness control that samples only from the smallest set of tokens covering probability p.
Top-p keeps the most likely tokens until their cumulative probability reaches p, then samples from just those. Unlike temperature it adapts to how confident the model is at each step. Tuning both at once usually makes behaviour harder to reason about — pick one.
In practice: Top-p 0.9 ignores the long tail of unlikely tokens without flattening the whole distribution.