How Large Language Models Actually Work (In Plain English)
Tokens, training, and prediction — what's really happening inside an LLM.
Large language models can write essays, debug code, and hold a conversation — which makes it tempting to imagine there's some kind of mind inside. There isn't. What's actually going on is at once simpler and more surprising than that. This article explains, without maths or jargon, what a large language model (LLM) really does and why it behaves the way it does.
The one-sentence version
At its core, a large language model is a system that predicts the next chunk of text, over and over, based on everything that came before. That's it. Everything impressive an LLM does emerges from doing this one thing extraordinarily well, at enormous scale.
An LLM is a very sophisticated autocomplete — one that has read a substantial fraction of the internet and learned the statistical shape of human language.
Tokens: how models read text
Models don't see words the way we do. They break text into tokens — small pieces that might be a whole word, part of a word, or a punctuation mark. "Understanding" might become "under", "stand", and "ing". Each token is turned into a list of numbers so the model can do maths on it.
When you send a prompt, the model converts it to tokens, processes them, and then generates a response one token at a time. After each token, it looks at everything so far and predicts the most likely next one. String enough of those predictions together and you get a coherent paragraph.
Training: learning from patterns
How does a model know which token is likely to come next? It learns by example. During training, the model is shown vast amounts of text and repeatedly asked to predict the next token. When it's wrong, its internal settings are nudged slightly so it would be a little less wrong next time. Repeat this billions of times across a huge dataset, and the model gradually absorbs the patterns of grammar, facts, reasoning styles, and writing conventions.
Crucially, the model isn't storing a database of sentences it can look up. It's learning general patterns. That's why it can produce text it has never seen before — and also why it can confidently produce text that sounds right but isn't.
Parameters: where the "knowledge" lives
The "settings" that get nudged during training are called parameters — essentially a giant collection of numbers, often numbering in the billions. You can think of them as billions of tiny dials that together encode everything the model has learned. When people say a model has "70 billion parameters", they're describing roughly how many of these dials it has, which loosely correlates with how much it can capture.
There's no folder inside the model labelled "facts about France". The knowledge is distributed across all those parameters at once, in a way that isn't human-readable. This is why we can't simply open a model up and edit a single fact.
Attention: the key idea that made it work
Older language systems struggled to keep track of context over long passages. The breakthrough — introduced by an architecture called the transformer — was a mechanism called attention. In plain terms, attention lets the model weigh which earlier words matter most when predicting the next one.
Consider the sentence: "The trophy didn't fit in the suitcase because it was too big." What does "it" refer to? Attention is how the model learns to connect "it" to "trophy" rather than "suitcase". Multiply that ability across an entire document and you get a system that can follow a thread of meaning surprisingly well.
Why they get things wrong
Understanding the mechanism explains the failures. Because an LLM predicts plausible text rather than true text, it can generate confident, fluent statements that are simply false — often called hallucinations. The model has no built-in fact-checker; it's optimising for "what would a reasonable continuation look like", not "what is verifiably correct".
Other quirks follow from the same root:
- It doesn't truly "know" what it knows. Confidence in tone doesn't reflect confidence in accuracy.
- It has a knowledge cutoff. It only learned from data up to a certain date, so it may be unaware of recent events unless given that information.
- It can be influenced by phrasing. Because output depends on the input pattern, how you ask genuinely changes what you get — which is why prompt engineering works.
What this means for using them
Once you see an LLM as a powerful pattern-completer rather than an oracle, you use it far more effectively:
- Treat it as a brilliant, fast assistant that occasionally makes things up. Verify anything that matters.
- Give it the context it needs. It can only work with what's in front of it, so supply the relevant facts rather than assuming it knows.
- Use it for what it's great at: drafting, summarising, transforming, brainstorming, and explaining — tasks where fluent, plausible language is exactly what you want.
None of this diminishes how remarkable these systems are. A model that learned language purely by predicting the next token, and can now help you write code or plan a project, is a genuinely astonishing piece of engineering. Understanding the mechanism just turns it from magic into a tool — and tools you understand are tools you can use well.
Once this clicked for me, a lot of the mystery around AI quietly fell away. I hope it does the same for you.
— yydev