Dev Notes
Metrics

Hallucination Rate vs. Accuracy: The Metrics Teams Actually Use

Learn which production evaluation metrics matter and why hallucination rate and answer accuracy detect different failures.

82% answer accuracy still left users with confident wrong answers containing fabricated policy terms, dates, and procedures. A RAG-based customer-support bot had held that 82% result for three months, giving the team confidence. A support engineer then noticed the specific false details. The post-mortem showed that 82% accuracy measured whether responses addressed the question, not whether their claims were grounded in retrieved documents.

Two metrics, two failure modes

Teams often use hallucination rate and answer accuracy as interchangeable measures of LLM quality. They are different measures and can diverge sharply in production:

  • Answer accuracy: The share of responses that correctly address the question, usually measured against a reference answer or by judging whether the response shows correct understanding of the request.
  • Hallucination rate: The share of responses containing fabricated or factually unsupported claims, measured against supplied context for RAG or verifiable facts for general-purpose systems.

A response can be high in accuracy and high in hallucination at the same time. For example, it may identify the question's topic and give a coherent, plausible answer while citing a statistic absent from every retrieved document. An accuracy evaluator asking whether it addressed the question gives a high score. A hallucination evaluator asking whether every claim is grounded gives a low score. One response can therefore produce two legitimate metrics with opposite signals.

How hallucination rate is computed in practice

For RAG systems, the most useful operational measure treats hallucination as two components rather than one binary flag.

  • Faithfulness: Does the response contain only claims traceable to retrieved context? Decompose the response into individual factual claims and check each against the context documents. Natural language inference (NLI) models tuned for textual entailment work reasonably well. LLM judges using a structured prompt such as "which claims in this response are not supported by the provided context" can also work. Very long contexts reduce judge attention and may cause false negatives for claims appearing late in the context.
  • Context grounding rate: What fraction of factual claims are grounded? A response with eight claims, seven grounded, differs meaningfully from one with three claims, two grounded, even though both fail binary faithfulness. A continuous grounding rate shows the severity of hallucination rather than only its presence.

Without a retrieved context document, hallucination detection is more difficult. Options include using reference answers as a proxy, asking a domain-specialized LLM judge, or applying external factual verification to particular claim types. These methods have higher error rates than context-grounded faithfulness checks and should be calibrated against human labels before production use.

How answer accuracy is computed in practice

Answer accuracy is commonly classified as binary or at three levels: correct, partially addressed, or missed. The principal methods have different tradeoffs:

  • Exact match: Suitable for short factual questions with one unambiguous answer. It is fragile under paraphrasing and unsuitable for open-ended or abstractive tasks.
  • Semantic similarity against a reference answer: Embed the generated and reference answers, then calculate cosine similarity. This handles paraphrasing well but can miss factual errors that remain semantically close to the correct answer, such as a plausible but wrong year.
  • LLM judge for correctness: Give the judge the question, reference answer, and generated response, asking whether the response correctly addresses the request. This is more flexible and handles multi-hop reasoning, but costs more and needs its own calibration.

For tasks involving specific entities, dates, or numerical values, an LLM judge outperforms semantic similarity because two responses can be semantically close while only one is factually correct.

When the metrics diverge

The most informative cases are those where accuracy and hallucination rate point in opposite directions. Four patterns are especially useful:

  • High accuracy, high hallucination: The model understands the question and responds coherently but invents supporting details. This is common in summarization and Q&A, where plausible specifics may not appear in the source. The response reads well and is directionally correct, satisfying accuracy checks, but its specific claims lack grounding.
  • Low accuracy, low hallucination: The model remains faithful to retrieved context, but that context lacks what the question requires. This is a retrieval failure rather than a generation failure. The model is behaving appropriately given its input, while the retriever returns the wrong documents.
  • High accuracy, low hallucination: The model answers correctly using only claims grounded in context. This is the target state for a well-functioning RAG system and should dominate in a well-tuned pipeline.
  • Low accuracy, high hallucination: The model misunderstands the question and invents content. This is the most harmful user-facing failure and usually suggests operation far outside the training distribution or completely irrelevant retrieved context.

Which metric to optimize for, given your task

The choice depends on the cost of each failure. In information retrieval and Q&A systems used for real decisions, hallucination rate is the primary concern. A confident answer with fabricated support is worse than an incomplete answer that remains grounded. Incomplete answers can be recovered; fabricated specifics cannot, especially when they prompt action.

For task-completion systems such as code generation, classification, or form filling, answer accuracy is usually primary. Whether reasoning was perfectly sourced matters less than whether the output performs the intended function.

In practice, track both metrics separately by query category and find categories where they diverge sharply. Those categories contain the most concentrated risk and offer the greatest opportunity for targeted changes to prompting, retrieval, or evaluation rubrics.

Optimizing one metric does not automatically improve the other. A model fine-tuned for context faithfulness can still lose accuracy when retrieval quality declines. A model tuned for benchmark accuracy can still hallucinate on out-of-distribution inputs. The metrics need separate evaluation tracks, monitoring, and often separate remediation. Averaging them into one number can leave a stable-looking score while one underlying failure mode quietly worsens.

Track Both Metrics in One Place

Monitor hallucination rate alongside accuracy checks for every LLM call.