← Glossary

Top-p (Nucleus Sampling)

Concept

Definition

A sampling strategy where the model selects the next token from the smallest set of candidates whose cumulative probability exceeds p. Balances diversity and coherence more adaptively than fixed top-k sampling. Often used alongside temperature.