AI glossary · Models and context
What is an AI hallucination?
Also called: AI hallucination, LLM hallucination
Definition
A hallucination is a confident, plausible-sounding statement from a language model that is false or unsupported by its input, such as an invented citation, date, function or quote.
Explained
Why do AI models hallucinate?
A model writes a likely continuation of its context; nothing in it checks that a sentence is true. Hallucinations can contradict the input you supplied, such as misreading a document, or the world, such as citing a paper that doesn’t exist. In one example from the research below, an open-weights model asked for a researcher’s birthday “if you know” gave three different wrong dates in three tries.
A 2025 paper by OpenAI and Georgia Tech researchers, “Why Language Models Hallucinate”, gives two causes. In pretraining, errors arise from ordinary statistical pressure whenever true and false statements can’t be told apart, even with error-free data. Afterwards, most benchmarks grade answers right or wrong and give nothing for “I don’t know”, so guessing scores better and models are tuned to be good test-takers.
Example
Why guessing wins under right-or-wrong grading
The paper proposes stating a confidence threshold t in the task: a right answer scores 1, “I don’t know” scores 0, and a wrong answer loses t ÷ (1 − t) points. Take a model that is 30% sure of an answer.
Under plain right-or-wrong grading, guessing is worth 0.30 on average and abstaining 0, so the model should always guess. With t = 0.5 or 0.9, the same guess is worth −0.40 or −6.00, and “I don’t know” wins. The paper argues leaderboards mostly use the first rule, so models learn to bluff.
| Grading | Points lost for a wrong answer | Guess | Say “I don’t know” |
|---|---|---|---|
| Right or wrong (t = 0) | 0 | 0.30 | 0.00 |
| Confidence target t = 0.5 | 1 | −0.40 | 0.00 |
| Confidence target t = 0.9 | 9 | −6.00 | 0.00 |
Computed from the scoring rule in the paper; the 30% confidence is an illustration.
Cost and quality
Why do hallucinations matter, and how do you reduce them?
Hallucinations are the main reason to check model output before it reaches users or runs as code. The fixes that work are about evidence, not settings: ground answers in documents you supply (RAG), ask for direct quotes or citations and drop claims without one, and say explicitly that “I don’t know” is acceptable. Anthropic’s guide to reducing hallucinations recommends all three.
We don’t quote hallucination rates here: they depend heavily on the task and benchmark, and change with every model release. Test on your own questions.
Don’t mix up
Is every wrong answer a hallucination?
- Hallucination vs invalid output
- Broken JSON or a reply cut off at the token limit is a format failure, fixed with structured outputs or a higher cap. A hallucination can be perfectly formatted and still false; a schema guarantees the shape, not the facts.
- Hallucination vs temperature
- Lowering temperature makes output more repeatable, not more true: a model can give the same wrong answer every time.
FAQ
Questions people ask
What does an AI hallucination look like?
Common forms are a citation or URL that doesn’t exist, a function, API parameter or package name that was never published, a wrong number or date stated with confidence, and a quote nobody said. In code it often looks plausible: an import of a library that sounds right but isn’t real, or a method the library doesn’t have. The more specific and checkable the claim, the more it is worth checking.
How do you check if an AI is hallucinating?
Treat specific claims as unverified until checked. Open every cited link or paper, search for exact quotes, look up package and function names in the official docs before installing or calling them, and compare numbers against the primary source. Giving the model the source text and asking it to quote the passage it relied on makes unsupported claims much easier to spot.
Can AI hallucinations be fixed completely?
Not with today’s models. The 2025 paper argues that training and evaluation reward guessing over admitting uncertainty, so models learn to bluff when unsure, and it proposes changing how benchmarks are scored. Grounding answers in supplied documents, requiring quotes or citations and allowing “I don’t know” reduce hallucinations, but none removes them, so keep a check in place.
Go deeper
Try it and read more
- Free toolContext Window CheckerSee whether your text fits each model’s context window.
- Free toolJSON RepairFix broken JSON from LLM output.
- Guide · 14 min readRAG chunk size and overlap: how to choose the right settingsHow to choose a RAG chunk size and overlap: recommended sizes by document type, token vs character splitters, what research shows and a test you can run.
- Guide · 13 min readWhy LLMs return invalid JSON, and how to stop itWhy LLMs return invalid JSON and how to stop it: structured outputs, schema validation with Zod or Pydantic, retries, safe repair and streaming partial JSON.
Related