Why models hallucinate
Explain hallucination from the mechanisms: the model produces fluent, plausible continuations for facts it saw rarely or never. Explain how fine-tuning on unknown facts and grading that never rewards 'I don't know' encourage confident guessing.
Builds on: Calibration of model probabilities, Supervised fine-tuning on demonstrations
What the animation says
Confident and wrong
Ask a model when a minor nineteenth-century chemist, Dr. X, was born. It answers 1847, smoothly, with no hedge. And it's wrong. Nothing inside the network looks facts up or checks them. It only predicts the next token. For a famous person, the birth year appears all over the training text, so the probability piles onto one year. Dr. X appears once, maybe never. The model learned the shape, a four-digit year after 'born in', but not the value. So its probability spreads thin over many years. It still has to emit a token. What comes out?
Fine-tuning on unknown facts
It emits a specific year, and a wrong year reads exactly as fluently as the true one. Now fine-tuning. A demonstration says: Dr. X was born in 1852. But the base model barely knows Dr. X. A few examples like this rarely become real knowledge. The model picks such facts up slowly, if at all. Yet its behavior does change, and fast. Tap what this demonstration teaches quickest.
Scores that never reward "I don't know"
It's the habit: when asked, assert. Hedges vanish, and stated confidence stops tracking what the model knows. That's lost calibration. Then evaluation. Most tests give one point for correct, and zero for wrong or for I don't know. Let q be the chance the answer is right. Guessing averages q. Abstaining averages zero. For any q above zero, guess. Now charge c points for each wrong answer. Guessing averages q, minus c times the chance of being wrong. That beats abstaining only when q is greater than c over one plus c. Pick models on one-zero scores, and confident guessers win.
Dr. X, scored three ways
Back to Dr. X. The model's belief: 1852 at a quarter, 1850 at a fifth, 1848 at fifteen percent, the rest spread out. If it's calibrated, its best guess, 1852, is right a quarter of the time. So q is 0.25. One-zero scoring: guessing earns 0.25, abstaining zero. Guess. Penalty of one per wrong answer: 0.25 minus 0.75 is minus a half. The threshold is one half. Abstain. Now the penalty is one third per wrong answer. Which pays more?
Same knowledge, different behavior
A tie. Guessing earns 0.25 minus a third of 0.75, exactly zero. The threshold, a third over four thirds, is one quarter. Same model, same knowledge. The scoring rule alone decides whether bluffing pays, and that's the behavior selection rewards. So hallucination is the model doing what it was trained to do: emit a fluent continuation, even when its probability on the truth is thin. Fine-tuning on unknown facts, and grading that gives I don't know zero credit, both turn that uncertainty into confident guesses.
Rare facts: the shape is learned, not the value
SFT on unknown facts teaches bluffing
Grading that never rewards abstaining
Dr. X's birth year, scored three ways
Remember
On Bytewise this lesson comes in small steps with a check at the end, and the app brings it back right before you would forget it.
Bytewise
All courses