The dice room
The same prompt — "The cat sat on the …" — with the real probability bars every model samples from. Drag the temperature slider and watch the bars go spiky (near-greedy) or flat (chaotic); add top-k / top-p and watch candidates get cut. Five parallel rollouts of the identical prompt visibly diverge or converge as you move the dials. Runs entirely in your browser (0 uploads, works offline).
How to use it
- Read the probability bars for the next token — the model's actual candidate distribution.
- Drag temperature and watch the bars flatten (more randomness) or sharpen (more deterministic); use top-k / top-p to truncate the tail.
- Watch the five rollouts — identical prompts producing the same or different words — and the X-ray's entropy readout that explains why.
What this clears up (the fundamentals)
- "Non-deterministic" isn't magic — it's
softmax(logits ÷ temperature), then top-k/top-p truncation, then a weighted dice roll. Every fork between two identical prompts is exactly this sample. - Temperature is the width of the bars — near 0 it narrows toward the single best token (greedy); above 1 it flattens the distribution so unlikely tokens get a real chance.
- Top-k and top-p cut the tail — they remove low-probability candidates before sampling, trading diversity for safety without changing the ranking of the survivors.
- Entropy measures the loaded dice — a peaked distribution has near-zero entropy (predictable); a flat one has high entropy (surprising). It's the single number behind "creative vs consistent."
Where it's used
An AI-literacy explainer — the fastest way to make LLM randomness concrete instead of an abstract disclaimer, and to understand what temperature actually does before you set it. It's a miatz build-lab concept playable; learn to build it yourself.
FAQ
What is temperature?
A divisor applied to the logits before softmax. Dividing by a small number exaggerates the gaps (spiky, near-greedy); dividing by a large number shrinks them (flat, random). It controls how much the model gambles on lower-ranked tokens.
What do top-k and top-p do?
Top-k keeps only the k most probable candidates; top-p (nucleus) keeps the smallest set whose probabilities sum to p. Both discard the unlikely tail before sampling, then renormalise over what's left.
Why do identical prompts give different answers?
Because after computing the distribution, the model draws a sample from it. Unless temperature is near zero (or you sample greedily), that draw can land on different tokens — and one different token cascades into a different sentence.
Is anything uploaded?
No. The distribution and sampling all run in your browser — nothing is transmitted or stored. Turn off your Wi-Fi and it still works.
Limits
A teaching model with a fixed candidate set and logits — a real model computes a fresh distribution over its whole vocabulary at every step. The mechanism shown (temperature, truncation, sampling, entropy) is exactly the real one.
Related
Part of the Demystify Playgrounds. Explore the rest from the Playgrounds home.
Bookmark this page (Ctrl+D, or ⌘D on Mac) — it works offline the next time you need it.