CSE Roadmap

Core tier · about 4 hours · 4 parts

Part 2 of 4 · 9 min read

Definitions

Covers: Definitions; Two detectors; Results; Design rules; Interview questions, with the follow-ups; Common mistakes; What the example does not do.

Definitions

Hallucination, grounding, faithfulness

  • Hallucination: generated content that is not grounded in the model's training data or in the input context.
  • Grounding: tying a claim to a source that can be checked.
  • Faithfulness: whether the answer is supported by the provided context.

Claim, entailment, contradiction

  • Claim: one checkable statement extracted from an answer.
  • Entailment: the context implies the claim.
  • Contradiction: the context says the opposite or a different value.

Self-consistency, abstention, consistent hallucination

  • Self-consistency check: sampling several answers and measuring their agreement.
  • Abstention: the model declines to answer because it lacks support.
  • Consistent hallucination: the same wrong answer on every sample.

Two detectors

AAAWgmp1bWIAAAAeanVtZGMycGEAEQAQgAAAqgA4m3EDYzJwYQAAABZcanVtYgAAAEdqdW1kYzJtYQARABCAAACqADibcQN1cm46YzJwYTpjY2NkM2NiMi1kNDI5LTQyNmUtOGVkZi0xNDU0ZjczYTJmNzcAAAADl2p1bWIAAAApanVtZGMyYXMAEQAQgAAAqgA4m3EDYzJwYS5hc3NlcnRpb25zAAAAALxqdW1iAAAARGp1bWRjYm9yABEAEIAAAKoAOJtxE2MycGEuaW5ncmVkaWVudC52MwAAAAAYYzJzaCJd8Qnen53Q6hFVOkCQfVYAAABwY2JvcqNpZGM6Zm9ybWF0bWltYWdlL3N2Zyt4bWxqaW5zdGFuY2VJRHgseG1wOmlpZDpmOGNhMjEyMy03YzZjLTQwNjEtODFhYS0yYjlkZDUxMWQ0MzVscmVsYXRpb25zaGlwaHBhcmVudE9mAAAB4mp1bWIAAABBanVtZGNib3IAEQAQgAAAqgA4m3ETYzJwYS5hY3Rpb25zLnYyAAAAABhjMnNoSNmUG0Va4MCtB4lKJbOk1QAAAZljYm9yomdhY3Rpb25zgqJmYWN0aW9ua2MycGEub3BlbmVkanBhcmFtZXRlcnOha2luZ3JlZGllbnRzgaJjdXJseC1zZWxmI2p1bWJmPWMycGEuYXNzZXJ0aW9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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPZYQPJgztoCYoH+/qmq5Wc9GOlY4YOSRI3XHeUCqSZQ4CS6pV4HoUQewZ1aEqqnTe4iTsBQSbxLK/UL0sCK4X0aCdQ=Two ways to flag a claim that is not groundedFaithfulness checkNeeds a trusted context (retrievedtext, tool output).Split the answer into claims; testeach against the context.Checks: word overlap, numbers,negation; or an entailment model orLLM.finds unsupported and contradicted claimsSelf-consistency checkNeeds no context.Sample the same question severaltimes; compare the answers.Facts the model knows repeat; guessesvary.misses consistent wrong answersWhat neither catchesA wrong claim that is consistentacross samples, or a claim that istrue to the context but the contextitself is wrong.fix: better sources, human review
A faithfulness check needs a context; a self-consistency check needs samples; neither catches consistent errors against a wrong source.

Results

Faithfulness check on 22 claims against the context. A claim is flagged when it is not supported. (13 false claims, 9 true claims.)

Detector False claims flagged True claims wrongly flagged
Word overlap (threshold 0.7) 54% 22%
Overlap + number check 85% 22%
Overlap + numbers + negation 100% 22%

By kind of claim (share judged correctly):

Kind Overlap + numbers + numbers + negation
Supported, close wording (7) 100% 100% 100%
True paraphrase (2) 0% 0% 0%
Wrong number (4) 0% 100% 100%
Negation flip (3) 33% 33% 100%
Invented content (5) 100% 100% 100%
Wrong number in a paraphrase (1) 100% 100% 100%

(The last row is correct only because the paraphrase has low overlap.) The overlap threshold made no difference between 0.4 and 0.9 on this set, which shows the set is too small to tune on.

