Computer Science · Interactive demo
How does an AI chatbot pick its next word?
Move temperature and a deterministic sample point to see illustrative next-token logits become narrow or surprising probabilities.
Created by ExplainerTools.
About this explainer
- Made by
- ExplainerTools
- Format
- Interactive demo
- Subject
- Computer Science
- Where it runs
- Plays here
- Full tool
- Open the tool page
- Published
- Added to collection
- language models
- tokens
- softmax
- temperature
How the model works
A chatbot does not write a paragraph in one leap. It repeatedly scores possible next tokens, selects one and adds it to the context.
- Temperature0.1 · concentrated → 2.0 · spread out
- Sample point0 → 1
Presets Predictable · T 0.2Balanced · T 1.0Rare draw · T 1.8
Five invented token logits and a deterministic sample point illustrate softmax temperature; they are not output from a named chatbot or measured prompt.
Model notes and sources
Model. Five illustrative next tokens have fixed scores (logits) z. Temperature T turns them into probabilities with softmax: pi = exp(zi/T)/Σjexp(zj/T). Lower T concentrates probability on the largest logit; higher T spreads it out. The sample point from 0 to 1 selects the interval it lands in, making the choice deterministic and inspectable in this tool.
Illustrative only. “The moon rose over the …” and the logits for horizon, trees, city, water and piano were written for this explainer. They are not output from a named model, are not calibrated, and must not be read as a benchmark. Real tokenizers often split words into smaller pieces, real vocabularies contain tens or hundreds of thousands of tokens, and products may use greedy decoding, top-k, top-p, repetition penalties or other sampling rules.
What temperature cannot do. A lower temperature does not make a model factually correct; it only changes how sharply it favors the scores already produced. A higher temperature does not create knowledge; it raises the chance of lower-scored continuations. The photo is an AI-generated illustration with a blank screen; every visible word, number and probability is code-drawn.
Sources: Google for Developers, Softmax (scores mapped to a probability distribution); Hinton, Vinyals and Dean (2015), Distilling the Knowledge in a Neural Network (softmax temperature); Holtzman et al. (2020), The Curious Case of Neural Text Degeneration (decoding and nucleus sampling).
An ExplainerTools Original.
Watch it move
- How does an AI chatbot pick its next word?34-second Short
Go deeper
Explore interactive ideas in space, science, math, and more. Try a demo, read an interactive article, watch a short video, and follow what makes you curious.
New Originals
Change one thing and see why.
The three newest models, each with a short film. Watch the question, then play with the answer.
Follow your curiosity
A collection of small doors into big ideas.
Format
Swipe or scroll for more formats →
Subject
Swipe or scroll for more subjects →
Topic
Swipe or scroll for more topics →
Sort by
Rankings count activity here on ExplainerTools. Newest means added to this collection.
Loading collection…
Make something click.
Made an explainer, or found one you love? Give it a place in the collection.


