A chatbot writes one small piece at a time. It reads the context, scores possible next tokens, turns those scores into probabilities, chooses one, adds it and repeats.

How does an AI chatbot pick its next word? · 34-second film · Watch with transcript

Try it yourself: move temperature and the deterministic sample point.

What does temperature do?

For illustrative logit z and temperature T, softmax gives probability exp(z/T) divided by the sum across candidates. Lower temperature concentrates probability on the top score. Higher temperature spreads probability among lower-ranked choices.

The sample point selects the probability interval it lands in. The tool keeps that point deterministic so the choice is inspectable and repeatable.

What is illustrative?

The prompt, five token candidates and every score are invented for this explainer. They are not from a named chatbot and are not a benchmark. Real vocabularies are much larger and systems may also use top-k, top-p and repetition penalties.

Temperature does not add facts or make an answer true. It changes only how sharply the system favors the scores it already produced.

Predict, then try

Predict. Open Next Word and keep the sample point at 0.46. Turn temperature down near 0.2, then up near 1.8. Before each move, guess which token the marker will select and how the probability bars will change.

Notice. “Horizon” remains the most probable token, but at temperature 1.8 the fixed 0.46 marker falls into “trees.” Temperature reshapes the five invented scores; the separate sample point selects a cumulative interval. These are illustrative logits, not a real chatbot’s output; a sharper distribution is not a truer answer.

Sources: Google for Developers, Softmax; Hinton, Vinyals and Dean, softmax temperature; Holtzman et al., text degeneration.

Keep exploring

Up next

  1. 0:33Short · AIWhy do AI agents need tools?
  2. 0:34Short · NumbersHow high can you count on ten fingers?
  3. 0:33Short · CodesWhy does a torn QR code still scan?

Sources & further reading

Make the next question an experiment.

Browse independent creators who make big ideas visible.

Find an explainer