Hallucination

A hallucination is a response from an AI model that is fluent and confident but factually wrong, made up, or not supported by the sources the model was given.

Also known as: Confabulation, fabrication

Related terms in this glossary

How it works

A language model predicts likely next tokens. It has no built-in check against reality, so when it lacks the right information it can still produce a plausible answer: an invented citation, a wrong policy date, a product feature that does not exist. OpenAI's 2025 research paper Why language models hallucinate argued that common training and evaluation methods reward guessing over admitting uncertainty, which makes the behavior persist.

Two kinds are useful to separate:

  • Factual errors: the answer contradicts the world.
  • Unfaithful answers: the answer contradicts or goes beyond the documents supplied, even if it happens to be true.

Why it matters

In business settings a confident wrong answer can be worse than no answer. A support bot that invents a refund policy creates a commitment and a complaint. The OWASP Top 10 for LLM Applications (2025) lists misinformation as risk LLM09. Hallucination cannot be eliminated, but it can be reduced and caught:

  • Ground answers in retrieved documents (RAG) and require citations.
  • Instruct the model to say "I don't know" and reward that in testing.
  • Use structured outputs and validate facts against systems of record.
  • Measure faithfulness with evaluation sets before and after changes.
  • Keep a person in the loop where errors are costly.

Gepton measures this in AI evaluation and observability.

Hallucination in depth

Where hallucinations come from in real systems

In production, most hallucinations trace back to the system around the model rather than the model alone:

  • Missing context: retrieval did not find the right document, so the model filled the gap.
  • Conflicting context: old and new versions of a policy both retrieved, and the model blended them.
  • Pressure to answer: prompts that demand an answer and never allow "I don't know".
  • Tool failures hidden from the model: an API returns an empty result and the model invents plausible data.
  • Long or noisy context: the relevant fact is buried among loosely related text.
  • Out-of-scope questions: users ask things the system was never designed to answer.

Example: finding the cause of invented refund rules

Example: a hypothetical e-commerce assistant occasionally tells customers they can return sale items, which the policy does not allow. Trace review shows that for these conversations, retrieval returned the general returns page but not the sale-items exception, which lived in a separate FAQ with different wording. The fixes target the cause: merge the exception into the main policy chunk, add the sale-items case to the evaluation set, add an output check that flags any return promise for orders tagged as sale items, and route such cases to a human. Faithfulness on the evaluation set is compared before and after.

Detection techniques

TechniqueHow it worksLimits
Faithfulness scoringA judge model checks whether each claim is supported by the supplied sourcesJudge can be wrong; calibrate with human review
Rule checks against systems of recordDates, amounts, IDs and statuses compared with database valuesCovers structured facts only
Citation verificationConfirm cited passages exist and contain the claimRequires citations in the output
Self-consistencySample several answers; disagreement signals uncertaintyExtra cost and latency
User feedback and escalationsFlags from users and agents reviewed weeklySlow, incomplete

Measuring hallucination over time

Keep a labeled set that includes answerable questions, unanswerable questions and questions with tricky near-matches. Track the share of unsupported claims, the correct-abstention rate on unanswerable questions and the false-abstention rate on answerable ones. Report by topic, since hallucinations cluster where documentation is weak. Sample production conversations for human review on a regular schedule, and add every confirmed case to the evaluation set.

Common mistakes

  • Trying to fix hallucinations with prompt wording alone when retrieval is the real problem.
  • Choosing a larger model and assuming the problem is gone without measuring.
  • Punishing abstention in evaluations, which trains the system to guess.
  • Letting generated text write directly into records, contracts or customer messages without validation or review where errors are costly.

Hallucination is reduced through grounding and RAG, checked with guardrails and structured output, and contained with human-in-the-loop review. We measure and reduce it in AI evaluation and observability and AI-powered search.

Questions about Hallucination

Something else? Send us your question and an engineer replies with next steps.

Do reasoning models hallucinate less?

Reasoning can reduce some errors, especially in multi-step calculations and logic, because the model works through intermediate steps. It does not remove hallucination, and some evaluations have found reasoning models still produce confident unsupported claims, particularly on factual questions without sources. The more reliable levers remain grounding answers in retrieved or live data, allowing and rewarding abstention, validating facts against systems of record and measuring faithfulness on your own evaluation set. Test any model on your own data rather than relying on general claims.

How should we tell users that an AI assistant can make mistakes?

Be clear and specific without burying the product in disclaimers. State in the interface that answers are generated by AI and may contain errors, show sources so users can check important points, and make it easy to reach a person or report a wrong answer. For high-stakes topics such as money, health or legal matters, design the flow so the assistant points to official sources or hands over to a human rather than relying on a warning. A disclaimer does not replace testing and controls.

Articles that mention Hallucination

All articles

Jump to

↑↓ to move↵ to open