One token at a time.
A language model doesn’t write an answer all at once. It repeatedly predicts what could come next.
A prediction, then another.
Imagine the model sees “The sky is”. It assigns probabilities to possible next tokens. “Blue” might receive a high probability, but “clear” or “dark” could also fit. The model produces scores over its vocabulary; these become a probability distribution.
A decoding rule chooses a token. That token is added to the context, and the model makes a new prediction using the updated sequence. This repeated process is called autoregressive generation.

Watch the context grow.
Step through a tiny illustrative sequence. Notice that each choice changes the context for the next prediction.
Read the sequence
The prompt plus everything generated so far.
Score what comes next
Learned weights produce scores. Softmax turns scores into probabilities.
One possible continuation
Hand-authored probabilities and preset choices, not a real model or tokenizer. Real models score a much larger vocabulary; tokens can be word fragments.
What the loop is doing.
In a real system, the model outputs scores called logits. A softmax operation converts those scores to probabilities. A decoding strategy can choose the highest-probability token or sample from the distribution.
# Illustrative pseudocode — not executable here
context = tokenize(prompt)
for _ in range(max_new_tokens):
logits = model(context)
probabilities = softmax(logits[-1])
token = sample(probabilities)
if token == end_token:
break
context.append(token)The next call includes the new token. Generating a longer answer repeats this loop, subject to stopping rules and context limits. The example above omits implementation details such as caching.
Likely doesn’t mean verified.
Take this with you.
Generation is a loop: predict → choose → append → repeat. The distribution describes possible continuations, and the decoding strategy selects among them. Neither step alone verifies a claim.