Top-p Sampling
Also called nucleus sampling.
Top-p sampling, also called nucleus sampling, draws each next token only from the smallest set of candidates whose cumulative probability exceeds a threshold p.
Description
It was proposed to avoid both the repetitive text produced by greedy or beam decoding and the incoherent text produced by sampling from the full distribution. It is usually combined with temperature.
Sources
- Holtzman et al. (2019). The Curious Case of Neural Text Degeneration.
Cite this entry
Protologue. (2026). Top-p Sampling. In Protologue: A Taxonomy of Prompting and LLM Techniques (v1.0.0, PTL-0007). https://protologue.com/t/top-p-sampling/
BibTeX
@misc{protologue_top_p_sampling,
title = {Top-p Sampling},
author = {{Protologue}},
year = {2026},
howpublished = {Protologue: A Taxonomy of Prompting and LLM Techniques, v1.0.0},
note = {Entry PTL-0007},
url = {https://protologue.com/t/top-p-sampling/}
}