← Back to topic library
AI MaxxingBeginner75 sec
Next-token prediction
Next-token prediction is the core mechanism where a language model repeatedly predicts the single most likely next token given everything generated so far.
Prerequisite: Token
What matters
Generating a full response is just this one-token-at-a-time prediction repeated until a stopping condition, which is why models can 'trail off' or contradict themselves over a long output.
Example
Given 'The capital of France is', the model predicts 'Paris' as the most likely next token, then repeats the process for each following token.
Common misconception
Next-token prediction is not the same as planning an entire answer in advance; the model does not necessarily know its ending when it generates the first word.
Recall question
What does a language model actually predict at each generation step?
Keywords and related concepts
next-token predictiongenerationautoregressivetoken