AAAWgmp1bWIAAAAeanVtZGMycGEAEQAQgAAAqgA4m3EDYzJwYQAAABZcanVtYgAAAEdqdW1kYzJtYQARABCAAACqADibcQN1cm46YzJwYTpjMWJiYTBiYi0wMjAxLTRjZDQtYmRlNy03N2ZjMTg5NjczYzAAAAADl2p1bWIAAAApanVtZGMyYXMAEQAQgAAAqgA4m3EDYzJwYS5hc3NlcnRpb25zAAAAALxqdW1iAAAARGp1bWRjYm9yABEAEIAAAKoAOJtxE2MycGEuaW5ncmVkaWVudC52MwAAAAAYYzJzaM7wgYUx9I9JxlOf7YadTLkAAABwY2JvcqNpZGM6Zm9ybWF0bWltYWdlL3N2Zyt4bWxqaW5zdGFuY2VJRHgseG1wOmlpZDo3MzdlYTBjYy03MDJlLTQ5YjEtODA4Mi1hYzE5NGEwZmQ1OThscmVsYXRpb25zaGlwaHBhcmVudE9mAAAB4mp1bWIAAABBanVtZGNib3IAEQAQgAAAqgA4m3ETYzJwYS5hY3Rpb25zLnYyAAAAABhjMnNoG2CjxzxbrY6m13ce63k3OAAAAZljYm9yomdhY3Rpb25zgqJmYWN0aW9ua2MycGEub3BlbmVkanBhcmFtZXRlcnOha2luZ3JlZGllbnRzgaJjdXJseC1zZWxmI2p1bWJmPWMycGEuYXNzZXJ0aW9ucy9jMnBhLmluZ3JlZGllbnQudjNkaGFzaFggp9fvbP7bRMq8rnyZ568q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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPZYQERUeDQGXRlYBW9uQtMSaGTBEk9ZLnMGuYEuAE9IPyBRU5qnMUCOa2Hq5sVvmte0xJiguZ7fuog2tGJvFlFZcew=What each check catches (hand-built set of 22 claims; simulated model)Share of claims judged correctly, by kindsupportedparaphrase(true)wrongnumbernegationflipinventedoverlap only+ numbers+ numbers + negationSelf-consistency: share of unknown facts flagged83%k=297%k=3100%k=5100%k=10with k=5 samples and consistent wrong answers on 0%, 30%, 60% of unknowns:0%: 100% flagged; 30%: 68% flagged; 60%: 39% flaggedThe faithfulness rules were written while looking at these 22 claims, so those scores are optimistic. No LLM is called.
What each check catches on 22 claims, and the share of unknown facts flagged by self-consistency.

Self-consistency (4,000 questions, 70 percent known; flag when agreement is below 100 percent): unknown facts flagged at k=2: 83 percent; k=3: 97; k=5: 99.7; k=10: 100; known facts wrongly flagged: 0 in every case. At k=5 with a share of unknown facts answered with one consistent wrong answer: 0 percent: 100 percent flagged; 30: 68; 60: 39.

  1. A lexical check finds invention and gross contradiction cheaply; it fails on paraphrase and on small value changes unless you add rules, and every rule costs false alarms.
  2. Numbers and negations are the highest-value special cases for business text (amounts, dates, policies); check them with code against the source, not with a model.
  3. Consistency needs several samples, so cost scales with k, and it helps only for errors that vary.
  4. Prevention beats detection: retrieval with citations, abstention and tool-verified facts reduce the problem you have to detect.

Design rules

  • Give every factual claim a source (a passage, a tool result) and show it to the user or the checker.
  • Extract and verify numbers, dates, names and identifiers by code against the source.
  • Use an entailment model or a calibrated LLM judge for paraphrase, and measure its error rates (module 4).
  • Allow and reward abstention: "not in the provided documents" is a correct answer.
  • Use self-consistency selectively (high-stakes answers, no context available), with k of 3 to 5, and treat low agreement as a trigger for abstention or review.
  • Measure on held-out claims from real traces (module 2), sliced by kind of claim.
  • Log unsupported claims in production and sample them for review (module 8).

Interview questions, with the follow-ups

How do you detect hallucination in an agent's answers?

"I separate two situations. With a trusted context, I extract claims and check each against it: overlap for gross invention, code for numbers and negations, and an entailment model or a calibrated judge for paraphrase. Without a context, I use self-consistency: sample the answer several times and flag disagreement. On my small set, overlap alone caught 54 percent of false claims, because it passes changed numbers, and rules for numbers and negation raised that to 100 percent on the cases I tuned on, which is optimistic." Follow-up: "What do these miss?" Consistent wrong answers (at 60 percent consistent errors, 5-sample recall fell to 39 percent) and contexts that are themselves wrong.

Is self-consistency a good hallucination detector?

"It is a good detector of guessing: a model that knows a fact repeats it, one that guesses varies. In my simulation 5 samples flagged about 100 percent of guesses with no false alarms. But if the model errs consistently, the same answer on every sample, the agreement score looks perfect, so recall fell to 39 percent with 60 percent consistent errors. And it multiplies cost by k." Follow-up: "How would you reduce the cost?" Use it only on flagged or high-stakes answers.

