Local AI Glossary

What is Top-p (nucleus) sampling?

Source: local-llm.net/glossary

A text generation strategy that selects from the smallest set of tokens whose cumulative probability exceeds the threshold p. Top-p=0.9 considers the top tokens that collectively account for 90% of the probability mass. More adaptive than top-k because it adjusts the candidate set size based on the probability distribution.

How Top-p (nucleus) sampling fits in the local AI stack

Top-p (nucleus) sampling is part of the broader local AI ecosystem. See the related guides, comparisons, and tools below to see how it applies in practice.

See also

Related terms