What is an LLM, really?
What happens when you ask ChatGPT, Claude or Gemini a question, how such a model is trained, and why you get a different answer twice.
In short
An LLM (large language model) repeatedly predicts the next piece of text. It first learns that from enormous amounts of text (pre-training), then learns to be a helpful assistant from examples and human feedback (post-training). Answers vary because of a bit of randomness, and web search or memory are features of the app, not the model.
- Beginner
- 6 min
- free
- Fact-checked on 1 November 2026
- Completed
After this lesson you’ll know: what a language model does when it answers, how it’s trained, why answers vary, and what “thinking” models do differently.
Predicting the next bit of text
Section titled “Predicting the next bit of text”At its core, an LLM does one thing: predict which bit of text is likely to come next. It calculates a probability for every possible next bit, picks one, appends it and starts again.
Try it yourself: move the temperature slider and click the button a few times.
After a long day the cat is curled up on the ___
- sofa0%
- windowsill0%
- mat0%
- floor0%
- computer0%
- moon0%
Your draws:
Illustration with made-up probabilities. Real models choose from tens of thousands of tokens at once.
- Low temperature: almost always the most likely word. Predictable and consistent.
- High temperature: unlikely words get more of a chance. More creative, but messier.
This randomness is an important reason why you don’t always get the same answer to the same question. In the chat apps you can’t set the temperature yourself; developers can via the API.
How a model gets so smart: two phases
Section titled “How a model gets so smart: two phases”flowchart LR A["📚 Pre-training<br/>reading an enormous amount of text<br/>and learning to predict the next bit"] --> B["🧑🏫 Post-training<br/>learning to be a helpful assistant<br/>(examples + human feedback)"] --> C["💬 The assistant<br/>you use"]
1. Pre-training. The model learns to predict the next bit from a gigantic amount of text, picking up grammar, facts, writing styles and reasoning patterns along the way. The result is a base model: according to Anthropic it is “not inherently good at answering questions or following instructions”; mostly, it just continues text.
2. Post-training. People write example conversations and rate which of the model’s answers is better; the model learns to prefer those answers. This is called RLHF (reinforcement learning from human feedback). A lot of training also uses reinforcement learning on checkable tasks such as maths and code, so models learn to reason better.
“Just autocomplete”? Not quite
Section titled ““Just autocomplete”? Not quite”One bit of text comes out at a time, but what happens inside before that is richer. In 2025, Anthropic researchers saw that when writing a rhyming poem, a model chose the rhyming word in advance and wrote the line towards it. They had expected it not to plan ahead, “and found instead that it did”.
So an LLM isn’t a human, but it isn’t a simple word predictor either.
Thinking models
Section titled “Thinking models”Since late 2024 there have been reasoning models (also called thinking models). They first write an internal draft in thinking tokens before they answer. That helps with difficult questions: planning, weighing alternatives, checking their own work.
- Thinking costs time and money. Those extra tokens count, and via the API you pay for them as output.
- What you see isn’t always what happened. Research by Anthropic shows that the reasoning shown doesn’t always faithfully reflect how the model actually arrived at its answer.
What a model doesn’t have on its own
Section titled “What a model doesn’t have on its own”After training, the model itself is frozen. Add-ons are handled by the app, not the model:
| Feature | What it is |
|---|---|
| Knowledge cutoff | The model knows nothing about what happened after its training data. For the latest Claude models, Anthropic puts that cutoff at June 2026 (as of 1 November 2026). |
| Web search | The model asks for a search, the app runs it and puts the results into the conversation as text. |
| Memory | The app stores notes about you and sends them along in new conversations. The model itself learns nothing from your chat. |
Want to dig deeper?
Section titled “Want to dig deeper?”- 3Blue1Brown, “Large Language Models explained briefly”: eight minutes, highly visual.
- Andrej Karpathy, “Deep Dive into LLMs like ChatGPT”: three and a half hours, a widely recommended, complete explanation.
Checklist
0/4
Your progress is only stored in this browser.
Test yourself
1What does a model mainly learn during pre-training?
Helpful answers only come in post-training. Search is a feature of the app.
2You ask the same question twice and get two different answers. Why?
3A chatbot knows nothing about an event from last week. What's the most likely reason?
Next lesson: tokens and the context window, or: how much text an AI can “see” at once.