Skip to content

Top-P Sampling (Nucleus Sampling)

A text generation strategy that considers the smallest set of tokens whose cumulative probability exceeds a threshold P. Unlike top-K, top-P dynamically adjusts the candidate set size based on confidence, adapting to both certain and uncertain contexts.

Related terms

TemperatureTop-K SamplingLogits
← Back to glossary