---
title: "Hallucination"
type: "glossary term"
url: "https://aifordevs.org/glossary#hallucination"
markdown: "https://aifordevs.org/glossary/hallucination.md"
publisher: "AI for Devs"
license: "https://aifordevs.org/reuse"
attribution: "Credit AI for Devs and link to https://aifordevs.org/glossary#hallucination"
---

# Hallucination

A hallucination is model output that reads as confident and fluent but is false or unsupported by the input, such as an invented API, citation, or number. Retrieval and tool use reduce it, and evals measure it, but none of them remove it.

Kalai et al. (2025) trace it to incentives: pretraining produces errors when a model cannot separate true statements from false ones, and most benchmarks grade like exams where guessing can beat saying "I don't know." In your own evals, score a wrong answer worse than an abstention.

## Example

A coding assistant that suggests a function missing from the library's current version has hallucinated. A type check catches it before the code runs.

## Source

[Kalai et al., Why Language Models Hallucinate (2025)](https://arxiv.org/abs/2509.04664)

## Related terms

- [RAG](https://aifordevs.org/glossary#rag)
- [Eval](https://aifordevs.org/glossary#eval)
- [Guardrails](https://aifordevs.org/glossary#guardrails)

## Cite this term

AI for Devs. "Hallucination." https://aifordevs.org/glossary#hallucination

- Page: https://aifordevs.org/glossary#hallucination
- Markdown: https://aifordevs.org/glossary/hallucination.md
- Reuse: Quote or summarize with a link to this page. Terms: https://aifordevs.org/reuse
- Publisher: AI for Devs
