Sub topic 13
Checking whether a source supports a claim
This chapter assumes you can already validate [n] markers and verify quotes, as covered in the two previous chapters. You should also be able to call a model from Python.
Why earlier checks are not enough
A marker check proves that source 2 exists. A quote check proves that a phrase appears in source 2. Neither proves that the claim follows from source 2.
Suppose source 2 says "failed requests are retried up to three times, except uploads." The answer "The service retries all failed requests three times [2]" has a valid marker and can quote a real phrase, but the claim is wrong. Checking for this kind of error is called faithfulness checking. For each claim, you ask whether the cited text entails it.
Three ways to check support
| Method | Cost | Catches | Misses |
|---|---|---|---|
| Word overlap | Very low | Claims with no link to the source | Wrong numbers, negations, dropped exceptions |
| Entailment model (NLI) | Low to medium | Many contradictions | Claims that need several sentences |
| LLM judge | Medium to high | Subtle mismatches | Its own errors, and it needs testing |
Word overlap works as a pre-filter only. A claim can reuse every word in the source and still reverse its meaning.
An LLM judge
An LLM judge is a second model call that sees only the claim and the cited text. It does not see the original question or the first answer. Give it a closed set of verdicts so your code can parse the reply.
JUDGE_PROMPT = """You are checking a claim against a source.
Reply with exactly one word:
SUPPORTED if the source states or clearly implies the whole claim,
PARTIAL if the source supports only part of the claim,
NOT_SUPPORTED otherwise.
Source:
{source}
Claim:
{claim}
Verdict:"""
VERDICTS = {"SUPPORTED", "PARTIAL", "NOT_SUPPORTED"}
def check_claim(claim, source_text, call_model):
"""call_model takes a prompt string and returns the model's reply text."""
reply = call_model(JUDGE_PROMPT.format(source=source_text, claim=claim))
verdict = reply.strip().upper()
return verdict if verdict in VERDICTS else "NOT_SUPPORTED"
def fake_model(prompt):
return "partial"
print(check_claim(
"The service retries all failed requests three times.",
"Failed requests are retried up to three times, except uploads.",
fake_model,
))This prints PARTIAL. In production, replace fake_model with a real API call. Any reply outside the allowed set counts as NOT_SUPPORTED, so a malformed reply never passes by accident.
Handling several sources
If a claim cites [1, 3], the support may be split across both sources. Judging each source alone would mark the claim PARTIAL twice. Join the cited texts into one source block and judge them together.
Limits of the judge
- The judge can be wrong, and it is often too lenient when the claim sounds plausible. Measure it on a small hand-labeled set before you rely on it.
- Put the judge's instructions outside the source text, and tell it to treat the source as data. A source can contain injected instructions, and the judge would read them too.
- Judging every claim doubles your model calls. Run it on all claims offline during evaluation. Online, run it only on claims that pass the cheap checks.
- Decide the policy for
PARTIALahead of time. Common choices are to show the answer with a warning, or to regenerate it with a stricter prompt.
Exercise
An answer says "Backups run nightly [4]." Source 4 contains the exact phrase "backups run nightly" but appears in a section titled "Planned changes, not yet released." The marker check and the quote check both pass. Which check could catch the problem, and what verdict would you expect?
Show answer
The support check (a judge or entailment model) could catch it, provided the judge is given the section context. A judge that reads the full passage should return NOT_SUPPORTED or PARTIAL, because the source describes a planned feature, not current behavior. The quote check cannot catch this, because it only tests that the words occur.