Early-bird price on the GenAI & Agentic AI Engineer Bootcamp batch. Grab a seat →

AI models hallucinate because they are built to produce a likely continuation of the text, not to look up and verify facts. When the model lacks the information, the most likely-sounding answer can still be wrong, and it arrives in the same confident tone as a correct one. Grounding, which means giving the model trusted source text and asking it to answer from that text with citations, reduces the problem sharply but does not remove it.

Key takeaways

  • A hallucination is a confident statement that is false or not supported by the source material. NIST calls it confabulation.
  • It follows from how language models work. It is not a rare glitch that a later version will simply delete.
  • Risk is highest for specific details: names, numbers, dates, quotations, references and anything recent or niche.
  • Grounding the model in documents, asking for quotes and citations, and allowing "I don't know" are the most effective controls.
  • Citations make checking faster. They do not make checking unnecessary.

This article is part of the beginner's guide, generative AI explained.

What counts as a hallucination?

The US National Institute of Standards and Technology (NIST) defines confabulation as "the production of confidently stated but erroneous or false content", and adds that it also covers outputs that drift from the prompt or contradict something the model said earlier in the same conversation. Anthropic's documentation describes hallucination as text that is "factually incorrect or inconsistent with the given context".

So there are two kinds worth separating:

KindWhat it looks likeExample
Factual errorA claim about the world that is falseA court case, book or statistic that does not exist
Unfaithful to the sourceA claim the supplied document does not supportA summary that states a deadline the contract never mentions

The second kind matters most at work, because it happens even when you have given the model the right document.

NIST also warns that models can produce "confabulated logic or citations" to justify an answer. A neat step-by-step explanation, or a reference that looks real, is not evidence that the answer is right.

Why does it happen?

NIST's generative AI profile puts the cause plainly: confabulations "are a natural result of the way generative models are designed". A language model generates output that approximates the patterns in its training data by predicting the next token, the next small piece of text. That statistical prediction often yields accurate text, and sometimes yields text that is wrong or inconsistent.

Several things make it more likely:

  • The answer is not in the model's knowledge. The topic is too recent, too local or too specialised to have appeared often in training text. Your company's internal policy is the clearest case.
  • The prompt asks for specifics. Exact figures, page numbers, URLs and quotations leave no room for an approximately right answer.
  • The prompt assumes something false. Ask "Why did the 2019 policy ban remote work?" and a model may explain a ban that never existed.
  • The answer is long and open-ended. NIST notes the problem is "particularly relevant" for open-ended prompts with long-form responses and in fields that need domain expertise.
  • The model was not given a way out. Unless told otherwise, a model tends to produce an answer instead of saying it does not know.

The tone stays the same whether the answer is right or wrong.

What is grounding, and how does it reduce hallucination?

Grounding means supplying trusted source material at the moment of the request and instructing the model to answer from it. The model stops relying on what it half-remembers from training and works from text that is in front of it.

There are three common ways to do it:

  • Paste or attach the document yourself. This is the simplest form and works in any chat tool.
  • Retrieval-augmented generation (RAG). A system searches your document store for passages relevant to the question and places them in the prompt automatically. Anthropic's glossary describes RAG as a way to "better ground the model's response in evidence" and to let it use information beyond its training data.
  • Search grounding. The model runs a web search and answers from the results. Google's documentation for grounding with Google Search lists the benefits as reducing hallucinations "by basing responses on real-world information", answering questions about recent events, and showing sources for the model's claims.

A left-to-right flow shows a grounded answer: a question is asked, relevant passages are retrieved, they are added to the prompt, the model answers with citations, and a person checks the cited passages.

Grounding has limits you should know before you rely on it:

  • It is only as good as the source. Anthropic's glossary notes that RAG's effectiveness "depends on the quality and relevance of the external knowledge base". An outdated policy document produces a well-cited outdated answer.
  • Retrieval can miss. If the search step fetches the wrong passages, the model answers from the wrong text or falls back on its own memory.
  • The model can still misread. A cited passage may not actually say what the answer claims.

The guide to retrieval-augmented generation explains how these systems are built and tested.

