Lab
Temperature & top-p playground
Drag two sliders and watch a language model's next-token distribution sharpen, flatten and lose its tail.
temperature-playgroundinteractive
What you’re looking at
Each bar is one candidate next token. Its probability comes from a softmax over made-up logits:
- Temperature rescales the logits before the softmax. Low sharpens the distribution and high flattens it. The ranking never changes.
- Top-p (nucleus sampling) keeps the smallest set of tokens whose probabilities add up to at least and drops the rest. Then it renormalises.
- Entropy measures how uncertain the distribution is, in bits. With 8 candidates the maximum is 3 bits.
Everything runs in your browser. Nothing is sent anywhere.