{"title":"Test LLM Hallucination, Abstention and Citation Faithfulness","excerpt":"A well-formed citation to a real passage can still sit under an invented answer. This guide splits hallucination into contradicted claims, unsupported claims, citations that do not entail their claim and wrong abstention, using a 46-case lab with answerable, unanswerable, partial and conflicting-source questions and a rule-based system with switchable failure modes. It shows two systems with the same headline rate and opposite diagnoses, a lexical entailment check and the cases it gets wrong, and a threshold sweep that prices over-refusal against fabrication with Wilson intervals.","canonicalUrl":"https://automationtester.in/blog/ai-in-testing/test-llm-hallucination-abstention-citations","category":{"name":"AI in Testing","slug":"ai-in-testing"},"tags":["llm-evaluation","hallucination-testing","rag-evaluation","citation-faithfulness","abstention","ai-testing"],"author":{"name":"Shashank Rawlani","url":"https://shashank.rawlani.com","linkedin":"https://www.linkedin.com/in/shashankrawlani/"},"datePublished":"2026-11-09T13:30:00.000Z","dateModified":"2026-11-09T13:30:00.000Z","coverImage":{"url":"https://ik.imagekit.io/automationtester/automationtester-in/blog/covers/v3/test-llm-hallucination-abstention-citations.webp","alt":"Dark technical illustration read left to right, four rows. In the first row a green panel with three pills is joined by a thick green line, crossing a dashed grey vertical line at a ringed node, to a green panel carrying identical pills, with an arrowhead landing on it. In the second row an orange panel sends a thin grey line across the same dashed line toward a grey panel whose pills are different, and a crossed-out orange ring sits on the line just before it. In the third row an orange panel sends a dashed orange line across the dashed line to an empty dashed orange outline where no source panel exists. In the fourth row an empty dashed green outline sends a short green line to a ringed node that ends at a small vertical bar, short of the dashed line, with nothing beyond it."},"contentHtml":"<div class=\"callout callout-info\"><strong>Quick answer:</strong> Score hallucination as four separate behaviours: contradicted claims, unsupported claims, citations that do not entail the claim they sit on, and wrong abstention, meaning an answer where evidence is missing or a refusal where it is present. Split each answer into claims, label every claim supported, contradicted or unsupported against its cited passage, and build cases with no, partial and conflicting evidence. Sweep the abstention threshold and report over-refusal next to fabrication. Citation format is a cheap, separate check, and it can read 100% while support fails.</div>\n\n<p>A release-note assistant is indexed on Tidewater 4.0 to 4.2, a made-up sync CLI used throughout this article. A user asks whether sync in 4.2 supports a <code class=\"language-text\">--dry-run</code> flag. The notes never mention one. The assistant answers that 4.2 adds the flag and lists what it does, with a citation, <code class=\"language-text\">rn-41-05</code>, which is a well-formed id of a real passage in the index. That passage says which Python versions 4.1 supports. A format check passes, a \"has a citation\" dashboard tile passes, and the answer is invented.</p>\n\n<p>This is Part 5 of the LLM and RAG Evaluation series. <a href=\"/blog/ai-in-testing/build-llm-eval-dataset-product-risks\">Part 1</a> covers building the cases, <a href=\"/blog/ai-in-testing/calibrate-llm-as-judge-scores\">Part 2</a> covers trusting a model grader, and <a href=\"/blog/ai-in-testing/debug-rag-retrieval-vs-generation-failures\">Part 3</a> covers finding which stage lost the evidence. Here the evidence is assumed to be wherever it is, and the question is what the system says about it: is each claim supported, does each citation entail its claim, and does the system stop when it should.</p>\n\n<div class=\"callout callout-warning\"><strong>Checked on 2026-11-03.</strong> Every number below comes from a lab run on Python 3.14.5 using only the standard library, with no model or network call. The system under test is a rule-based stub with switchable failure modes and the 46-case corpus is invented, so the counts describe how the metrics behave, not how any real model fails. Wilson intervals were cross-checked against statsmodels 0.15.0 (the current PyPI release, uploaded 2026-08-27) in a scratch virtual environment; the two agree to within 1e-5 because the lab uses z = 1.96. Ragas 0.4.3 (PyPI, 2026-01-13) was read in its documentation and not run. NIST AI 600-1 is the July 2024 Generative AI Profile.</div>\n\n<h2 id=\"hac-failures-in-one-word\">Which failures hide inside the word hallucination?</h2>\n\n<p>The research literature does not treat it as one thing. The survey by Ji and colleagues splits output by what the source says: intrinsic hallucination contradicts the source, and extrinsic hallucination is output the source can neither support nor contradict. The survey adds that extrinsic content is not always wrong, only unverifiable, and that most published metrics fold both kinds into one number. NIST's profile calls the umbrella \"confabulation\" and notes that confabulated citations, offered as justification, can make people trust a wrong answer more. That last point is why a citation needs its own test.</p>\n\n<p>Two other definitions matter for the tests. The AIS framework (Attributable to Identified Sources) asks whether a reader, shown the cited part of the source, would agree that \"according to P, s\". It deliberately does not judge whether s is true; source quality is a separate question. FActScore breaks a generation into atomic facts and reports the share a knowledge source supports, computed only over responses that did not abstain. Its authors say outright that the score does not penalise a model for abstaining too often, and recommend reporting the abstention rate beside it.</p>\n\n<table>\n<thead>\n<tr><th>Behaviour</th><th>What it means here</th><th>Where the definition comes from</th><th>What scores it</th></tr>\n</thead>\n<tbody>\n<tr><td>Contradicted claim</td><td>A statement the cited evidence conflicts with</td><td>Intrinsic hallucination, Ji et al.</td><td>Claim-level label against the passage</td></tr>\n<tr><td>Unsupported claim</td><td>A statement no passage supports or contradicts</td><td>Extrinsic hallucination, Ji et al.; unsupported statements in Ragas faithfulness</td><td>Claim-level label against the passage</td></tr>\n<tr><td>Citation that does not entail the claim</td><td>A valid pointer to a passage that does not support the sentence</td><td>AIS attribution; ALCE citation recall and precision</td><td>Entailment of claim by cited text</td></tr>\n<tr><td>Wrong abstention</td><td>Answering with no evidence, or refusing with evidence in hand</td><td>FActScore's note on abstention; selective prediction</td><td>Abstention precision and recall, over-refusal rate</td></tr>\n<tr><td>Unflagged conflict</td><td>Two sources disagree and the answer states one</td><td>No metric in the sources above; scored here as a behaviour</td><td>Case-level check that both sides and a conflict note appear</td></tr>\n</tbody>\n</table>\n\n<p>Two well-known methods answer a different question and are not used here. TruthfulQA measures imitative falsehoods in a model's own knowledge with no document supplied, and its authors point out that a system answering \"no comment\" to every question is perfectly truthful, which is why they also score informativeness. SelfCheckGPT estimates hallucination from the consistency of several sampled answers when no source is available. When your application holds the source, comparing the answer to it is the stronger check.</p>\n\n<h2 id=\"hac-lab-setup\">What does the lab system look like?</h2>\n\n<p>The corpus is 32 short passages: release notes for 4.0, 4.1 and 4.2, a command reference and a migration guide. Nothing for 4.3 is indexed. The 46 cases come in four kinds, each with its own correct behaviour.</p>\n\n<table>\n<thead>\n<tr><th>Kind</th><th>Cases</th><th>Correct behaviour</th><th>Example</th></tr>\n</thead>\n<tbody>\n<tr><td>Answerable</td><td>18</td><td>State the supported claims, each cited to the passage that carries it</td><td>Which bug did 4.1 fix for large files?</td></tr>\n<tr><td>Unanswerable</td><td>12</td><td>Abstain</td><td>Does sync in 4.2 support a <code class=\"language-text\">--dry-run</code> flag?</td></tr>\n<tr><td>Partially answerable</td><td>8</td><td>Answer the supported part, say the rest is not covered</td><td>What does verify do, and how long does it take on a 1 TB bucket?</td></tr>\n<tr><td>Conflicting sources</td><td>8</td><td>State both sides and say the sources disagree</td><td>What is the default sync timeout in 4.2? (60 s in the notes, 45 s in the reference)</td></tr>\n</tbody>\n</table>\n\n<p>The unanswerable questions are written to look answerable. The SQuAD 2.0 authors set that as a design rule: unanswerable questions should appear relevant to the passage, otherwise a word-overlap heuristic can tell them apart without understanding anything. The lab's gate uses exactly such a heuristic, the share of question terms found in the top-ranked passage, so the overlap in its scores is the test of whether the cases are hard enough:</p>\n\n<pre class=\"language-text\"><code class=\"language-text\">retrieval confidence by kind (min / median / max)\n  answerable           0.33 / 0.75 / 1.00\n  unanswerable         0.17 / 0.40 / 0.75\n  partially answerable 0.17 / 0.67 / 0.75\n  conflicting          0.60 / 0.83 / 1.00</code></pre>\n\n<p>The ranges overlap. The lowest-scoring answerable question is a plain lookup of the package name on PyPI (0.33), and the highest-scoring unanswerable one asks for the default timeout of the verify command, which shares \"default\", \"timeout\" and \"verify\" with passages about other things (0.75). No threshold separates them, which is the property the sweep later in this article depends on.</p>\n\n<p>The system is a gate plus a generator. The gate abstains when confidence falls below a threshold. The generator can be switched into named failure modes, each of which fires on a deterministic share of cases chosen by hashing the case id, so a run repeats exactly:</p>\n\n<pre class=\"language-python\"><code class=\"language-python\">@dataclass\nclass Config:\n    tau: float = 0.0        # gate: abstain when retrieval confidence &lt; tau\n    fabricate: float = 0.0  # unanswerable cases where the generator answers anyway\n    overreach: float = 0.0  # partial cases where the unknown part gets an invented answer\n    decorate: float = 0.0   # statements that cite the top-1 hit instead of their real source\n    drift: float = 0.0      # claims where one fact changes but the citation stays\n    flatten: float = 0.0    # conflict cases that state only one side\n\ndef fires(rate, case_id, mode):\n    return int(hashlib.sha256(f\"{mode}:{case_id}\".encode()).hexdigest(), 16) % 1000 &lt; rate * 1000\n\ntop, conf = retrieve(case[\"q\"])\nif conf &lt; cfg.tau:\n    return Response(case, [Statement(\"The indexed notes do not answer this.\", [], kind=\"abstain\")], True, conf, top)\nif kind == \"U\" and fires(cfg.fabricate, cid, \"fabricate\"):\n    out.append(Statement(case[\"fabrication\"], [top], [Atom(case[\"fabrication\"], [], \"unsupported\")]))</code></pre>\n\n<p>Because the stub builds each statement, it knows the ground-truth label of every claim it emits: supported, contradicted or unsupported. In a real system that label comes from a person reading the source. Here it lets the lab measure the automatic checks, including the one used for citations, against something fixed.</p>\n\n<p>For the worked example, case U01 asks about <code class=\"language-text\">--dry-run</code>. Its top-ranked passage is <code class=\"language-text\">rn-41-05</code> with confidence 0.17. With the generator in its default mode the answer is an abstention. With <code class=\"language-text\">fabricate=1.0</code> and no gate it is the invented sentence with that citation. With the same generator behind a gate at 0.3 it abstains again, because the gate caught what the generator did not.</p>\n\n<h2 id=\"hac-claim-level-scoring\">How do you score a claim, not an answer?</h2>\n\n<p>A response is a bundle of statements, and a bundle can be partly right. The papers pick different units. FActScore uses atomic facts, short statements each carrying one piece of information. Ragas extracts statements from the answer and reports the share its verifier judges supported. Google's check-grounding API in Agent Search takes the other side of the trade-off: in the version documented there a sentence is a single claim, a claim counts as grounded only if the facts wholly entail it, and a partly correct claim is ungrounded as a whole. Its own example is a founders-and-year sentence where the names are right and the year is wrong.</p>\n\n<p>The two rules disagree on compound sentences, and the lab stores both. Each statement holds atoms with ground-truth labels, and the sentence label is derived from them:</p>\n\n<pre class=\"language-python\"><code class=\"language-python\">def statement_label(stmt):\n    labs = {a.label for a in stmt.atoms}\n    if \"contradicted\" in labs:\n        return \"contradicted\"\n    return \"unsupported\" if \"unsupported\" in labs else \"supported\"</code></pre>\n\n<p>Case A02 asks what 4.1 adds to sync and what its default is. With the stub merging two facts into one sentence and drifting the first, the output is:</p>\n\n<pre class=\"language-text\"><code class=\"language-text\">Tidewater 4.1 adds the --threads flag to sync; In 4.1 the default for --parallel is 4 workers.\n  cites rn-41-01, rn-41-02\n  atom 1: Tidewater 4.1 adds the --threads flag to sync.          -&gt; contradicted\n  atom 2: In 4.1 the default for --parallel is 4 workers.         -&gt; supported\n  sentence label: contradicted     atoms supported: 1 of 2</code></pre>\n\n<p>A sentence-level rule scores that answer 0 of 1, an atomic rule scores it 1 of 2, and both are defensible. What is not defensible is picking one without saying so, because the number moves with the choice. Compound claims are also where a model grader is most likely to wave an answer through on the strength of the correct half. For a customer-facing answer the stricter sentence rule is the safer default, with atoms kept in the record so you can still see which half failed.</p>\n\n<h2 id=\"hac-single-rate-hides\">What does a single hallucination rate hide?</h2>\n\n<p>Define the headline number the way a dashboard would: the share of responses containing at least one claim that is not supported. Then build four systems and score them on all 46 cases. The \"drifts a fact\" system's drift rate was found by search so its headline equals the first system's. That match is constructed for the demonstration; the splits that follow are measured.</p>\n\n<table>\n<thead>\n<tr><th>System</th><th>Headline rate (Wilson 95%)</th><th>Unsupported / contradicted claims</th><th>Correct behaviour: answerable</th><th>Unanswerable</th><th>Partial</th><th>Conflict</th></tr>\n</thead>\n<tbody>\n<tr><td>Never says no (fabricates, overreaches)</td><td>20/46 = 0.43 [0.30, 0.58]</td><td>20 / 0</td><td>18/18</td><td>0/12</td><td>0/8</td><td>8/8</td></tr>\n<tr><td>Drifts a fact, rate 0.85</td><td>20/46 = 0.43 [0.30, 0.58]</td><td>0 / 20</td><td>4/18</td><td>12/12</td><td>2/8</td><td>8/8</td></tr>\n<tr><td>Flattens conflicts to one side</td><td>0/46 = 0.00 [0.00, 0.08]</td><td>0 / 0</td><td>18/18</td><td>12/12</td><td>8/8</td><td>0/8</td></tr>\n<tr><td>Refuses a lot (gate at 0.8)</td><td>0/46 = 0.00 [0.00, 0.08]</td><td>0 / 0</td><td>8/18</td><td>12/12</td><td>0/8</td><td>6/8</td></tr>\n</tbody>\n</table>\n\n<p>The first two systems have the same headline and opposite diagnoses. One never abstains and its answerable cases are all correct; the other abstains perfectly and gets 4 of 18 answerable cases right because it changes facts while keeping the citation. They need different fixes: an abstention path and a gate for the first, copy-fidelity checks and entailment on every citation for the second. The headline cannot say which.</p>\n\n<p>The last two rows show the headline failing in the other direction. Flattening conflicts scores a perfect 0.00 because every statement it makes is supported, and it mishandles all eight conflict cases. Refusing most questions also scores 0.00, with 20 of the 34 cases that had an answer to give refused. A team that optimises the headline is rewarded for refusing, and Part 3 already treats a correct refusal as a pass; the point here is that the pass rate on refusals needs a denominator of cases where refusing was wrong.</p>\n\n<p>Report the split every time: contradicted claims, unsupported claims, correct behaviour per case kind, and the abstention counts. A single rate is fine as a summary only when those are beside it.</p>\n\n<h2 id=\"hac-citation-format-vs-support\">Is a cited answer a supported answer?</h2>\n\n<p>No, and the vendors' own documentation says where the guarantee stops. Anthropic's citations feature parses citations into structured fields and states that they are guaranteed to hold valid pointers to the provided documents. That is a format guarantee. OpenAI's file search returns <code class=\"language-text\">file_citation</code> annotations carrying a type, an index, a file id and a filename; the documented fields say where a citation points, not whether the cited passage entails the sentence. A pointer that resolves is a different property from a passage that supports.</p>\n\n<p>The lab separates the two in code. Format correctness is a structural predicate over the statement and the index:</p>\n\n<pre class=\"language-python\"><code class=\"language-python\">CITE = re.compile(r\"^[a-z]{2,3}-(\\d{2}-)?\\d{2}$\")\n\ndef format_ok(stmt, passages):\n    \"\"\"Has a citation; every id looks like an id and exists in the index.\"\"\"\n    return bool(stmt.cites) and all(CITE.match(c) and c in passages for c in stmt.cites)</code></pre>\n\n<p>Faithfulness follows ALCE, the citation benchmark of Gao and colleagues. Citation recall for a statement is 1 only if it has at least one citation and the cited passages, concatenated, entail it. Citation precision is scored per citation: a citation is irrelevant if it cannot support the statement alone and removing it leaves the rest still supporting it, and recall must be 1 for precision to be 1. The ALCE paper notes that its precision cannot detect a partly supporting citation, which makes the score lower than a person would give.</p>\n\n<pre class=\"language-python\"><code class=\"language-python\">def lexical_recall(stmt):\n    return bool(stmt.cites) and entails(\" \".join(PASSAGES[c] for c in stmt.cites if c in PASSAGES), stmt.text)\n\ndef lexical_precision(stmt):\n    rec = lexical_recall(stmt)\n    out = []\n    for c in stmt.cites:\n        alone = c in PASSAGES and entails(PASSAGES[c], stmt.text)\n        rest = [x for x in stmt.cites if x != c]\n        rest_ok = bool(rest) and entails(\" \".join(PASSAGES[x] for x in rest if x in PASSAGES), stmt.text)\n        out.append(1 if rec and not ((not alone) and rest_ok) else 0)\n    return out</code></pre>\n\n<p>Four systems, each with 45 cited statements across the 46 cases. \"Gold-faithful\" is ground truth: the claim is supported and a cited passage is one that really supports it.</p>\n\n<table>\n<thead>\n<tr><th>System</th><th>Format correct</th><th>Gold-faithful (Wilson 95%)</th><th>Lexical citation recall</th></tr>\n</thead>\n<tbody>\n<tr><td>Honest</td><td>45/45</td><td>45/45 = 1.00 [0.92, 1.00]</td><td>45/45</td></tr>\n<tr><td>Cites the top-1 hit for every statement</td><td>45/45</td><td>31/45 = 0.69 [0.54, 0.80]</td><td>32/45</td></tr>\n<tr><td>Drift 0.5 and top-1 citations 0.5</td><td>45/45</td><td>36/45 = 0.80 [0.66, 0.89]</td><td>38/45</td></tr>\n<tr><td>Changes a fact in every drift-eligible claim</td><td>45/45</td><td>16/45 = 0.36 [0.23, 0.50]</td><td>26/45</td></tr>\n</tbody>\n</table>\n\n<p>Format correctness is 100% in every row, so it cannot separate any of them. Precision is the sharper test when a statement carries several citations. A decorative extra citation on the verify claim, <code class=\"language-text\">rn-42-08</code> beside <code class=\"language-text\">rn-42-04</code>, scores recall 1 and per-citation precision <code class=\"language-text\">[1, 0]</code>. The same happens when a correct citation is padded with the reference-page passage that disagrees: <code class=\"language-text\">[rn-41-02, doc-04]</code> scores <code class=\"language-text\">[1, 0]</code>. The compound sentence from case A02, undrifted and citing both of its sources, scores <code class=\"language-text\">[1, 1]</code>, because each passage carries half of it.</p>\n\n<p>NIST lists reviewing sources and citations in outputs during pre-deployment measurement and ongoing monitoring as a suggested action against confabulation (MS-2.5-003). A format check satisfies none of that, but it is still worth running first: it is free, it catches broken ids, and it keeps the expensive entailment check for citations that exist.</p>\n\n<h2 id=\"hac-crude-entailment\">How crude can the entailment check be before it misleads you?</h2>\n\n<p>The lab's check is deliberately lexical so every line of it can be read. A statement is entailed by a passage when at least 80% of its content words appear in the passage, every number in the statement appears in the passage, and negation words agree:</p>\n\n<pre class=\"language-python\"><code class=\"language-python\">def entails(premise, hypothesis, cover=0.8):\n    p, h = set(content(premise)), content(hypothesis)\n    if not h:\n        return False\n    nums_h = {t for t in h if t[0].isdigit()}\n    if not nums_h &lt;= p:                      # every number in the claim must appear in the evidence\n        return False\n    if bool(NEG &amp; set(raw(premise))) != bool(NEG &amp; set(raw(hypothesis))):\n        return False                          # negation must agree\n    return sum(t in p for t in h) / len(h) &gt;= cover</code></pre>\n\n<p>ALCE uses a T5-11B model fine-tuned on NLI data for the same judgment, and its human evaluation reports Cohen's kappa of 0.698 for citation recall and 0.525 for precision between the automatic scores and people. A trained model earns moderate-to-substantial agreement; a word counter should not be expected to. Run against the ground truth on all 180 statements from the four systems above, it gives:</p>\n\n<pre class=\"language-text\"><code class=\"language-text\">checker vs ground truth, n=180: tp=128 fp=13 fn=0 tn=39\n  precision of 'faithful' verdicts  128/141 = 0.91 [0.85, 0.95]\n  recall of faithful statements     128/128 = 1.00 [0.97, 1.00]</code></pre>\n\n<p>Thirteen statements were passed that should not have been, and all thirteen share a cause: one wrong word in a sentence whose other words all appear in the passage. <code class=\"language-text\">Tidewater 4.1 adds the --threads flag to sync</code> sits at 5 of 6 words covered. So does <code class=\"language-text\">the default is md5</code> against a passage that says the default is sha256 and lists md5 as the alternative. Every token is present and the binding is wrong. Seven hand-written probes show the other direction too:</p>\n\n<table>\n<thead>\n<tr><th>Probe against the cited passage</th><th>Ground truth</th><th>Checker</th><th>Why</th></tr>\n</thead>\n<tbody>\n<tr><td>The --format=v3 option is removed in 4.2.</td><td>not entailed</td><td>entailed</td><td>The passage says deprecated in 4.2, removed in 5.0; every word is present</td></tr>\n<tr><td>... the default is md5. (verify algorithms)</td><td>not entailed</td><td>entailed</td><td>One word flipped, coverage still above the cut-off</td></tr>\n<tr><td>Sync gives up after 60 seconds.</td><td>entailed</td><td>not entailed</td><td>Paraphrase: \"gives up\" is not in the passage</td></tr>\n<tr><td>Tidewater 4.2 no longer supports Python 3.9.</td><td>entailed</td><td>not entailed</td><td>Negation rule fires on a paraphrase of \"drops\"</td></tr>\n<tr><td>The 4.2 object size limit is ten times the 4.1 limit.</td><td>entailed</td><td>not entailed</td><td>Needs arithmetic over 5 GB and 50 GB</td></tr>\n<tr><td>... timeout is 60 seconds (verbatim)</td><td>entailed</td><td>entailed</td><td>Correct</td></tr>\n<tr><td>... timeout is 90 seconds</td><td>not entailed</td><td>not entailed</td><td>The number rule catches it</td></tr>\n</tbody>\n</table>\n\n<p>The 80% cut-off is a trade, and moving it shows the cost. Against the same 180 statements:</p>\n\n<table>\n<thead>\n<tr><th>Coverage cut-off</th><th>Unfaithful statements passed</th><th>Faithful statements rejected</th><th>Paraphrase probes accepted (of 3)</th></tr>\n</thead>\n<tbody>\n<tr><td>0.6</td><td>19</td><td>0</td><td>2</td></tr>\n<tr><td>0.8</td><td>13</td><td>0</td><td>1</td></tr>\n<tr><td>1.0</td><td>5</td><td>4</td><td>0</td></tr>\n</tbody>\n</table>\n\n<p>Tightening it to 1.0 still passes five unfaithful statements and starts rejecting four faithful ones. No setting makes a word counter reliable, because the errors are about meaning. This is also why the rest of the series keeps calibration separate from scoring: whatever replaces this function, whether a trained NLI model or a model judge, needs the labelled set, the confusion matrix and the interval from <a href=\"/blog/ai-in-testing/calibrate-llm-as-judge-scores\">Part 2</a> before its verdicts count. The lab's value is the structure around the function, which stays the same when the function changes.</p>\n\n<h2 id=\"hac-abstention-threshold\">Where should the abstention threshold sit?</h2>\n\n<p>Abstention is a classification: of the 12 unanswerable cases, which did the system decline, and of its declines, how many were right. Abstention recall is the share of unanswerable cases declined. Abstention precision is the share of declines that were on unanswerable cases. The cost of declining wrongly is the over-refusal rate: answerable, partial and conflict cases refused out of the 34 that had an answer to give.</p>\n\n<pre class=\"language-python\"><code class=\"language-python\">def abstention(resps):\n    tp = sum(r.abstained and r.case[\"kind\"] == \"U\" for r in resps)\n    fp = sum(r.abstained and r.case[\"kind\"] != \"U\" for r in resps)\n    fn = sum((not r.abstained) and r.case[\"kind\"] == \"U\" for r in resps)\n    return dict(tp=tp, fp=fp, fn=fn, abstained=tp + fp, should=tp + fn)</code></pre>\n\n<p>The sweep sets the generator to its worst case, <code class=\"language-text\">fabricate=1.0</code>, so it never declines on its own and the gate is the only defence. Selective-prediction work evaluates this trade as a risk-coverage curve: raising the threshold lowers coverage, the share of questions answered, and usually lowers the error on what remains. The table gives the same curve in counts. Thresholds 0.1, 0.3 and 1.0 give the same results as 0.0, 0.2 and 0.9 because no confidence falls between them.</p>\n\n<table>\n<thead>\n<tr><th>Threshold</th><th>Answered (of 46)</th><th>Fabricated (of 12 unanswerable)</th><th>Over-refused (of 34)</th><th>Abstention precision</th><th>Cost at w=1</th><th>w=5</th><th>w=10</th></tr>\n</thead>\n<tbody>\n<tr><td>0.0</td><td>46</td><td>12 [0.76, 1.00]</td><td>0 [0.00, 0.10]</td><td>n/a</td><td>12</td><td>60</td><td>120</td></tr>\n<tr><td>0.2</td><td>44</td><td>11 [0.65, 0.99]</td><td>1 [0.01, 0.15]</td><td>1/2 = 0.50</td><td>12</td><td>56</td><td>111</td></tr>\n<tr><td>0.4</td><td>38</td><td>6 [0.25, 0.75]</td><td>2 [0.02, 0.19]</td><td>6/8 = 0.75</td><td>8</td><td>32</td><td>62</td></tr>\n<tr><td>0.5</td><td>35</td><td>4 [0.14, 0.61]</td><td>3 [0.03, 0.23]</td><td>8/11 = 0.73</td><td>7</td><td>23</td><td>43</td></tr>\n<tr><td>0.6</td><td>31</td><td>3 [0.09, 0.53]</td><td>6 [0.08, 0.34]</td><td>9/15 = 0.60</td><td>9</td><td>21</td><td>36</td></tr>\n<tr><td>0.7</td><td>20</td><td>1 [0.01, 0.35]</td><td>15 [0.29, 0.61]</td><td>11/26 = 0.42</td><td>16</td><td>20</td><td>25</td></tr>\n<tr><td>0.8</td><td>14</td><td>0 [0.00, 0.24]</td><td>20 [0.42, 0.74]</td><td>12/32 = 0.38</td><td>20</td><td>20</td><td>20</td></tr>\n<tr><td>0.9</td><td>9</td><td>0 [0.00, 0.24]</td><td>25 [0.57, 0.85]</td><td>12/37 = 0.32</td><td>25</td><td>25</td><td>25</td></tr>\n</tbody>\n</table>\n\n<p>Read the table in three passes. First, nothing is free: fabrication reaches zero at 0.8, and by then 20 of 34 answerable-side cases are refused. Second, the best threshold depends on a price. The cost columns count each fabricated answer as w refusals. At w=1 the minimum is 7, at 0.5. At w=5 it is 20, reached at both 0.7 and 0.8. At w=10 it is 20, at 0.8. Third, the intervals are wide. A zero in the 12 unanswerable cases still allows a fabrication rate up to 0.24, so \"we measured zero\" needs the bound next to it, and the over-refusal interval at 0.7 spans 0.29 to 0.61 on 34 cases.</p>\n\n<p>Kalai and colleagues give a way to write the price down. They propose telling the system to answer only above a stated confidence t, with a wrong answer costing t/(1-t) points, a correct one earning 1 and an abstention earning 0; answering beats abstaining exactly when the probability of being correct exceeds t. Their examples are t = 0.5 with penalty 1 and t = 0.9 with penalty 9. They also argue that benchmarks graded as right or wrong with no credit for abstaining reward confident guessing, which is the same pressure FActScore's authors flag when a metric ignores abstention. One caution: the lab's confidence is a word-overlap ratio, not a probability of being correct, so its thresholds are not their t. A real gate needs calibrating before its number means anything, and a model's stated confidence needs the Part 2 treatment.</p>\n\n<p>The decision rule that follows is a property of your product, not of the model: what a fabricated answer costs compared with a refusal. A release-note assistant that feeds an upgrade decision sits at a high w. A search box that shows the top passage anyway sits near 1. State the ratio, compute the curve on cases like yours, and pick the threshold from that, with the intervals showing how much the pick depends on 12 cases.</p>\n\n<h2 id=\"hac-partial-and-conflict\">What should a good answer do when evidence is partial or conflicting?</h2>\n\n<p>The two hardest kinds are the ones most often left out of datasets, because the right behaviour is neither answering nor refusing. A partial case wants the supported half stated and the missing half named. Case P01 shows what changes when the generator overreaches: both outputs are real runs, and only the second is correct.</p>\n\n<pre class=\"language-json\"><code class=\"language-json\">{\"case\": \"P01\", \"claims\": [\n  {\"text\": \"Version 4.2 adds the tidewater verify command, which compares checksums after a sync.\",\n   \"cited\": [\"rn-42-04\"], \"label\": \"supported\", \"lexical_entails\": true},\n  {\"text\": \"Verify takes about 40 minutes on a 1 TB bucket.\",\n   \"cited\": [\"rn-40-01\"], \"label\": \"unsupported\", \"lexical_entails\": false}], \"notes\": []}\n\n{\"case\": \"P01\", \"claims\": [\n  {\"text\": \"Version 4.2 adds the tidewater verify command, which compares checksums after a sync.\",\n   \"cited\": [\"rn-42-04\"], \"label\": \"supported\", \"lexical_entails\": true}],\n \"notes\": [\"The indexed notes do not say how long verify takes on a 1 TB bucket.\"]}</code></pre>\n\n<p>P01 is also the one case a gate at 0.2 refuses: its confidence is 0.17, because \"1 TB bucket\" dilutes the overlap. That is the over-refusal cost in a single record, a supported claim thrown away. Partial answers also make the sweep's pressure visible: the \"refuses a lot\" system got 0 of 8 partial cases right.</p>\n\n<p>A conflict case wants both sides, each cited to its own source, and an explicit note that they disagree. The correct record for C01 has two supported claims, citing <code class=\"language-text\">rn-42-02</code> (60 seconds) and <code class=\"language-text\">doc-03</code> (45 seconds), and the note \"These sources disagree: rn-42-02 and doc-03.\" The flattened version keeps the first claim, drops the note, and is a record in which every claim is supported and the case is wrong. Claim-level scoring cannot see that, so conflict handling is scored as a behaviour per case: both sides present and the note present.</p>\n\n<p>Store each judged answer as a record like these, with the claim, its citations, the label, and the check that produced the label, so a reviewer can audit it. If the records are JSON, the <a href=\"/tools/json-schema\">JSON Schema Validator</a> can enforce the record's shape before semantic grading, and the <a href=\"/tools/json-diff\">JSON Diff tool</a> shows exactly which claims changed between two runs of the same case.</p>\n\n<h2 id=\"hac-limits\">Where do people decide, and what does this lab not prove?</h2>\n\n<p>A model can extract claims from an answer and propose an entailment label for each; Ragas and FActScore both work that way, and both depend on the verifier's accuracy. FActScore's authors found that ChatGPT's mistakes as a verifier were mostly marking unsupported facts as supported, which overestimates the score. That is the same direction as the lexical checker's errors above. So the support decision on any claim that matters (a version, a limit, a flag, a date) needs a person reading the cited passage, at least on a sample large enough to put an interval around the checker's precision. The person also decides what counts as a conflict and whether a partial answer is acceptable to the product.</p>\n\n<p>The lab proves less than it looks like it does, and these are its limits. The ground-truth labels come from how the stub was built, where a real project would pay for human labels. The cases are hand-written to trigger each behaviour, so counts say how the metrics respond, not how often a model fails. The gate is a word-overlap ratio. Twelve unanswerable cases give wide intervals, and eight conflict cases give wider ones. The 46 cases are one corpus on one invented product. Hash-selected failure rates make a run repeatable, which also means the \"drift 0.85\" system is a tuned instrument and not a measurement. And one adversarial path, a document that tells the system what to cite, is outside this article; a later part of the series takes up adversarial abuse.</p>\n\n<h2 id=\"hac-apply-now\">Apply this now</h2>\n\n<ol>\n<li>Take 20 answers from your assistant and split each into claims by hand. Write down, for each claim, the passage that supports it, and mark it supported, contradicted or unsupported. Keep the sheet; it is your first ground-truth set.</li>\n<li>Add cases the happy path never contains: five questions about something absent from the index, five where only half the question is answerable, five where two of your own documents disagree. Write the correct behaviour for each before running anything.</li>\n<li>Report five numbers together: contradicted claims, unsupported claims, correct behaviour per case kind, citation format correctness and citation faithfulness. If your dashboard has one hallucination rate, replace it.</li>\n<li>Run a threshold sweep on your gate, whatever it is (retrieval score, reranker score, model confidence). Tabulate fabrication on the unanswerable cases and over-refusal on the rest, each with a Wilson interval, and write down the cost ratio you are choosing.</li>\n<li>If you use an automatic entailment check, grade it against your 20 hand-labelled answers first and keep the false positives list. Add a rule that any claim containing a number, version or identifier goes to a person when the check and the cited text disagree on any token.</li>\n<li>Gate releases on the slices: no rise in fabrication on unanswerable cases, no fall in correct conflict handling, over-refusal below the figure you chose.</li>\n</ol>\n\n<p>The evidence to capture is the labelled sheet, the claim-evidence records for each case, the sweep table with intervals, and the false-positive list of the entailment check.</p>\n\n<h2 id=\"hac-faq\">FAQ</h2>\n\n<h3 id=\"hac-faq-format-enough\">Is checking that every sentence has a citation enough?</h3>\n<p>It checks presence and that pointers resolve, and the lab's four systems all scored 45 of 45 on it while their faithfulness ranged from 0.36 to 1.00. Run it as the first gate and never report it as the support rate.</p>\n\n<h3 id=\"hac-faq-refuse-more\">Why not refuse whenever the model is unsure?</h3>\n<p>Because refusal has a measurable price. In the sweep, getting fabrication to zero meant refusing 20 of the 34 cases that had an answer. FActScore's authors warn that a metric blind to abstention rewards a model that abstains too often, and TruthfulQA's authors note that a system that says \"no comment\" to everything is perfectly truthful. Score both sides.</p>\n\n<h3 id=\"hac-faq-partial-credit\">Should a partly correct compound claim get partial credit?</h3>\n<p>Choose per product and say which. Google's check-grounding API treats a partly entailed sentence as ungrounded, while FActScore and Ragas count the supported share of atoms or statements. For answers that drive a decision, the stricter sentence rule is safer, and keeping atoms in the record preserves the detail.</p>\n\n<h3 id=\"hac-faq-conflict\">What if the sources conflict because one is out of date?</h3>\n<p>The system should still show both and note the disagreement, unless your product defines a precedence rule such as release notes over migration guide, and that rule belongs in the case's expected behaviour. A silent pick is a fabrication of authority the data does not give.</p>\n\n<h3 id=\"hac-faq-ragas\">Does Ragas faithfulness cover this?</h3>\n<p>It covers the unsupported-statement share: the documentation defines it as claims supported by the retrieved context over total claims. It does not say anything about whether the context contained the right passage, whether a citation points at the supporting one, or whether the system should have declined. Those are separate checks.</p>\n\n<h2 id=\"hac-references\">Primary references</h2>\n\n<ul>\n<li><a href=\"https://arxiv.org/abs/2202.03629\">Ji et al., a survey of hallucination in natural language generation</a>. The intrinsic and extrinsic definitions, the note that extrinsic content is not always erroneous, and the observation that most metrics combine both kinds.</li>\n<li><a href=\"https://nvlpubs.nist.gov/nistpubs/ai/NIST.AI.600-1.pdf\">Confabulation guidance in the NIST Generative AI Profile (AI 600-1)</a>. The confabulation definition in section 2.2, confabulated citations that may justify wrong answers, and suggested action MS-2.5-003 on reviewing sources and citations.</li>\n<li><a href=\"https://arxiv.org/abs/2112.12870\">Rashkin et al., Measuring Attribution in Natural Language Generation Models</a>. The AIS definition built on the \"according to P, s\" test, and its deliberate separation of attribution from factuality.</li>\n<li><a href=\"https://arxiv.org/abs/2305.14627\">Gao et al., Enabling Large Language Models to Generate Text with Citations (ALCE)</a>. Citation recall and precision as defined above, the NLI-based scoring, the human-agreement kappas and the stated limitation on partial support.</li>\n<li><a href=\"https://arxiv.org/abs/2305.14251\">Min et al., FActScore</a>. Atomic facts as the unit, the formula conditioned on responding, and the statement that it does not penalise abstention.</li>\n<li><a href=\"https://arxiv.org/abs/2309.15217\">Es et al., Ragas paper</a>. Faithfulness as the share of answer statements inferable from the context.</li>\n<li><a href=\"https://docs.ragas.io/en/stable/concepts/metrics/available_metrics/faithfulness/\">Ragas documentation for faithfulness</a>. The claim-count formula used in the FAQ.</li>\n<li><a href=\"https://arxiv.org/abs/2109.07958\">Lin et al., TruthfulQA</a>. Imitative falsehoods, and the point that answering \"no comment\" throughout is perfectly truthful.</li>\n<li><a href=\"https://arxiv.org/abs/2303.08896\">Manakul et al., SelfCheckGPT</a>. Zero-resource detection by sampled-answer consistency, for the case with no source.</li>\n<li><a href=\"https://arxiv.org/abs/1806.03822\">Rajpurkar et al., unanswerable questions for SQuAD</a>. The relevance desideratum for unanswerable questions.</li>\n<li><a href=\"https://arxiv.org/abs/2006.09462\">Kamath et al., selective question answering under domain shift</a>. Threshold-based abstention, coverage, risk and the risk-coverage curve.</li>\n<li><a href=\"https://arxiv.org/abs/2509.04664\">Kalai et al., why language models hallucinate</a>. Binary grading rewarding guessing, and explicit confidence targets with a t/(1-t) penalty.</li>\n<li><a href=\"https://platform.claude.com/docs/en/build-with-claude/citations\">Anthropic, citations documentation</a>. Citations parsed into valid pointers to the provided documents, and, in its structured-fields parsing example, the instruction to check that each field has a citation because the API does not guarantee one.</li>\n<li><a href=\"https://platform.claude.com/docs/en/test-and-evaluate/strengthen-guardrails/reduce-hallucinations\">Anthropic, reduce hallucinations</a>. Permission to say it does not know, quote-first grounding, and retracting claims that lack a supporting quote, with the caveat that these reduce rather than eliminate hallucination.</li>\n<li><a href=\"https://developers.openai.com/api/docs/guides/tools-file-search\">OpenAI, file search guide</a>. The fields of a <code class=\"language-text\">file_citation</code> annotation.</li>\n<li><a href=\"https://cloud.google.com/generative-ai-app-builder/docs/check-grounding\">Google Cloud, check grounding with RAG</a>. Grounding defined as whole-claim entailment, a sentence as one claim, a support score and a citation threshold.</li>\n<li><a href=\"https://www.statsmodels.org/stable/generated/statsmodels.stats.proportion.proportion_confint.html\">statsmodels proportion_confint</a>. The Wilson score interval option used to cross-check the lab's implementation.</li>\n</ul>\n"}