How large language models actually work, in plain English
Tokens, training, context windows and hallucinations: the core ideas behind ChatGPT, Claude and Gemini without the maths.
Large language models (LLMs) power ChatGPT, Claude, Gemini and most of the AI tools you use. The core idea is surprisingly simple, even if the engineering isn’t.
They predict the next word
At heart, an LLM is trained to predict what comes next in a piece of text. Do that across a vast amount of writing, and the model has to pick up grammar, facts, reasoning patterns and style along the way.
Tokens, not words
Models read text in chunks called tokens, which are often whole words, sometimes word fragments. Pricing and limits are usually measured in tokens.
Training happens in stages
- Pre-training: learning from huge amounts of text to build general knowledge and language ability.
- Fine-tuning: further training on examples of helpful, well-structured answers.
- Feedback training: people (and sometimes AI systems guided by written principles) rate responses, teaching the model to be more helpful and less harmful.
The context window
A model’s context window is how much text it can consider at once: your conversation, uploaded files and its own replies. Bigger windows let it work with whole books or codebases.
Why they hallucinate
Because models generate plausible text, they can produce confident statements that are false. Connecting models to search, documents and tools reduces this, but doesn’t eliminate it.
From chatbots to agents
The newest shift is agents: models that don’t just answer, but take actions. They browse, run code, use apps and complete multi-step tasks. Expect much of the AI news over the next few years to be about how far, and how safely, that goes.