Hallucination
- confabulation
- fabrication
What is Hallucination?
A hallucination is model output that is plausible in form but not grounded in fact or in the supplied context. It is a direct consequence of next-token prediction: the model optimises for what looks like a good continuation, and a fabricated answer often looks better than an admission of ignorance.
In practice
Nothing in the generation process distinguishes recalled information from constructed information — both are sampled from the same distribution, and both arrive with the same confident prose. This is why hallucinations cluster around specifics: exact figures, version numbers, function signatures, citations and URLs. These are precisely the places where a plausible-looking pattern exists and the true value is arbitrary, so the model produces something that fits the shape.
Mitigation is layered, not singular. Supplying the facts in context through retrieval removes the need to recall them. Asking for citations tied to supplied passages makes fabrication visible rather than invisible. Constraining output to a schema eliminates whole categories of invention. Verifying against a source of truth in code — does this API exist, does this identifier resolve, does this number match the record — catches what the model cannot check about itself. Explicitly permitting "I don’t know" in the instructions helps, because a model that has been given no acceptable way to decline will produce something.
The misconception is that hallucination is a defect to be patched out. It is inherent to a system that generates rather than retrieves, and the practical goal is containment: keep unverified generation away from decisions that matter, make the verifiable path the cheap one, and design interfaces that show users what an answer was based on rather than asking them to trust it.
Related terms
Articles covering this
Where Hallucination shows up in practice rather than in definition.