Convert probability to information.
A common token carries less surprisal. A rare token carries more. The horizontal chart position is exactly negative log probability in bits.
An information-theoretic decoding experiment
The best next token is not always the most probable one. Locally typical sampling keeps tokens whose information content is close to the model's expected information at this step.
Typicality ranks distance from expected surprisal, then retains enough probability mass to sample.
This transparent synthetic distribution is not a production model benchmark. It isolates the exact selection rule so probability, surprisal, entropy, and retained mass remain inspectable.
The lantern flickered as Mira stepped into
Typical sampling changes the ranking criterion. It does not rank tokens by probability alone: it ranks their absolute distance from the distribution's expected information content.
A common token carries less surprisal. A rare token carries more. The horizontal chart position is exactly negative log probability in bits.
Conditional entropy is the probability-weighted average surprisal for this next-token distribution. It moves when temperature reshapes the distribution.
Sort tokens by distance from entropy and add them until their cumulative probability reaches the configured mass. Renormalize only over that retained set, then sample.
Top-k imposes a fixed count. Nucleus sampling follows cumulative probability. Locally typical sampling follows information content relative to entropy.
Can filter the single most probable token when it is much less surprising than the distribution expects. The retained set need not be a probability prefix.
6 tokensSorts by probability and keeps the smallest prefix whose cumulative mass reaches p.
5 tokensKeeps a fixed number regardless of whether the distribution is sharp or flat.
4 tokensA smaller typicality distance means information content is closer to the model's expectation.
Typical sampling is a decoding rule, not proof that a sampled token is factually correct.
Temperature changes both token probabilities and the entropy target, so it can move both dots and the red line.
No truncation rule guarantees quality. Compare distributions, tasks, and human judgments instead of treating a single parameter as universal.
Use this lab to understand the selection mechanics, then evaluate real generations with task-specific quality, safety, factuality, and diversity measurements.