It predicts the next word, over and over, extremely well. That sounds like a dismissal but it's literally the mechanism, and understanding it explains almost every behaviour you'll notice — including the annoying ones.
The two phases:
1. **Training.** The model reads an enormous amount of text and repeatedly plays a fill-in-the-blank game: given this sequence, what comes next? Every wrong guess nudges billions of internal numbers (parameters) slightly. Do this at massive scale and the model is forced to encode grammar, facts, reasoning patterns, code structure and style — because all of those are needed to predict text well. Nobody programmed rules of grammar into it; they emerged as a side effect of the prediction task.
2. **Fine-tuning and alignment.** Raw prediction gives you a text-continuation engine, not an assistant. A second stage trains it on examples of helpful conversation, with human feedback ranking responses, which is what turns 'autocomplete' into something that answers questions and follows instructions.
When you send a message, it isn't searching a database of answers. Your text is converted to numbers (tokens), run through the network, and it produces a probability distribution over what comes next. It samples one, appends it, and repeats. The answer is generated one piece at a time, which is why you see it stream.
What this explains:
- **Hallucinations.** It's producing plausible text, not looking up facts. A fabricated citation is fluent and correctly formatted because those are the properties it optimises for. It has no internal 'do I actually know this' signal in the way you do.
- **Why it can't count letters reliably.** It sees tokens, not characters.
- **Why phrasing changes answers so much.** Different prompts land in different regions of learned patterns.
- **Why it's confident when wrong.** Confidence is a stylistic property of the text, not a measure of correctness.
On 'understanding': this is genuinely contested. It's not memorising and retrieving — it builds internal representations that generalise to problems it never saw. It's also not comprehending the way you do, with grounding in a world and a body. 'Sophisticated pattern completion that produces genuinely useful reasoning-like behaviour' is about as far as the honest answer goes.
One modern caveat: some products *do* add web search, retrieval over documents, or tool use on top. That's a system built around the model, not the model itself — worth knowing because it changes whether the output is grounded in a real source or generated from patterns.