ModelRefs / Top-P (Nucleus Sampling) — AI Glossary
Top-P (Nucleus Sampling) — AI Glossary
A decoding parameter that restricts sampling to the smallest set of tokens whose cumulative probability exceeds p. Typically used alongside temperature.
Overview
Top-P (e.g. 0.9) keeps generation diverse while avoiding low-probability tail tokens. Typically used alongside temperature. Setting top-p=1.0 disables nucleus sampling.
Reference details
| Topic | inference |
|---|---|
| Last reviewed | 2026-06-24 |
Related terms
Commonly confused with
Top-p and top-k both restrict which tokens can be sampled, and differ in how the cut is decided: top-k always keeps a fixed number, top-p keeps as many as it takes to reach a probability mass, so it widens where the model is unsure and narrows where it is confident. Temperature is a separate control that reshapes the distribution before either cut. Changing more than one at a time makes the result uninterpretable.
Continue your research
Use these connected ModelRefs sections to compare alternatives, inspect implementation paths, and review the evidence and governance boundaries relevant to Top-P (Nucleus Sampling) — AI Glossary.
Frequently asked questions
What is Top-P (Nucleus Sampling)?
A decoding parameter that restricts sampling to the smallest set of tokens whose cumulative probability exceeds p.
What concepts are related to Top-P (Nucleus Sampling)?
Closely related concepts include temperature.