Illustration 4 of 5

Why AI Hallucinates

A “hallucination” isn't a glitch or a lie. It's the model doing exactly what it always does — generating the most plausible next text — in a moment when plausible happens to be false.

It doesn't look up facts. It generates plausible text.

Ask for a court case and watch it build one — piece by piece — always choosing the most likely next fragment. Every part will look exactly right.

Your request
“Find me a court case about a library's right to remove a book from its shelves.”
The model's answer
{{ gen.text }}
Checked against the federal reporters: no such case exists. The name, the volume number, the circuit, the year — each piece was plausible, and the whole citation was invented.
{{ gen.choiceTitle }}
{{ gen.choiceEmpty }}
{{ c.label }} {{ c.pctLabel }}
It picks the top one — not the true one. There's no “true” in here, only “likely.”

It never opened a database of cases. To the model, a real citation and a plausible-looking one are the same kind of text — built the same way, from probabilities. This is why famous fake citations have shown up in real court filings: the tool worked exactly as designed.

“But I told it not to hallucinate.”

A common instinct is to just add the instruction. Try it — add the line to the prompt and generate again.

Your prompt
Find a court case about removing a library book.Do not hallucinate. Only cite real cases.
The answer
Press “Generate again” and see what the instruction changes.
{{ myth.text }}
Also fabricated.

The instruction only added words to the window — it didn't install a fact-checker. There's no separate part of the model that knows whether its own output is true; generating plausible text is the only thing it does. It can't flag its citation as fake because, from the inside, it looks identical to a real one. Telling it “don't hallucinate” is like telling a printer to only print true sentences.

So what works? Give it real sources to read.

If the answer isn't in the window, don't ask the model to recall it — retrieve it. Pull a real document into the context window and have the model answer only from that. This is called RAG — retrieval-augmented generation.

What's in the context window
Did the Supreme Court limit removing books from a school library?
Retrieved source · placed in the window
Board of Education v. Pico (1982) — excerpt: the Court held that a school board's discretion to remove books from a library is limited by students' First Amendment rights; books may not be removed simply to suppress ideas the board dislikes.
{{ rag.answer }}
{{ rag.verdict }}
A personal note — my preference

When I need something I can stand behind, I never ask the model to recall it from memory.

I lean on retrieval — live web search or a database lookup — to pull real, current sources into the window, then ask the model to work only from those, with citations I can open and check myself. That's my preferred way of working, not the only valid one. The discipline underneath it is simple, and it's yours to keep: trust, but verify — and give the model something real to read.

Plausible isn't the same as true.

A hallucination is the machine doing its job in a moment when its job and the truth part ways. Knowing that, you stop asking it to remember — and start handing it real things to read.

Back to The Science of AI