Top-P Sampling (TopP)

A setting that limits an AI to choosing from only the most likely next words, automatically adjusting how many words qualify based on the AI's own confidence.

Technically: Nucleus sampling selects the smallest set of candidate tokens whose cumulative probability meets or exceeds threshold P, then samples from that set. Unlike Top-K, the pool shrinks when the model is confident and grows when it is uncertain, making it more adaptive. Often combined with temperature; P=0.9 is a common default that prunes implausible tokens while keeping diversity.

Category: Prompting & Inference

Related ideas