Why it matters

Top-p is standard sampling. Understanding shapes decoding.

Advertisement

The architecture

Sort tokens desc.

Take smallest prefix summing to >= p.

Renormalize + sample.

Top-p sampling flowSort by probdescendingCumulative >= psmallest setSamplefrom truncated distAdaptive: peaked distributions truncate small; flat distributions keep more
Top-p.
Advertisement

How it works end to end

Common p: 0.9 - 0.95.

Renormalize truncated distribution.

Combined with temperature.