Unit 06.04: Where a grounded chain still goes wrong
Retrieval bounds what the model saw. It does not bound what the model wrote, and the gap is where grounded systems still invent.
Extrapolation and merging
Extrapolation adds a plausible detail the context never mentions. Merging combines two nearby concepts into one claim.
The code compares three answers against the context at the word level.
CONTEXT = "[c1] Refunds are allowed within 7 days of purchase."
candidates = {
"grounded": "Refunds are allowed within 7 days. [c1]",
"extrapolated": "Refunds are allowed within 7 days and processed instantly. [c1]",
"merged": "Refunds and exchanges are allowed within 7 days. [c1]",
}
context_terms = set(CONTEXT.lower().replace("[c1]", "").split())
for kind, answer in candidates.items():
novel = [w for w in answer.lower().rstrip(".").split()
if w.isalpha() and len(w) > 4 and w not in context_terms]
print(f"{kind:14} introduces: {novel or 'nothing'}")
print("""
All three cite c1. All three are on topic. Retrieval bounded what the model
SAW; it did not bound what the model WROTE.
The word-level comparison above is crude -- term overlap, not entailment -- and
it runs in microseconds on every answer, which a model-based checker will not.
Ship the cheap check and look at what it flags.
""")
All three cite c1 and all three are on topic. The extrapolated one introduces instantly - a processing-time claim the context never makes. The merged one introduces exchanges, a different policy entirely.
The check is deliberately crude: term overlap, not entailment. It will miss a paraphrase that reuses source vocabulary while changing the meaning, and it runs in microseconds on every answer, which a model-based checker will not.
The mistake this prevents
The mistake is waiting for a proper entailment checker before shipping any check at all. The sophisticated version costs a model call per answer and weeks to evaluate. Ship the crude one, look at what it flags, and let that tell you whether the expensive one is worth building.
Takeaway
Grounding limits the input, not the output. Compare the answer's substantive terms against the cited text on every response - cheap and imperfect beats perfect and unshipped.
