Hallucination Mitigation: RAG, Decoding, and Training › Post-Hoc Verification

Michael BrenndoerferMarch 20, 20263 min read
Language AI HandbookAll chapters
Part 56 of 67Hallucination and Factuality
Chapter 432Hallucination Mitigation: RAG, Decoding, and Training › Post-Hoc Verification
Reading section 6 of 12 · Post-Hoc Verification · 3 minSection 6 of 12 · 3 min

Book contents

Section 6 of 12 · 3 min read

Hallucination Mitigation: RAG, Decoding, and Training › Post-Hoc VerificationOne section · Sections in this chapter6 / 12 ↓
Reading tools Definitions & inline links

Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.

Article links

Make inline references clickable

All of the strategies above attempt to prevent hallucination during generation. Post-hoc verification takes a different approach: generate first, then verify whether what was generated is factually accurate. This is valuable in settings where the cost of a wrong answer is high enough to justify the additional verification step.

Factual Consistency Checking

Factual consistency checking evaluates whether a generated response is consistent with a set of reference documents. Unlike hallucination detection (which requires knowing the ground truth fact), consistency checking only requires that you have reference documents that should support the response. This is a well-posed task: given document DD and claim CC, does DD entail, contradict, or not address CC?

Natural language inference (NLI) models are the workhorses of factual consistency checking. An NLI model takes a (premise, hypothesis) pair and classifies the relationship as entailment, contradiction, or neutral. For factual verification, the retrieved document is the premise and each claim in the generated response is the hypothesis. Claims that are contradicted or not addressed by any retrieved document are flagged as potentially hallucinated.

The limitation of NLI-based consistency checking is that it only checks consistency with what you retrieved, not with the world. If your retrieval system missed the relevant document, a hallucinated claim may be neither contradicted nor supported by the retrieved context, leading to a "neutral" judgment that does not identify the problem.

LLM-based verification uses a second language model as a fact checker. Given the generated response and optionally some retrieved context, the verifier model is asked to identify specific claims that appear inaccurate or unsupported. This approach benefits from the verifier model's general knowledge and reasoning capabilities, but introduces its own failure modes: the verifier can hallucinate corrections, be inconsistent, or be fooled by the same fluency that makes the original response convincing.

FActScore: Decomposed Factual Precision

FActScore (Factual Precision in Atomic Claims Score) is a systematic framework for measuring hallucination in long-form generation. Rather than treating an entire response as correct or incorrect, FActScore decomposes the response into atomic claims (simple, standalone factual assertions) and verifies each one independently against a knowledge base.

For a response yy about subject ss, FActScore is:

FActScore(y,s)=1∣A(y)∣∑a∈A(y)1[supported(a,s)]\text{FActScore}(y, s) = \frac{1}{|A(y)|} \sum_{a \in A(y)} \mathbf{1}\left[\text{supported}(a, s)\right]

where:

  • A(y)A(y): the set of atomic claims extracted from response yy
  • aa: a single atomic claim (e.g., "Marie Curie was born in Warsaw")
  • supported(a,s)\text{supported}(a, s): 1 if claim aa is supported by the knowledge base for subject ss, 0 otherwise
  • ∣A(y)∣|A(y)|: the total number of atomic claims extracted

The extraction step (decomposing a response into atomic claims) and the verification step (checking each claim against a knowledge base) can both be done with LLMs, making FActScore automatable at scale. The framework has been applied to biography generation, scientific summarization, and other long-form factual generation tasks, giving a principled way to compare models and mitigation strategies on the same scale.