# AI hallucination

> AI Hallucination: What It Is and How to Test for It. Canonical page: <https://zapple.tech/glossary/ai-hallucination/>

An AI hallucination is output that a model states as fact but that is false, or not supported by what it was given. NIST uses the word confabulation. Teams test for it by sampling real questions, checking each answer against a source or reference, and counting the failures. The aim is a rate you can accept, not zero.

## What is an AI hallucination?

An AI hallucination is output a model presents as true that is false or not supported by what it was given. The word is informal. The [NIST Generative AI Profile](https://www.nist.gov/publications/artificial-intelligence-risk-management-framework-generative-artificial-intelligence) uses a more exact one, confabulation, and defines it as "the production of confidently stated but erroneous or false content (known colloquially as 'hallucinations' or 'fabrications') by which users may be misled or deceived". It adds that confabulations include output that diverges from the input or contradicts earlier statements in the same context.

A model vendor says the same of its own product. Anthropic's [guidance on reducing hallucinations](https://platform.claude.com/docs/en/test-and-evaluate/strengthen-guardrails/reduce-hallucinations) states: "Even the most advanced language models, such as Claude, can sometimes generate text that is factually incorrect or inconsistent with the given context."

The word covers a wider ground than testing. This page keeps to one question: how does a team find out whether its AI feature does this, before users do?

## Why do AI models hallucinate?

NIST gives the plain reason: confabulations "are a natural result of the way generative models are designed", because they generate outputs that approximate the statistical distribution of their training data. A language model predicts the next word. Such prediction can give accurate output and can give wrong output that reads just as fluently. NIST calls this particularly relevant to open-ended prompts for long-form answers and to domains that need highly contextual or domain expertise. For you the point is simple: fluent does not mean true.

## What kinds of hallucination are there, and which check catches each?

The kinds below are our reading, grouped by what a test can catch. They are not a standard taxonomy. The last row follows NIST's description of output that diverges from the input or contradicts earlier statements.

| Kind | Example pattern | Check that catches it | What the check needs |
|:--|:--|:--|:--|
| Invented fact | A policy, price or date that exists nowhere | Compare with a reference answer | Reference answers written by a person |
| Wrong attribution or citation | A real quote credited to the wrong document, or a link to a page that does not exist | Open each cited source and read it | A person, or a script that fetches the source |
| Unsupported by the supplied source | The answer adds a claim the retrieved document does not make | A source-support check (see [groundedness](/glossary/groundedness/)) | The source text for that answer |
| Wrong tool result reported as done | An agent says "refund sent" while the call failed | Compare the report with the system state | Access to the real end state |
| Contradicts itself or the question | Turn three denies what turn one said | A multi-turn test with a check on each turn | Scripted conversations with expected states |

A source-support check is one method and has its own page. Source support also depends on the quality of retrieval; our [RAG evaluation](/glossary/rag-evaluation/) page covers scoring that step.

## How much hallucination is acceptable for your product?

In our view, start from what one wrong answer costs you, and let that set the bar. A wrong cafe menu item costs little. A wrong legal statement, medical instruction or price can cost a lot. We give no threshold, because a number copied from elsewhere would not know your cost.

Teams count it as a rate: the share of sampled answers that fail a defined check.

## Which reduces hallucination more for your case: retrieval, a narrower prompt, or a check after the answer?

We found no sourced ranking that holds across products, so our advice is to test the options on your own questions. Three levers are documented:

- **Give the model the source.** Google Cloud's [grounding overview](https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/grounding/overview) says: "If you provide models with access to specific data sources, then grounding tethers their output to these data and reduces the chances of inventing content."
- **Narrow the prompt.** Anthropic lists allowing the model to say it does not know, asking for word-for-word quotes first, and asking for a citation per claim, with the claim retracted if none is found.
- **Check after the answer.** Microsoft says its [groundedness detection](https://learn.microsoft.com/en-us/azure/ai-services/content-safety/concepts/groundedness) "helps you ensure that large language model (LLM) responses are based on your provided source material, reducing the risk of non-factual or fabricated outputs". Microsoft's page says the feature retires on April 30, 2027. AWS's [contextual grounding check](https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-contextual-grounding-check.html) filters responses. Its Classic tier is strict: any information not stated in the grounding source lowers the score, including reasonable inferences.

Our working method to show which helps: change one thing at a time on the same fixed set of questions. Count failures before and after, and have a person read a sample of both. If the count does not move on your questions, the lever did not help your case.

## How do you test for AI hallucinations?

Our working method, in order:

1. Collect real questions from support logs or users, plus questions the system should refuse.
2. Write the expected answer, or name the source the answer must come from.
3. Run the questions and keep the full output.
4. Read a sample by hand before trusting any automatic score.
5. Score the rest by reference, by source support or with a judge model. The [LLM-as-a-judge](/glossary/llm-as-a-judge/) page explains how to check the judge.
6. Rerun the set after each change to the model, prompt or sources.

Our guides on [automating a chatbot test](/blog/types-of-automation-testing/how-do-you-automate-a-chatbot-test/) and [testing AI agents](/blog/types-of-automation-testing/how-to-test-ai-agents/) walk through the checks around it.

If you are choosing what to buy for a customer-facing chatbot, [AI chatbot testing](/services/ai-chatbot-testing/) is the service that tests whole conversations against your policies and tone of voice.

## What does AI hallucination testing not solve?

Testing gives a rate on the questions you sampled, not a guarantee on the next one. Anthropic's own guidance says its techniques do not eliminate hallucinations entirely, so the product still needs a fallback for a wrong answer. A person must own the sample and decide what counts as wrong. Our post on [whether AI will replace software testers](/blog/qa-engineers/will-ai-replace-software-testers/) covers what still needs a person.

## What does Zapple.Tech do about it?

If you are not sure how your AI feature's answers are checked before release, start with the evidence. Zapple.Tech starts with a one-week QA audit of one product area. It looks at its tests, pipeline and release process, and ends in a written report on what is at risk and what to fix first, plus a pilot plan you can run with Zapple.Tech or without it. Read more on the [QA audit and assessment](/services/audit-and-assessment/) page.

Tell us about your AI feature in the form below.

## FAQ

### What is an AI hallucination?

An AI hallucination is content a generative model presents as true that is erroneous, false or unsupported. NIST's term for it is confabulation, defined as confidently stated but erroneous or false content, and it notes that people also say hallucinations or fabrications.

### Why do AI models hallucinate?

NIST says confabulations are a natural result of how generative models are designed: they produce outputs that approximate the statistical distribution of their training data. Such prediction can give accurate output, and it can give wrong output that reads just as fluently.

### How do you test for AI hallucinations?

Our working method: collect real questions, including ones the system should refuse. Write the expected answer or name the source for each. Run them, have a person read a sample, then score the rest with a reference check, a source check or a judge model. Rerun after each model or prompt change.

### What is the difference between hallucination and groundedness?

Hallucination is the failure you want to prevent. Groundedness is one test for it, and it applies only when the model was given source material to answer from. A model with no source material can still hallucinate, so that case needs a reference answer to compare with.

### Can AI hallucinations be eliminated?

No source we found shows a method that does. Anthropic's guidance says its techniques significantly reduce hallucinations but do not eliminate them entirely. Plan for a wrong answer: add a fallback, a way for users to report it, and a person who owns the sample you test.

## Sources

- [NIST AI 600-1, Artificial Intelligence Risk Management Framework: Generative AI Profile (July 2024, the current edition; page updated 2026-04-08)](https://www.nist.gov/publications/artificial-intelligence-risk-management-framework-generative-artificial-intelligence)
- [Anthropic documentation, Reduce hallucinations (current docs)](https://platform.claude.com/docs/en/test-and-evaluate/strengthen-guardrails/reduce-hallucinations)
- [Microsoft Learn, Azure AI Content Safety, groundedness detection (last updated 2026-10-20)](https://learn.microsoft.com/en-us/azure/ai-services/content-safety/concepts/groundedness)
- [AWS, Amazon Bedrock Guardrails, contextual grounding check (current docs)](https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-contextual-grounding-check.html)
- [Google Cloud documentation, Grounding overview (current docs)](https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/grounding/overview)
