02 · AI Fundamentals Lab
How does the model decide which words are even allowed?
Before a model picks a word, it has a ranked list of candidates with a score on each. Top-p draws a line down that list and throws away everything below it. Move the line and watch the list get shorter — then notice that the same setting behaves completely differently depending on how sure the model is.
Pick a sentence to finish
Each one comes with a hand-written list of candidate next words and a number for each. Illustrative distribution, not live model output.
Draw the line
Top-p is a share of the total, not a number of words. Keep the most likely candidates until their numbers add up to p — then stop.
The whole point: same p, different behaviour
This updates as you move the slider above. One setting, four sentences.
Two ways to cut the same list
Same sentence, same candidate list, two different rules. Illustrative distribution, not live model output.
When each one lets you down
Three short experiments
Answer first, then open the explanation. All numbers below come from the same hand-written illustrative lists used in Explore.
Top-p sets how much probability mass to keep, so the number of candidates changes with the model's confidence.
When the model is sure, a high top-p still keeps almost nothing extra. When it is unsure, the same high top-p opens the door to dozens of words. That is what people mean when they call top-p “adaptive”.
My observations
Kept in this browser tab only, for this session.