Skip to main content
Intermediatehow it works Verified ~7 min

How do you reduce hallucinations?

Source: Anthropic docs: Reduce hallucinations

Quick answer

Ground and verify. Retrieve the relevant sources and instruct the model to answer only from them.

Ground and verify. Retrieve the relevant sources and instruct the model to answer only from them. Anthropic's guidance adds three techniques: explicitly allow the model to say it does not know; for long documents, extract word-for-word quotes first and answer from those quotes; and require citations for each claim, optionally asking the model to find a supporting quote for every claim and retract it if none exists. Measure faithfulness on an evaluation set so you know it improved.

How to measure it

There is no single "hallucination rate". Pick a definition and measure it the same way each time. A common one for RAG is faithfulness: split each answer into claims and count the share that the retrieved context supports. For example, if 3 answers out of 50 in your evaluation set contain at least one unsupported claim, you can report that as 6% of answers with an unsupported claim. Review a sample by hand to check the automatic judge.

Related questions

This question is about reducing hallucinations. For why models hallucinate in the first place, see the question on the causes of hallucination. For choosing between RAG, fine-tuning and prompting, see the question that compares them.

Anthropic's page also notes that these techniques reduce hallucinations but do not eliminate them, so validate critical outputs.

Animated explanation
  1. 1Retrieverelevant sources
  2. 2Allow uncertainty"say you do not know"
  3. 3Quote firstextract exact quotes
  4. 4Answerfrom quotes only
  5. 5Verifyevery claim has a citation
Each step removes room for the model to invent; the last one makes it checkable.
See the concept: Next-token predictionAn LLM writes one token at a time
Next-token prediction

Data pipelines must be idempotent so that a rerun never doubles revenue

Done: the model emitted an end token.

The model never writes a whole sentence at once. It predicts one token, appends it, and predicts again.

Key points

  • answer only from context
  • allow "I don't know"
  • quotes first
  • cite and verify
  • measure

Common mistakes

  • Believing RAG alone stops hallucinations: the model can still ignore the retrieved text or add claims that are not in it, so faithfulness errors remain.
  • Telling the model to "be accurate" without giving it permission to say "I don't know", so it guesses.
  • Asking for citations but never checking that each citation really supports its claim.
  • Sending long documents and asking for an answer directly, instead of extracting quotes first.
  • Judging improvement by reading a few examples instead of measuring on an evaluation set.

Best practices

  • Give the model the sources and tell it to answer only from them.
  • Allow an explicit "I don't have enough information" answer, and test that it uses it.
  • For long documents, extract quotes first and answer from the quotes.
  • Require a citation per claim, and drop or retract claims without a supporting quote.
  • Track a faithfulness or unsupported-claim rate on a fixed evaluation set for every change.

Likely follow-ups

  • How do you measure hallucination rate?
  • Why can a RAG system still hallucinate even when the right chunk was retrieved?
  • When would you choose RAG, fine-tuning or better prompting to reduce wrong answers?
  • How do you check that a citation really supports a claim?
  • Why does allowing "I don't know" reduce false answers, and what is the downside?

References

Discussion