# Label each RAG error before you add a checker model

> Source: <https://dev.to/conorbronsdon/label-each-rag-error-before-you-add-a-checker-model-45cn>
> Published: 2026-12-01 20:30:07+00:00

**Recommendation:** Classify each bad claim by failure type and apply deterministic checks—source-span lookup, number and negation comparison, output parsing—before adding a checker model, and score wrong retrieval separately on a labeled sample.
More in the playbook "Verifying model output": <https://wpnews.pro/playbooks/output-verification>

"Hallucination" covers too many failures to be a useful metric. Label each bad claim first: unsupported by any source, a paraphrase that changed the meaning, the wrong source retrieved, or an instruction not followed. Some of them have a cheap, deterministic check. Save a second model for what's left, because a checker tends to fail on the same hard cases as the model it checks.

[Dan Klein](https://chainofthought.show/guests/dan-klein/) is co-founder and CTO of Scaled Cognition and a professor of computer science at UC Berkeley. He made this argument in an April 2026 episode.

Because different failures need different fixes, and a single count hides which one you have. Klein asked where the line even is:

So for example, we'd probably say it's a hallucination if you had a rag system and you retrieved the answer. And then the system went ahead and said something different than the answer. What does that actually mean? Like maybe it reworded it, but it still means roughly the same thing. Where's the line?

*Dan Klein, co-founder and CTO at Scaled Cognition, on [Chain of Thought ep 54](https://chainofthought.show/podcast/54-why-llms-are-plausibility-engines-not-truth-engines-dan-klein/)*

He also said that when his team looks at a deployment an enterprise already thinks hallucinates too much, the real rate is often five times what they've noticed. Fluent mistakes are hard to spot. A wrong account balance is the kind of mismatch people notice. A refund policy that's plausible and common, but belongs to a customer with a different frequent flyer status, often doesn't.

| Label | What it means | Cheapest check | 
|---|---|---|
| Unsupported | No retrieved source states the claim | Source-span lookup | 
| Meaning changed | A source is close, but a number or negation differs | Deterministic comparison | 
| Wrong retrieval | The claim matches a source for the wrong customer, account or policy | Retrieval eval against labeled documents | 
| Instruction not followed | The output ignores a required format, field or refusal | Parse or validate the output in code | 

The last row matters because prompting can't guarantee compliance. Klein's description of the prompt as a control:

It's not a control surface that has any kind of precise semantics. It's not a control surface that comes along with any kind of guarantee at all.

His picture of the alternative is rewording the instruction, putting it in all caps, then adding exclamation points. If a format must hold, check it in code.

*A minimal sketch to adapt. `find_support` is a hypothetical span lookup; lexical overlap is a fine first version.*

``` python
import re

NUM = re.compile(r"\d+(?:\.\d+)?")

def negated(text):
    t = f" {text.lower()} "
    return " not " in t or "n't" in t or " never " in t

def label_claim(claim, spans):
    support = find_support(claim, spans)
    if support is None:
        return "unsupported"
    if set(NUM.findall(claim)) != set(NUM.findall(support)):
        return "meaning_changed"
    if negated(claim) != negated(support):
        return "meaning_changed"
    return "needs_semantic_check"  # passing these checks isn't proof of support
```

These checks only catch cheap failures. `Alice owes Bob $10` and `Bob owes Alice $10` pass both, which is why the last label is `needs_semantic_check`, not `supported`. The negation check is crude too and will miss words like "without" or "fails to". Add the pairs that matter in your domain. Score wrong retrieval separately, on a labeled sample: was the right document in the results at all?

Only for the claims the cheap checks can't settle, and only after you price it across a whole conversation. When I asked him why not just put a second model on top, Klein borrowed the regular-expressions joke: now you have two problems. The checker is unreliable too. It can catch an error or introduce one, and setups grow to 10 or 15 models checking each other, which is slow and expensive.

The bigger problem is that errors aren't independent:

But that means, OK, well, 4% of the time you make a mistake, assuming they're independent, which, by the way, they're not. When you have a hard instance, the model and the checker are going to fail in exactly the same cases. So 80% checking 80% is going to be like 82%.

And a conversation with 20 turns gives both models 20 chances to fail. If you add a checker anyway, keep it to actions where a mistake is costly, such as an account balance or medication, and hold the action when the two models disagree.

**If the answer closely matches a retrieved passage, is it correct?**

Not necessarily. Compare numbers and negations, and confirm the passage is for this customer. A real refund policy can still be the wrong one.

**Will a stronger prompt make the model follow the format?**

It may change the output, but there's no guarantee. Validate the format in code and treat a failed parse as a missed instruction.

**Should every turn go through a checker model?**

Klein's objection is correlated errors: on hard cases the checker fails with the model, so two 80% models land near 82%, not 96%. Use cheap checks on every turn and a second model only where a miss is costly.

The full conversation, with the transcript, is on [Chain of Thought](https://chainofthought.show/podcast/54-why-llms-are-plausibility-engines-not-truth-engines-dan-klein/).

[Subscribe to the Chain of Thought newsletter](https://newsletter.chainofthought.show/subscribe?utm_source=devto&utm_medium=referral&utm_campaign=newsletter) for new episodes and write-ups like this one.

*Drafted with AI assistance from the episode transcripts.*
