← All explainers
Machine Learning
How an LLM Picks the Next Word
An interactive: type a prompt and watch the next-token distribution.
Large language models don't 'know' the next word — they output a probability distribution over every possible token, then sample from it.
Try it. Edit the prompt, then click a token to extend the sequence:
Notice how the distribution sharpens or flattens depending on context — that's the model expressing confidence.