Appearance
Making RAG Show Its Evidence: Four Gates Against Confident Hallucination
Your retrieval demo works. A thousand PDFs went into a vector store, an embedding model came out, and now the thing answers questions in clean paragraphs with citations stapled to the end.
Then the corpus grows to a million documents. Nothing crashes. Latency holds. Answers keep arriving, confident and well-formed.
They're just wrong more often, and nothing in the logs tells you which ones.
That's how RAG fails at scale. Quietly and plausibly, with a sentence that reads true. A bigger corpus gives the retriever more chances to surface a chunk that looks right, and gives the generator more raw material for a fluent answer built on the wrong number.
Stanford's RegLab tested commercial legal RAG products in 2025, the paid tools built specifically to be trustworthy, and found hallucination in roughly 17% to 33% of cases (Magesh et al., Journal of Empirical Legal Studies). Read that as a measure of how hard the problem is. In a domain where a wrong answer gets someone sued, one in three to one in six answers was wrong. Those numbers belong to those tools and those tasks, so treat them as a difficulty signal rather than a universal failure rate.
RAG reduces hallucination. It doesn't eliminate it. Closing the gap takes architecture work, and swapping in a bigger model doesn't do it.
Three ways an evidence-grounded answer fails
Retrieval-augmented generation has at least three common failure paths, and scale makes every one of them worse.
The retriever pulls a similar chunk instead of an answering one. At a thousand documents there might be one paragraph about Q2 revenue. At fifteen million there are forty thousand chunks that mention revenue, hundreds of near-identical boilerplate paragraphs, and a dozen that look perfect and carry the wrong figure.
The right chunk comes back and the model ignores it. Liu et al. documented the lost-in-the-middle effect in 2023: models reliably use information near the start and end of their context and quietly drop what sits in the middle. Pack 50 chunks into the window and the passage at position 26 may as well be absent.
Nothing useful comes back and the model answers anyway. This is where the damage happens. No supporting evidence in the top-k, no mechanism for saying so, and a model trained to be helpful produces a completion that fills the gap. A 15M-document corpus holds plenty of legitimate questions with no answer in the data at all.
Before you add a component, name which of those three it kills. If you can't, you're adding complexity and calling it rigor.
Quick take: near-zero hallucination comes from the pipeline rather than the prompt, and the realistic target is zero confident unsupported claims reaching the user, not zero errors.
The four gates
The pipeline has four stages, each aimed at a specific failure. Retrieve gets the right evidence into context and keeps a pointer to where it came from. Constrain forces every sentence of the answer to cite that evidence. Verify checks each claim against the chunk it cites. Abstain turns a failed verification into a calibrated refusal instead of a guess.
The design goal is narrow on purpose: convert what would have been a hallucination into an honest "I couldn't verify this." Some errors will still get past an imperfect verifier. Your job is to make those rare, bounded, and visible on a dashboard.
Retrieval that can prove what it found
Retrieval is where most of your accuracy is won or lost, and it's the stage that breaks hardest at scale. Four moves matter.
Deduplicate before you embed. At 15M documents your corpus is full of near-duplicates: the same disclaimer on 200,000 pages, boilerplate copied across contract versions, one article syndicated to six sites. Embed all of it and your index bloats, retrieval returns ten copies of the same chunk and crowds out diversity, and relevance scores get skewed by frequency. MinHash plus locality-sensitive hashing fixes this cheaply. Hash each document into a signature, bucket similar signatures, collapse near-duplicates before they reach the embedder. Keep the version and provenance metadata while you're at it, because a dedup pass that silently merges two contract revisions which genuinely differ is its own incident.
Chunk with structure, then give each chunk its context back. A window that reads "Revenue grew 3% quarter over quarter" is useless alone. Whose revenue, which quarter? Prepend a short generated sentence that situates the chunk in its parent document before you embed it, and keep the source ID alongside. Context makes a chunk retrievable. The preserved provenance makes it verifiable later, when gate three needs to check a claim against the original text.
Anthropic published numbers on this in September 2024, and they're the cleanest evidence in the whole stack for a preprocessing change:
| Configuration | Top-20 miss rate | Reduction vs baseline |
|---|---|---|
| Naive chunks | 5.7% | none |
| Plus contextual embeddings | 3.7% | 35% |
| Plus contextual BM25 | 2.9% | 49% |
| Plus reranking | 1.9% | 67% |
Going from 5.7% to 1.9% means roughly two thirds of the queries that used to have the answer missing from the top 20 now get it. At 100,000 queries a day, that's thousands of answers that stop being guesses. The caveat: those figures are the best-performing embedding configuration in Anthropic's test, not an average across every model. Read it as "the defaults leave a lot on the table," not "1.9% is guaranteed on your corpus."
Run dense and sparse retrieval together. Vector search knows that "cancel my plan" means "terminate subscription" and it's terrible at exact strings: error code E-4021, a rare surname, a part number, a statute citation. Fuse the two ranked lists with reciprocal rank fusion, which scores each document by summing 1/(k + rank) across the lists it appears in. Dense catches the paraphrase, BM25 catches the literal token, and a document that ranks well in both floats to the top. No training required.
Then over-fetch and rerank. First-pass retrieval over 15M vectors is approximate by design, so cast wide on purpose: pull around 150 candidates and hand them to a cross-encoder that reads the query and each chunk together, keeping the best 20.
One scale note that tutorials skip. Fifteen million vectors at 1024 float32 dimensions is roughly 61 GB of raw vectors before index overhead, and 15 million documents isn't 15 million vectors. One document becomes dozens of chunks, so a 15M-document corpus is hundreds of millions of vectors. Track documents, chunks, and vectors as three separate numbers, because conflating them is how capacity plans end up wrong by two orders of magnitude. The levers are an on-disk ANN index (HNSW or IVF-PQ) and quantization from float32 to int8, which cuts memory 4x at a recall cost you have to measure on your own corpus.
Constrain and verify, claim by claim
Constraining the output is mechanical. Require a citation ID on every sentence. No citation, no sentence. That single rule kills the second failure mode, because the model can't answer from parametric memory without attaching a chunk that supposedly supports it. The citation being present is not proof of support, which is why the next gate exists.
Verification checks each claim against the chunk it cites, independently of the generator. You have two options for the checker. A generative judge is flexible and expensive, and it hallucinates. Decision models return a fixed verdict with a probability per label, and they're much cheaper and faster.
The 2025 benchmark work on decision models as hallucination judges gives a useful breakdown. Across 9,852 items drawn from six datasets and five hallucination types, the best decision model matches gpt-6-sol on context inconsistency, comes within 3 points on factual errors, and trails by 4 to 8 points on logical and instruction inconsistency:
| Hallucination type | Best decision model vs. generative judge |
|---|---|
| Context inconsistency | matches on balanced accuracy |
| Factual error | within 3 points |
| Logical inconsistency | trails by 4 to 8 points |
| Instruction inconsistency | trails by 4 to 8 points |
Two findings matter more than the headline numbers. Decision-model probabilities are overconfident, though less than the GPT-6 models, and they separate correct from incorrect decisions only moderately, so don't threshold on raw confidence without calibrating. A cascade of decision models beats the best single model by 1.9 to 3.3 points on three types and matches or exceeds the generative judge at 1% to 3% of its cost.
That cost figure changes how you deploy verification. At 1% to 3% of a generative judge, you can check every claim in every answer instead of sampling one in twenty. A gate you can only afford to run occasionally is a monitoring tool, not a control.
I wired constrain and verify into a small internal corpus and hand-labeled a few hundred answers to see whether the pair earned its latency. The support checker caught answers where the citation pointed at a chunk that didn't contain the claim, which is the failure I cared about. Asking the model in the prompt to only cite real support caught almost none of them. Small sample, no benchmark claims, but the direction was unambiguous enough that I stopped tuning prompts and started building the gate.
Abstaining is a feature
The last gate is the one teams resist, usually because someone in product says users hate refusals. They do. They hate a confidently wrong answer more, especially once a regulator, an auditor, or a customer reads it.
A calibrated abstention looks like this: the system says it couldn't verify the claim from the corpus, names what it checked, and offers the closest supported statement it does have. That output is auditable. It's also a signal you can count. Track abstention rate per document family, per query type, per retriever version. A spike after a corpus update tells you the index broke before a user tells you the answer was wrong.
The economics are simple. An abstention costs a support ticket. A fabricated compliance answer costs an incident.
What the graph layer adds
Document retrieval gives you chunk-level citations. If your answers come from a knowledge graph, you need provenance at the statement level, and that's a different mechanism.
GraphRAGProv executes SPARQL queries over source-grounded RDF graphs and computes answers together with how-provenance polynomials. Those polynomials record which statement occurrences were used and how they were combined, and each occurrence links back to the source text. You can follow the link and check whether the extracted statement reflects the document, and whether the query combined statements correctly. Testing 400 cases across two multi-hop QA benchmarks surfaced extraction and query errors even when the final answer was correct, which is the quiet argument for this whole class of tooling: answer accuracy hides a broken pipeline.
UCVE attacks a related problem in compliance validation. Requirements aren't independent items in a list, they form a graph of obligations, and treating them as flat retrieval targets means whole obligation clusters go unexamined. UCVE builds a compliance requirement graph, learns edges through reinforcement learning with a traversal reward grounded in violation detection, and reranks retrieval with spectral filtering over the resulting Laplacian. Across three compliance domains it averages a 4.3% matched-K recall lift over flat cosine retrieval. Picture a 200-obligation audit where a few percent of recall is the difference between flagging a control gap and shipping it.
FoG goes after the training-data side of the same problem. KG agents typically learn from data that carries answers but not evidence, and get rewarded for answer correctness alone, so they learn to answer from parametric memory and never retrieve the supporting triples. FoG synthesizes questions by recursively hiding entities behind verifiable sub-questions, so every question arrives with its supporting triples by construction, then credits each triple to the turn that first retrieved it through an evidence-coverage process reward. The result: 3B to 4B open-source agents beating substantially larger baselines on both answer accuracy and evidence coverage, with zero-shot transfer across knowledge graphs. A 3B to 4B agent fits on a single 24 GB GPU, so the win comes from the reward shaping rather than from scale.
| Approach | What it makes traceable | Where it fits |
|---|---|---|
| Four-gate RAG pipeline | chunk-level citation per claim | document corpora in legal, support, ops |
| GraphRAGProv | statement-level how-provenance | KG-backed QA over RDF sources |
| UCVE | obligation coverage across a requirement graph | compliance and audit validation |
| FoG | retrieved triples per answer turn | trained KG agents |
Numbers worth carrying into a design review. RegLab's legal RAG audit: 17% to 33% hallucination on tested enterprise products. Anthropic's contextual retrieval: top-20 miss rate from 5.7% down to 1.9%. FoG: 3B to 4B parameter agents beating substantially larger baselines on KGQA accuracy and evidence coverage. UCVE: 4.3% matched-K recall lift over flat cosine across three compliance domains. Cascaded decision-model judges: 1% to 3% of a generative judge's cost, within 3 points on factual errors.
What trips people up
Prompting for honesty and calling it a control. "Only answer from the provided context" helps right up until the context is wrong or buried, which is exactly the moment you needed a real gate.
Measuring retrieval with an index benchmark. ANN latency and recall on synthetic vectors proves the search engine scales. It says nothing about whether the right chunk comes back from your messy real documents. Measure end-to-end recall on a labeled set, or you're optimizing the wrong number.
Confusing documents with vectors. A 15M-document corpus is hundreds of millions of chunks. Every capacity plan built on the smaller number is off by two orders of magnitude, and the first symptom is a query that times out under load.
Deduping without keeping lineage. Collapse near-duplicates too aggressively and you'll merge two versions of a policy that genuinely differ, then cite the wrong one with total confidence. Threshold on a measured near-duplicate rate and preserve source IDs through the merge.
Thresholding on raw judge confidence. Decision-model probabilities are overconfident and only moderately separate correct from incorrect decisions. Calibrate on labeled data or run a cascade, otherwise your verifier passes exactly the claims you built it to catch.
One thing to remember
A correct answer and a supported answer are different objects, and only the second one survives an audit. Every technique here buys verification, which is not the same purchase as accuracy.
The bottom line
If you're shipping RAG over legal, regulatory, or financial documents, build the verify and abstain gates before you scale the index past a few hundred thousand chunks. Retrieval quality degrades gracefully; unsupported confidence doesn't.
If your answers come out of a knowledge graph, add statement-level provenance now rather than after the first audit request. GraphRAGProv-style how-provenance catches extraction errors that answer accuracy scores hide completely.
If you're picking a hallucination judge on cost, start with a decision-model cascade for context inconsistency and factual errors, and keep a generative judge for logical and instruction consistency where decision models still trail by 4 to 8 points. Watch that gap: the cascade results moved fast in one research cycle, and a decision model that closes the logical-inconsistency gap would move most verification budgets off generative judges entirely.