What is AI hallucination? Causes, examples, and fixes
Also called AI hallucination, LLM hallucination, confabulation
Definition
A hallucination is output from a language model that is fluent and plausible but factually false, unsupported by the provided sources, or invented outright, such as a fabricated citation or package name.
A hallucination is a confident, well-formed statement from a large language model that is false or not supported by its input. A survey by Ji et al. splits hallucinations into two kinds: intrinsic hallucinations contradict the source material the model was given, and extrinsic hallucinations add claims the source can neither confirm nor refute. The term covers invented facts, fake citations, nonexistent functions in generated code, and wrong figures in summaries.
Why LLMs hallucinate#
An LLM generates text by predicting likely next tokens; it does not look facts up. When training data carries little signal about a fact, such as an obscure person's birthday or a rarely used API, the model still produces a plausible continuation. A 2025 OpenAI paper, Why Language Models Hallucinate, argues that training and evaluation reinforce the habit: most benchmarks grade answers as right or wrong, so guessing scores better than admitting uncertainty. The authors propose changing how mainstream benchmarks are scored so that expressing uncertainty is not penalized.
Other causes sit in the application. Retrieval can return the wrong documents, a long context window can bury the relevant passage, and a higher temperature setting makes low-probability tokens more likely to be sampled.
Examples of AI hallucination#
- Fabricated legal citations. In Mata v. Avianca (S.D.N.Y. 2023), a federal judge sanctioned lawyers who filed a brief citing court decisions that ChatGPT had invented.
- Invented packages. A 2024 study of code-generating models found that at least 5.2% of package references from commercial models and 21.7% from open-source models pointed to packages that do not exist, a gap attackers can exploit by registering those names.
- Unfaithful summaries. A summary states a number or conclusion that the source document does not contain.
Why hallucination matters#
Hallucinations are hard to catch because they look identical to correct output. OWASP lists misinformation as LLM09:2025 and names hallucination as a major cause.
Teams reduce the rate by grounding answers in retrieved sources with retrieval-augmented generation, requiring citations, allowing the model to answer "I don't know," and measuring faithfulness with LLM evaluation suites and LLM-as-a-judge graders. None of these methods drives the rate to zero, so high-stakes outputs still need verification against a source of truth.
Related terms
Guides that cover hallucination
- What is retrieval-augmented generation (RAG)? How RAG works
- LLM evaluation: a practical guide to evals, metrics, and judges
- AI agent evaluation: metrics, graders, and how to test agents
- Reasoning models: how they work and when to use them
- LLM benchmarks explained: what they measure and how to read them
- RAG vs fine-tuning: how to choose for your LLM application
- What is AI engineering? The discipline, the stack, and the work
Cite this definition
The AI Engineering Editors. "What is AI hallucination? Causes, examples, and fixes." The AI Engineering, updated Nov 06, 2026. https://theaiengineering.com/glossary/hallucination
- Title
- What is AI hallucination? Causes, examples, and fixes
- Author
- The AI Engineering Editors
- Publisher
- The AI Engineering
- Updated