Back to glossaryGLOSSARY · Concepts

Top-p

Another sampling parameter, also called nucleus sampling. Limits the model to picking from the smallest set of tokens whose cumulative probability is at least p. Used alongside temperature to shape output distribution.

How it works

Top-p 0.9 means: rank all tokens by probability, take the smallest set whose probabilities sum to 0.9, sample from that set. Filters out the long tail of unlikely tokens. Common combination: temperature 0.7 + top_p 0.95.

Example

Top-p 0.5 is restrictive (only the most likely tokens are candidates), producing focused output. Top-p 0.99 is permissive (almost all tokens are candidates), producing varied output.

Related terms

Need to actually use Top-p?

We build production AI systems that put these concepts to work. 30 minutes, we map your use case.