Check whether an AI citation supports the claim
Citation verification must check more than whether a source link opens. Validate the referenced document and span, then assess whether that evidence supports the exact claim, including qualifiers, dates, and exceptions.
Inside this article 4 sections +
A working citation can still support the wrong answer. The cited paragraph may discuss a different plan, an expired policy, or only one part of a sentence. Verifying retrieval-augmented generation, or RAG, therefore requires checking the relationship between a claim and its evidence.
Consider an invented support policy: “Annual plans may request an export during the active subscription.” An assistant answers, “Every customer can export data after cancellation,” and attaches the policy. The document exists and contains the word export, but it does not support the answer’s scope or timing.
Make citations structured evidence references
Store a source identifier, source version, chunk identifier, and an evidence location with each citation. Keep the retrieval snapshot associated with the answer. A URL alone may later open an updated document, leaving reviewers unable to reconstruct what the model saw when it wrote the response.
Require the answer format to associate citations with individual claims or small claim groups. A paragraph with one citation at the end can contain several unsupported assertions. Where the model API provides structured citation pointers, use them to reduce malformed references, but still test the meaning of the supported statement.
The interface should resolve a citation to the cited passage, not merely to a large document’s first page. Display the source title and relevant version or effective date when that context matters. Check current permissions when the reader opens the evidence; an answer must not turn a citation link into a new access path.
Create mismatches that look plausible
A useful test set contains valid-looking references with deliberately wrong claim relationships. These cases reveal weaknesses that a broken-link checker cannot catch. Keep the source snippets short and synthetic so the expected judgment is unambiguous.
Evidence: annual plans may export.
Claim: every plan may export.
Result: unsupported scope.
Evidence: access during subscription.
Claim: access after cancellation.
Result: unsupported timing.
Evidence: extension with manager approval.
Claim: extension is automatic.
Result: missing prerequisite.
Add positive cases too. A correct paraphrase should pass even if it uses different words. Otherwise the checker rewards quotation rather than faithful explanation. Include answers that appropriately say the source is insufficient; abstention can be the correct result when no document addresses the requested condition.
Also test evidence assembled across two passages. One may define the plan type and another the export entitlement. The checker should accept a supported combination while rejecting a conclusion that requires an unstated assumption. Record which pieces are necessary so reviewers can explain the judgment.
Separate mechanical checks from meaning checks
Start with deterministic validation: the source is in the authorized retrieval set, the version matches, the span exists, and any quoted text matches the extracted content under documented normalization rules. This catches invented identifiers, off-by-one offsets, and references to documents the generator never received.
Next identify the factual claims in the answer. Check quantities, named entities, dates, negation, eligibility conditions, and exceptions against their cited evidence. A model-based judge can assist with this comparison, but it needs its own reviewed examples. Measure judge disagreements with humans rather than treating the judge as an unquestionable authority.
Distinguish three outcomes: supported, contradicted, and insufficient evidence. A source that does not mention a deadline does not necessarily contradict a deadline claim; it fails to establish it. That distinction helps the product decide whether to remove the claim, retrieve more evidence, or explicitly acknowledge uncertainty.
Measure coverage separately from correctness. An answer may have three accurate citations and a fourth uncited assertion that changes the recommendation. Track what proportion of material claims have adequate support, while avoiding a metric that rewards adding citations to every harmless connective sentence.
The following Python fixture validates a citation against the authorized evidence snapshot supplied to one answer. The synthetic text uses character offsets with an exclusive end position; a production pipeline must keep the same extraction and offset convention at both ends.
evidence = {("policy-export", "v7"): "Exports expire after seven days."}
def valid_span(citation):
text = evidence.get((citation["source"], citation["version"]))
start, end = citation["start"], citation["end"]
return (text is not None and type(start) is int and type(end) is int
and 0 <= start < end <= len(text)
and text[start:end] == citation["quote"])
citation = {"source": "policy-export", "version": "v7",
"start": 0, "end": 32, "quote": evidence[("policy-export", "v7")]}
assert valid_span(citation)
assert not valid_span(dict(citation, version="v6"))
assert not valid_span(dict(citation, end=31))
Passing this check proves that the referenced text is present in that snapshot. It does not prove that the text supports the answer’s claim: “exports never expire” could still cite the valid span. Keep entailment and current user authorization as separate checks, especially when an answer is retrieved from a cache.
Choose what happens when verification fails
For a low-impact informational answer, the application might remove the unsupported sentence and explain the evidence gap. For an answer that triggers an operational action, it may need to stop and request review. The policy should depend on the consequence of the claim, not merely the number of failed citations.
Limit repair loops. A generator repeatedly rewriting the same answer against the same inadequate passages can produce more fluent unsupported content. Allow a bounded retrieval or correction attempt, then return the unresolved question with the evidence actually available.
Save failure categories alongside source versions and evaluation configuration. A rise in stale-version mismatches points toward the retrieval pipeline; a rise in qualifier loss points toward generation or checking. This separation turns a vague complaint about hallucinations into an engineering change that can be tested.
See permission-aware retrieval for the access boundary and handling conflicting documents for disagreements between valid sources. Our AI integration services can help implement the evidence contract across the full answer path.