The whole loop
Here is everything a language model does, in five steps.
- It reads all the tokens so far: the hidden instructions, your message, the conversation, and whatever it has already written this turn.
- It produces a probability for every token in its vocabulary. Not a word: a score for all 100,000-odd possibilities at once.
- A separate piece of code picks one of them, usually favouring the likely ones.
- That token is added to the end of the text.
- Go back to step one.
That is the entire mechanism. “The capital of France is” produces a distribution in which Paris might hold 95% and everything else shares the rest. Pick it, append it, read the whole thing again, predict the next.
This is called autoregressive generation, and everything below follows from it.
It re-reads everything, every time
The model holds no state between tokens. To produce your reply’s fiftieth word it processes the entire conversation again, from the first hidden instruction to the forty-ninth word it just wrote.
(Providers cache intermediate results so this is faster than it sounds, but conceptually and for billing it is what happens.)
Two consequences. A long conversation is more expensive per message than a short one, because you are re-sending everything each turn. And there is no memory anywhere except the text itself, which is why the previous module’s point about corrections vanishing is not a design oversight but the shape of the thing.
It cannot plan the end of the sentence
At the moment it emits a token, nothing has decided how the sentence finishes. Each choice is made from what came before.
Which raises a fair question: how does it write a coherent five-paragraph answer, then? Because the early tokens constrain the later ones so tightly. Having written “There are three reasons for this. First,” the text now overwhelmingly implies that a second and third will follow, and the model is very good at honouring what the text implies. Structure emerges from constraint rather than from a plan.
This also predicts a real failure. Ask for exactly seven items and you often get six or eight, because at no point does anything count. Ask for a poem where the last line must land a specific joke and it will frequently write towards a different landing, because the ending was never chosen in advance.
The most useful idea in this lesson: it commits
Once a token is emitted, it is part of the input. There is no backspace.
If the model begins an answer with a wrong number, every subsequent token is generated in a context where that number is established fact. The overwhelmingly likely continuation of a confident wrong claim is more confident wrong elaboration. You will watch it construct supporting detail around an error rather than reverse into it, and this looks like stubbornness or dishonesty. It is neither. It is the arithmetic of continuation.
Three practical moves follow directly:
- When it goes wrong, do not argue with it. Edit or restart. Most interfaces let you edit your previous message and regenerate. That removes the bad text from the context entirely. Arguing leaves the error in place, where it keeps exerting influence.
- Ask for reasoning before the answer, never after. “Work through it, then give the total” puts the working in the context where it can influence the total. “Give the total, then explain” produces an explanation of a number already committed to, which is why such explanations so often justify a wrong answer fluently.
- Ask for options before a recommendation. Once it has recommended, it is arguing a case.
Why “thinking” helps at all
Each token gets a fixed amount of computation. Hard questions do not get more than easy ones. The only way for a model to spend more effort on a problem is to produce more tokens before committing to the answer.
That is what chain-of-thought prompting does, and it is why “let us work through this step by step” measurably improves accuracy on multi-step problems. It is not that the model is encouraged to try harder. It is that the intermediate tokens are real working, held in the context, and the final answer is then predicted from working rather than from the question alone.
The reasoning models released from late 2024 onwards industrialise this: they are trained to generate a long private working-out before answering. Slower, dearer, and better at anything with steps in it. They have their own lesson later.
Check your understanding
A model gives a wrong total, the user points out the error, and the model apologises and produces a detailed justification of the same wrong total. What does this reveal?
Pick the one you would defend. Your answer stays private.
Stuck on something?Ask Meenal, your AI tutor