How do citations help?

A citation ties each claim to a specific passage, so a reviewer can check one sentence in seconds instead of rereading the whole document.

You can ask for citations in a prompt. Some platforms also build them in. Anthropic's citations feature returns the exact passage that supports each claim, and its documentation states that because the passage is extracted directly from the document you supplied, the citations are "guaranteed to contain valid pointers to the provided documents". Google's search grounding returns the source address and title for each cited span of the answer.

Read that guarantee carefully. It means the quoted passage really exists in your document. It does not mean the model's interpretation of the passage is correct, or that the document itself is right. A person still has to read the cited lines.

A worked example: the same question, ungrounded and grounded

A manager wants to know how many days of leave can be carried into the next year. The policy text below is invented for this example.

Ungrounded prompt

How many days of annual leave can employees carry forward at Northwind Logistics?

A model has no access to this company's policy. A typical ungrounded reply gives a confident general answer, such as a number of days that is common in other organisations, with nothing to show where it came from. It may be right by chance. You cannot tell.

Grounded prompt

Answer using only the policy text between the <policy> tags.
First quote the sentence or sentences that answer the question.
Then give the answer in one line.
If the policy does not answer the question, reply exactly:
"The policy does not say."

<policy>
4.2 Employees may carry forward up to 8 days of unused annual leave
into the next leave year. Carried-forward leave must be used by 31 March.
4.3 Leave above 8 days lapses unless a manager approves an exception
in writing.
</policy>

Question: How many days can be carried forward, and until when?

Expected shape of the reply

Quote: "Employees may carry forward up to 8 days of unused annual leave
into the next leave year. Carried-forward leave must be used by 31 March."

Answer: Up to 8 days, to be used by 31 March.

Now ask the grounded version something the policy does not cover, such as whether carried-forward leave can be paid out. The correct reply is "The policy does not say." That refusal is the behaviour you want, and it only appears reliably when the prompt permits it.

What can I do to reduce hallucinations today?

These steps come from Anthropic's published guidance on reducing hallucinations, and they apply to any chat assistant.

  1. Give the source. Attach or paste the document, and tell the model to use only that material and not its general knowledge.
  2. Allow uncertainty. Add a line such as "If you are not sure, or the document does not say, tell me." Anthropic says this "can drastically reduce false information".
  3. Ask for quotes first. For long documents, have the model extract word-for-word quotes and then answer from those quotes.
  4. Ask for a citation per claim, and tell the model to withdraw any claim it cannot support with a quote.
  5. Ask twice. Run the same prompt again and compare. Anthropic notes that inconsistencies across outputs could indicate hallucinations.
  6. Check what matters. Verify names, numbers, dates, quotations and references against the source before anything leaves your desk.

A clear prompt structure makes all six easier; see how to write a prompt that works. Keeping the supplied material short and relevant helps as well, for the reasons covered in tokens and context windows.

Anthropic's guidance closes with a caution worth repeating: these techniques significantly reduce hallucinations, but "they don't eliminate them entirely", and critical information should always be validated.

When is the risk too high to rely on the model alone?

NIST highlights applications that involve consequential decisions, and gives healthcare as an example, where a confabulated summary of patient information could lead to a wrong diagnosis. In settings like that, treat the output as a draft for a qualified person to verify, and test the tool's error rate on your own cases first; the method is in how to evaluate an AI tool before your team adopts it.

Common questions

Will newer models stop hallucinating?

Rates can fall as models and products improve, but the cause is the prediction-based design itself, as NIST describes. Plan for errors to become less frequent, not for them to disappear.

Does a web search feature fix the problem?

It helps with recent and factual questions, because the model answers from retrieved pages. It can still pick a poor source or misstate what a page says. Open the cited pages for anything important.

Does lowering the temperature stop hallucinations?

No. A lower temperature makes output more predictable, not more accurate. If the most likely continuation is wrong, the model will produce that wrong answer more consistently.

Free download: The AI fundamentals field guide

How large language models work, why they get things wrong, how to write a prompt that works and how to judge a tool before your team adopts it. Plain English, no coding. See what’s inside.