Learn · 1 of 7
What a language model actually is
A next-token predictor, and why that description is both accurate and far too small.
A large language model (A model trained to predict the next token over enormous amounts of text, which turns out to be enough to do a great deal.) is, mechanically, a thing that predicts the next token. Shown a sequence of text, it produces a probability distribution over what comes next, and one is drawn from it. Then it does that again, with the new token included, until it stops.
That is the whole mechanism. It is accurate, and it badly under-describes what the result can do.
Why that is strange
Nobody designed in the ability to hold a conversation, write working code, or follow an instruction it had never seen. Those appeared, as the models and the training data got bigger, out of a system that was only ever being asked to guess the next fragment of text.
This is genuinely one of the more surprising empirical results of the last decade, and it is worth not getting over too quickly. There is no module inside that handles reasoning. There is no database of facts. There is a very large function that maps a sequence to a probability distribution, trained until the predictions got good.
Why that explains the failures too
Keeping the mechanism in mind is the cheapest way to predict how these things go wrong.
A model does not know whether it knows something, because nothing in the mechanism distinguishes recall from generation. Asked for a citation it has not seen, it produces the most plausible-looking one — correct-shaped authors, sensible title, a year that fits. This is not lying, and it is not a bug awaiting a patch; it follows directly from what the thing is.
It also explains why showing beats telling. The model is predicting a continuation, so two worked examples of the output you want shape the prediction far more than a paragraph of adjectives describing it.
What comes next
Everything else in this section builds on this one. Tokens is the unit it actually works in, and almost every cost and limit on this site is counted in them.