← Blog
aihow-it-workscomputer-scienceexplainer

The 7 Kinds of AI Hallucination, and How to Catch Each One

An AI model can be wrong in seven recognizable ways, and each one has its own check. Learn the seven, and a confident answer stops being something you have to take on trust.

By Sandon Jurowski
Share𝕏⬡inYf✉

An AI chat model predicts text that fits. Nothing inside it checks whether the text is true. When the text is wrong but reads as right, people call it a hallucination.

The useful news is that the mistakes are not random. They come in seven kinds, and each kind has its own check.

The seven kinds
1Fabricated facts2Fake citations3Outdated answers4Invented code5Ignored instructions6Context conflict7Broken reasoning
Swipe sideways to see the whole diagram.
The grouping follows an infographic by Poornachandra Kongara. The wording here is ours.

Real failures stack. A bad answer often holds two or three kinds at once: an old fact, a made-up number, and a source that does not exist. One check catches one kind. Running all the checks that apply catches the rest.

1. Fabricated facts

A false name, date or number, stated with full confidence. For example, a model says the Great Fire of London was in 1766. It was 1666.

Catch it

Mark the claims that matter
Check each one against a primary source
Fix it or cut it
Why it happens, and how to prevent it

The model picks words that are likely to come next. It does not look anything up. A wrong date that sounds right is just as easy for it to write as the true one. This is step 6 of how an LLM works.

Prevent it: give the model the source material, and tell it that "I don't know" is an acceptable answer.

2. Fake citations

A paper, link, quote or legal case that looks real and does not exist. This has reached real courtrooms, in filings that cited cases no court ever decided.

Catch it

Open every link
Search for the exact title
Match each quote to its source
Why it happens, and how to prevent it

The model has seen millions of citations, so it knows exactly what one looks like. It never learned which ones exist. It can build a perfect-looking reference out of a real journal, a plausible author and a title that was never written.

Prevent it: hand the model your sources, and accept citations only from that set.

3. Outdated answers

Old information presented as current. For example, a model names a company's former chief executive as the person who runs it today.

Catch it

Ask the model its cutoff date
Turn on web search
Check the date on each source
Why it happens, and how to prevent it

A model's training data stops on a cutoff date. The model has no clock, so it cannot tell that months or years have passed since then.

Prevent it: tell it today's date, and give it fresh data to work from.

4. Invented code

A function, setting or package that nobody ever published. For example, code that imports a library that does not exist.

Catch it

Run it somewhere safe
Check the official documentation
Use only packages you have verified
Why it happens, and how to prevent it

Programming libraries follow patterns. The model blends names from libraries that look alike, and the result is a name that fits the pattern and was never real.

Prevent it: paste in the current documentation. Never install a package whose name you cannot verify. People do publish harmful packages under names that models tend to invent.

5. Ignored instructions

It says it followed your rules, but it skipped one or changed one. For example: "Here are 5 bullets." There are 7.

Catch it

List every rule you gave
Check the answer against each rule
Ask again for the ones it missed
Why it happens, and how to prevent it

A long prompt, or one whose rules pull against each other, spreads the model's attention thin. Each rule gets a little less weight. See step 3: attention.

Prevent it: keep rules short and numbered. Repeat the most important ones at the end.

6. Context conflict

It contradicts the document you gave it, or adds things that are not there. For example, a summary says revenue rose when the report says it fell.

Catch it

Ask for exact quotes
Trace each claim to the document
Drop what has no quote
Why it happens, and how to prevent it

What the model absorbed in training can override the page in front of it. Very long inputs also lose detail. See step 5: the context window.

Prevent it: say "answer only from this document," and require a quote for every claim.

7. Broken reasoning

Every step sounds right, but the logic or the arithmetic does not hold. For example, the right formula with a wrong sum in the third step.

Catch it

Ask it to show each step
Redo the math in a calculator or code
Try an edge case
Why it happens, and how to prevent it

The model predicts the next word. It does not calculate. A number that looks like the right kind of answer is what it produces.

Prevent it: have it use a calculator or code tool for anything with numbers.

The short version

  • Treat a confident answer as a draft. Confidence tells you nothing about truth.
  • Match the check to the kind. A date needs a source. A link needs opening. A sum needs redoing.
  • Give it what it needs. Your documents, today's date, and permission to say it does not know.

Go deeper

Sources and credit
Share𝕏⬡inYf✉