Advanced

Why models make mistakes

A model can tell you something with complete confidence that turns out to be completely wrong. People call it hallucination, and it stems from the same trick that makes the model useful in the first place: it predicts words, it doesn't remember facts. Knowing that one fact changes how you use the thing.

What you will see

trust the model verify it first

About 2 min of reading

Try It

A model can tell you something with full confidence that is simply wrong, because it predicts words and never remembers facts. I show a confident lie, count it as made up, and label which answers deserve a check before I trust them.

1

I print a plausible fact the model states, then note that it landed on the truth by pattern alone and has no memory to back it up.

claim = "Shakespeare wrote Romeo and Juliet in 1597." print("Model answer:", claim) print("Sounded right by pattern, but the model has no memory to back it.")

Before you run it, say out loud what it will print. Then open the answer.

What it prints
Model answer: Shakespeare wrote Romeo and Juliet in 1597. Sounded right by pattern, but the model has no memory to back it.
Truth and fabrication come from the same source. Confidence is not evidence that a fact is true.
2

I run a claim against a trusted source and print that it was made up, showing the kind of confident nonsense a model produces when nothing exists to check against.

def hallucination_check(model_claim, trusted_source): if model_claim in trusted_source: return "confirmed" return "wrong: made up" trusted = {"Australia: Edwin Lahey, 1901"} print("First president of Australia:", hallucination_check("Sir Harold Blinker Sr., elected 1847", trusted))

Before you run it, say out loud what it will print. Then open the answer.

What it prints
First president of Australia: wrong: made up
The worst hallucinations sound completely convincing, which is why you can never trust a model on the things that actually matter.
3

I label a draft and a date differently so it is clear that ideas are safe to trust while anything with a fact must be verified first.

def trust_label(item): if item.startswith("draft") or item.startswith("idea"): return "trust the model" return "verify it first" print(trust_label("draft summary")) print(trust_label("refund date"))

Before you run it, say out loud what it will print. Then open the answer.

What it prints
trust the model verify it first
Trust the model for drafts and ideas, never for verified facts. It is a great starting point and a terrible final word.

Put it in order

Before you write anything, put these lines back in the right order. Click a line to move it up one step. This support step is easier than writing code from scratch, and it is here to make the last example stick.

Data Flow

The model predicts likely text that may sound right but be wrong, so you verify before trusting it.
1 Model answers confidently
↓
2 Answer sounds plausible
↓
3 You check the fact
↓
4 Confirm or correct
Line by line

Read the first example one line at a time. A line that prints shows what appears on screen; the rest set things up quietly.

claim = "Shakespeare wrote Romeo and Juliet in 1597." sets nothing on screen
print("Model answer:", claim) Model answer: Shakespeare wrote Romeo and Juliet in 1597.
print("Sounded right by pattern, but the model has no memory to back it.") Sounded right by pattern, but the model has no memory to back it.
Why this works
Prediction is not memory

An LLM doesn't look facts up in a database. It predicts text that looks correct, and sometimes that text is wrong even when it sounds certain. Confidence is not evidence.

Check the facts that matter

For dates, numbers, or advice that someone will act on, always verify against a reliable source. Trust the model for ideas and drafts, never for verified facts. A model is a great starting point and a terrible one for the final word.

Examples

Confident, and wrong

Prompt: "Who wrote Romeo and Juliet?"
Model: "Shakespeare wrote it in 1597."

That's right here, but the model has no memory at all, it only predicts words. It landed on a true answer by pattern, the same way it could land on a confident lie a moment later. Truth and fabrication come from the same source.

Making up details that sound real

You: "Name the first president of Australia."
Model: "Sir Harold Blinker Sr., elected 1847."

There's no fact to check against, so the model generates something that just sounds right. That's **hallucination*: and the worst ones sound completely convincing, which is why you can't trust a model on the things that actually matter.

Knowing which answers to check

Ideas, drafts, explanations: trust the model.
Dates, numbers, medical advice: verify it.

Use the model for creative work and rough drafts, where a good first attempt is the whole point. For anything that matters, a date, a figure, advice someone will act on, confirm the fact with a reliable source before you do anything.

Words this lesson uses

Each one is defined here on this site. Open the entry for the full definition and the other words it points at.

← Temperature: control vs chaos
Previous Lesson
Temperature: control vs chaos
Next Lesson
Retrieval: giving models knowledge that isn't stale
Retrieval: giving models knowledge that isn't stale →