We Compare AI

Top-P (Nucleus Sampling)

Parameters
Simple Definition

A sampling parameter that limits token selection to the smallest set of tokens whose cumulative probability exceeds P.

Full Explanation

Top-P (also called nucleus sampling) is an alternative to temperature for controlling output randomness. Instead of scaling all probabilities, it only considers tokens whose probabilities sum to P (e.g., 0.9). This allows natural diversity while preventing very unlikely tokens from being selected. Most production systems tune both temperature and top-P together.

Last verified: 2026-03-30← Back to Glossary