T2 · Beginner · 7 minMoving · Last reviewed: 2026-08-17Early draft

Hallucination — Why Models Make Things Up

In one line · Hallucination is when the model states something confident but false — because it predicts plausible text, not verified truth.

Glossary:GuardrailsHallucinationRAG
TL;DR

Hallucination isn't a rare glitch — it's a natural result of prediction. Your job is to reduce it with grounding (give it sources) and catch it with evaluation.

Why it matters

The top reason AI products fail in front of users is confident wrong info. Understanding hallucination is step one to building something trustworthy.

The model wants to 'complete the sentence plausibly' more than to 'be correct.' If it doesn't know, it guesses confidently instead of saying 'I don't know.'

An analogy

Like a student in an oral exam who doesn't know but answers confidently so the sentence sounds right. Fluent language, wrong facts.

Ask a model for a citation and it invents a paper, author, and year — none real, but convincingly formatted.

How it works

It picks the most probable words. If the truth isn't strongly 'likely' or wasn't in its training, it fills the gap with the nearest convincing form. There's no built-in 'verify first' step.

For developers

Practical fixes: (1) grounding via RAG so it has the source, (2) explicit 'say you don't know if unsure', (3) evaluation that measures groundedness. No model reaches zero hallucination.

Practice

🧪 Try it: ask a model an obscure detail you know, and see if it invents. Then give it the source in the prompt and compare.

Common mistakes

Biggest mistake: believing an answer because it's 'confident and well-structured.' Convincing form is not evidence of truth.

Misconception: 'newer models don't hallucinate.' They hallucinate less, not never — you still engineer around it.

When to use it

Assume possible hallucination in any fact-heavy task: names, numbers, dates, citations, obscure code.

When NOT to use it

In purely creative tasks (brainstorming, phrasing), hallucination matters less — there's no 'fact' to break.

LET'S BUILD ITDone reading — now build it yourself.Challenge: spot the hallucination