One Token at a Time
What Could Come Next?
A sentence can continue in several ways. A language model works with tokens, which are words, parts of words or punctuation. It assigns a probability to each possible next token. A selection rule chooses one token to add. The model uses the words already written to predict what might come next.
The words before the gap matter
For example, compare these two sentences:
- “She spread the toast with…” makes butter a likely continuation.
- “She washed the toast down with…” makes coffee more likely.
For our picnic, we packed …
sandwichesumbrellastelescopes
A selection rule chooses one
For our picnic, we packed sandwiches
By the end of this lesson
You’ll read a next-token probability chart, change the context to see the prediction change, and explain why “most likely” doesn’t mean “true.”