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.

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

Keep exploring

Up next

  1. InteractiveNext WordChange the same thing yourself.Try it yourself
  2. 0:33Short · AIWhy do AI agents need tools?
  3. 0:34Short · NumbersHow high can you count on ten fingers?

Sources & further reading

Make the next question an experiment.

Browse independent creators who make big ideas visible.

Find an explainer