How would you reduce hallucinations by design?

"Ground the answer in retrieved text with citations, constrain the answer to that context, let the model abstain, verify numbers and identifiers with tools, and put a human gate on high-stakes claims.

How do you evaluate a hallucination detector?

"On a labelled set of claims drawn from real traces, with true and false claims, reporting recall, false-alarm rate and the breakdown by kind of claim, on held-out data. My own 22-claim demonstration is a warning: rules tuned on the same cases look perfect." Follow-up: "What would a good detector's false-alarm rate be?" Low enough that reviewers trust the flags; I would tie it to review capacity (Level 8 module 8).

Common mistakes

  • Tuning detector rules on the test claims.
  • Overlap-only checks that pass changed numbers.
  • Treating a high consistency score as correctness.
  • No abstention path, so the model must answer.
  • Checking against retrieved text without checking the retrieval.
  • Claims not extracted: scoring a whole paragraph as one unit.
  • Ignoring the false-alarm cost of the checker.
  • Fine-tuning to inject facts that change.

What the example does not do

  • No real answers, and a hand-written, templated claim set of 22.
  • Rules tuned on the test set; no held-out evaluation.
  • No entailment model or LLM judge, so paraphrase is a false alarm by construction.
  • A two-state model of knowledge in the consistency experiment; real uncertainty is graded.
  • Independent samples; real samples at low temperature are correlated.
  • Optional real experiment (I did not run this): collect 100 answers with their retrieved contexts, label each claim by hand, and compare overlap, number and negation checks, an entailment model and a judge on held-out claims.

Check yourself

A cheap word-overlap check passes an answer that changed 30 days to 90 days. Why? (The words overlap almost completely; the changed figure is not seen. Numbers and identifiers need a code check against the source.)

For the curious Self-consistency finds guesses, not confident errors

In the simulation, unknown facts were flagged 83 percent of the time with 2 samples, 97 with 3 and 100 with 5, and known facts raised no false alarms. A model that is confidently wrong gives the same answer every time, so consistency cannot flag it. The rules in this module were written while looking at the 22 test claims, so their 100 percent figures are optimistic.

What you will use daily at work

Practice What it looks like
Give each claim a source Show the passage or tool result next to the answer.
Check numbers and names by code Compare them with the source text.
Let the agent abstain Not in the provided documents is a correct answer.
Use self-consistency selectively 3 to 5 samples for high-stakes answers with no context.

Draft: confirm which entailment or judge model you will use and measure its error rates first.

What you must be able to say (one page)

  • Define it before you detect it. A narrow definition: a model has hallucinated if its generated text is not grounded in its training data or its input context. For agents, the useful split is unfaithful to the context (contradicts or goes beyond the retrieved text or tool output) and unsupported by the world (no context to check; the model invented it). A knowledge quadrant helps: known knowns, unknown knowns, known unknowns and unknown unknowns, where the dangerous cell is not knowing that it does not know.
  • Two detectors: a faithfulness check (split the answer into claims and test each against the trusted context) and a self-consistency check (sample the same question several times; facts the model knows repeat, guesses vary).
  • A cheap lexical check has predictable blind spots. On my 22 hand-written claims about a policy text (13 false, 9 true): word overlap alone flagged 54 percent of false claims; it passes changed numbers (same words, different figure) and flipped meaning (only 33 percent of negation flips caught). Adding a number check raised recall to 85 percent; adding a negation check to 100 percent, but at a 22 percent false-alarm rate because true paraphrases ("two weeks after we receive the item") share too few words.
  • Those 100 percent figures are optimistic: I wrote the rules while looking at these 22 claims. A real check needs a held-out set, and an entailment model or a calibrated LLM judge (module 4) for paraphrase.
  • Self-consistency flags guesses, not confident errors. In my simulation of a model that either knows a fact (always the same answer) or guesses among six wrong answers, the share of unknown facts flagged was 83 percent at 2 samples, 97 at 3, 100 at 5, with no false alarms on known facts. But if the model gives the same wrong answer consistently for 30 percent of unknown facts, 5-sample recall fell to 68 percent, and with 60 percent to 39 percent.
  • Neither detector replaces grounding. The mitigations are structural: retrieve and cite, constrain answers to the context, let the agent abstain ("I do not know"), check numbers and identifiers against tools, and keep a human gate for high-stakes claims.
  • Honest limits: the claim set is tiny, templated and hand-written; the consistency model is a probability model; no LLM, entailment model or retriever is used.