LLM Decoding Playground

A language model doesn't pick words — it outputs probabilities. Temperature, top-k and top-p decide how the next word is chosen.

Prompt
Blue = token chosen by sampling. Each new sample replaces it, so you can see how varied the choices are.
Temperature
Divides the scores before softmax. < 1 sharpens (safer), > 1 flattens (more surprising). 0 = always the top token.
Top-k
Keep only the k most likely tokens; the rest can never be picked.
Top-p (nucleus)
Keep the smallest set of top tokens whose probabilities add up to at least p. Adapts to how confident the model is.
Presets
probability used for sampling model's original probability share of your samples
Candidates Effective choices Samples 0
What is happening

For readability we show the 12 most likely next tokens for each prompt (illustrative probabilities, renormalized over these 12); a real model scores every token in a vocabulary of ~100,000. Processing order follows common libraries: temperature, then top-k, then top-p.