How Models Learn —
and Why They Lie.
Pretraining, fine-tuning and RLHF; the sampling dials you actually turn; and the real mechanism behind hallucination.
Three stages of learning — and the honest truth about hallucination
The player screen is a live animation stage with real diagrams — three stages of learning run end to end, a real temperature dial reshapes a live probability distribution on camera, and the true mechanism behind hallucination is built up piece by piece rather than hand-waved away. Karaoke subtitles in English, fullscreen.
That was the first 10 minutes.
The rest of this chapter — and chapters 2 to 5 — come with lifetime access.
Every idea in the chapter
Each concept the video builds — what it is, what it does, and where it lands in the story. Click any row to open its full breakdown. Filter to find any of them.
| Idea | Category | What it does | In one line | Lesson |
|---|
How a model is taught, and why it lies
Everything Chapter 3 builds, as a reference you can scan: the three stages that turn random noise into an assistant, the dials that give it a voice, and the honest mechanics of hallucination.
| Stage | Data | What it teaches | Doctor analogy |
|---|---|---|---|
| Pretraining | trillions of tokens · the whole internet | raw knowledge — facts, grammar, logic, style, a little reasoning | school |
| Fine-tuning | tens of thousands of clean, expert-written conversations | how to be helpful — answer what was asked, follow instructions | medical school |
| RLHF | thousands of human rankings | alignment — helpful, honest, harmless, by learned preference | residency |
The costs are wildly lopsided. Pretraining runs for months and costs millions. The later stages finish in hours. Almost all raw intelligence is built in that first brutal run — the rest is shaping knowledge that is already there.
| Dial | What it does | Use it when |
|---|---|---|
| greedy (T=0) | always the single most likely token; deterministic | you need the exact same answer every time |
| temperature | divides the raw scores before probabilities — small divisor → top token dominates; large → many become equal | 0.7 is the everyday sweet spot |
| low T | predictable, safe, repetitive | facts · code · reliability |
| high T (~1.5) | creative, surprising, sometimes nonsense | brainstorming · poetry |
| top-k | keep only the k most likely tokens — a fixed number | a blunt guard against the absurd |
| top-p (nucleus) | keep just enough tokens to reach e.g. 90% — few if confident, many if unsure | the default in most systems |
| repetition penalty | discourages saying the same thing twice | long generations that loop |
| seed | fixes the randomness — same prompt, identical answer | testing |
| beam search | keeps several sentences alive in parallel, picks the best overall | translation · stiff for open chat |
Why the same prompt gives different answers: unless temperature is zero, there is a roll of the dice every single token. The model is not malfunctioning — it is sampling.
| Tool | What it does |
|---|---|
| Retrieval (RAG) | fetch the real documents and put them in the prompt — it reads a source instead of inventing one |
| Citations | make it show its work; a claim it cannot ground is a red flag |
| Verification | a human or second system checks before anything is trusted — especially law, medicine, finance |
| lower temperature | less likely to wander into fiction |
| permit doubt | tell it in the system prompt that “I am not sure” is allowed |
| give it tools | a calculator, a search engine — let it look things up instead of guessing |
| the wobble test | ask a few times with randomness: solid facts stay stable, invented details drift |
Filter by idea, category or lesson.
Chapter 3 · the one sentence: pretraining pours in knowledge by guessing the next token, fine-tuning and RLHF shape it into an assistant, sampling gives it a voice — and because truth was never in the objective, it will sometimes be confidently, fluently wrong.Training & hallucination check
Questions and answers reshuffle every load. 70%+ and Chapter 3 is yours.