Explainer
How large language models work, without the maths
A large language model predicts the next token, one at a time. Tokens, training, context windows and why that design explains the limits you hit at work.
Bookmark
Bookmarks are kept in your free account, so you can find this page again on any device.
Sign in to bookmarkOn this page
A large language model (LLM) is a program that has learned, from a very large amount of text, to predict which piece of text comes next. When you ask ChatGPT, Claude or Gemini a question, the model reads your message, predicts a likely next word fragment, adds it, and repeats until the answer is complete. Everything it does, from summarising a report to writing code, is built on that one step, and the same step explains its everyday limits: a cutoff date, a maximum input size, confident mistakes and trouble with exact counting.
This page explains the parts in plain words for people who use these tools rather than build them: tokens, training, generation and the context window, then what each means for your work. Sources are linked inline; facts were checked on 21 November 2026.
Text goes in as tokens
Models do not read letters or whole words. They read tokens: common words, parts of longer words, punctuation and spaces, each turned into a number. OpenAI’s rule of thumb for English is that one token is about four characters, or about three-quarters of a word, so 100 tokens is roughly 75 words (OpenAI Help Center). The same page notes that other languages split differently, and that the count depends on the model.
Tokens matter to you for two reasons. Limits and prices are set in tokens, not words or pages. And the model never sees the individual letters of most words, which is one reason it can stumble on tasks like counting characters or reversing a word that a person finds trivial. See the token glossary entry for more.
Training happens in two stages
Pretraining: learning to continue text
The model starts as a very large set of numbers (its parameters or weights) set at random. It is shown huge amounts of text with the next token hidden, makes a prediction, and has its numbers nudged towards the right answer. Repeated across enormous amounts of text, this teaches grammar, facts, styles, the shape of arguments and code, because all of them help predict what comes next. This stage is called pretraining.
Nearly all current LLMs use the transformer design, introduced in the 2017 paper “Attention Is All You Need” (Vaswani et al.). Its key idea, attention, lets the model weigh every earlier token when predicting the next one, so it can connect a pronoun to a name three paragraphs back.
Post-training: learning to be an assistant
A model that has only been pretrained continues text; it does not reliably follow instructions. The second stage, post-training, trains it on examples of good assistant answers and on human ratings of its responses. OpenAI’s 2022 InstructGPT paper showed how much this matters: people preferred the answers of a 1.3-billion-parameter model trained this way over those of the 175-billion-parameter GPT-3, which is about 100 times larger (Ouyang et al.). Post-training is also where vendors teach the model to refuse harmful requests and to use tools such as web search.
Generating an answer, one token at a time
When you send a message, the model reads the whole conversation as tokens and produces a probability for every possible next token. The application picks one, often with some randomness so answers are not identical each time (the temperature setting controls how much), appends it, and asks the model again. A 500-word answer is several hundred of these steps.
“Predicting the next token” undersells what happens inside. Anthropic’s interpretability team found that when Claude writes a rhyming couplet, it picks the rhyme word before writing the line that leads to it: “even though models are trained to output one word at a time, they may think on much longer horizons to do so” (Anthropic, March 2025). The output is produced token by token; the computation behind each token can still plan ahead.
Newer reasoning models add a visible or hidden thinking phase: they generate working notes before the answer, which helps with multi-step problems at the cost of time and tokens.
The context window is the model’s working memory
The model has no memory between conversations unless the application stores and re-sends something. Within a conversation, everything it can use must fit in the context window. Anthropic defines it as “all the text a language model can reference when generating a response, including the response itself”, a working memory distinct from what the model learned in training (Claude docs).
Windows are large now. Anthropic’s current models accept 1 million tokens, which it puts at roughly 555,000 words on its current tokenizer (Claude models overview). Bigger is not automatically better: the same documentation says accuracy and recall degrade as the token count grows, an effect it calls context rot.
Why the limits you hit exist
Each common frustration traces back to one of the parts above.
| What you notice | Why it happens | What to do |
|---|---|---|
| It does not know recent events | Knowledge stops at the training cutoff; Anthropic lists a “reliable knowledge cutoff” per model | Paste the source, or use a tool with web search |
| It states false things confidently | It predicts plausible text, and nothing in training marks sentences true or false | Supply sources and check claims; see why AI hallucinates |
| It miscounts letters or slips on arithmetic | It sees tokens, not characters, and predicts digits as text | Ask it to use a calculator or code tool, or check the numbers |
| It forgets the start of a long chat | The conversation outgrew the window, or the app trimmed it | Start a fresh chat with a short summary of what matters |
| The same prompt gives different answers | Sampling adds randomness to each token choice | Give clearer instructions and examples; compare runs for important work |
| It follows a pasted document’s instructions | Everything in the window is just text to continue, including text you did not write | Treat content from emails and web pages as untrusted; see prompt injection |
What this means for how you use it
The position this page takes: treat an LLM as a very well-read writer with no access to the truth beyond what is in front of it. It is strong at language work you can judge (drafting, rewriting, summarising, explaining, restructuring) and weak wherever an exact fact matters and you did not supply it.
That leads to four habits:
- Put the material in the conversation instead of relying on what the model remembers.
- Be explicit about the task, the audience and the format, because the model fills gaps with the most likely guess.
- Check names, numbers, dates and links before anything leaves your hands.
- Start a new conversation when the topic changes, so old context does not steer the new task.
This picture is simplified. It leaves out how attention works in detail, how tools and retrieval are wired in, and how vendors filter outputs. None of that changes the practical advice, but if you build AI features, the build your first agent tutorial shows the next layer.
Next steps
- Put this into practice with AI at work for beginners, a hands-on guide for non-coders.
- Read why AI hallucinates for the failure you will meet most often, and how to reduce it.
- Learn how to write a good prompt now that you know why context and clear instructions matter.
- Follow the AI for non-developers learning path for a structured route through the basics.
- Look up terms as you go: large language model, context window and token.
Covers
Check your understanding
How large language models work quiz
Tokens, pretraining and post-training, token-by-token generation, the context window and why everyday limits exist.
7 questions · pass mark 70%
Review
Related
- Large language model (LLM)
A neural network trained on very large amounts of text to predict the next token, which lets it generate and transform language.
- AI at work: a practical start for non-developers
Pick the tasks an assistant does well, write instructions you can reuse, work with your own files and check every answer before you use it.
- Why AI hallucinates, and how to reduce it
AI hallucinations are fluent answers that are false. Why language models produce them, which ones you can prevent, and a checklist for work you depend on.
- Token
The unit of text a model reads and writes, often a word or part of a word; in English a token averages about four characters of text.
- AI for non-developers
An AI course for non-developers: use AI assistants for real work without code, from clear requests and checkable research to meeting notes and spreadsheets.