Defining correctness for a grounded-answer system

← Back to Blog & Articles

A language model answers from what it memorised during training, and what it memorised is incomplete, out of date and impossible to audit.

Retrieval-augmented generation changes the setting. The system first fetches passages from a corpus that the operator controls, then writes an answer that is supposed to rest on those passages (Lewis et al., 2020). The corpus can be updated without retraining, and each claim in the answer can point to the passage that supports it. In a regulated deployment, that pointer separates a statement that can be checked from one that must be trusted.

Two different things can go wrong. Retrieval can fail: the passage that holds the answer is not returned. Generation can fail even when retrieval succeeds: the system ignores the passage, mixes two passages, or cites one that does not say what the answer says. Both produce the same symptom, a confident wrong answer. The first job of this article is to separate the two sources by measuring each.

The second job is to put numbers on uncertainty at every stage: sampling error on retrieval metrics, the two error rates of a citation verifier, the discrimination of a hallucination detector, and a guarantee in the sense of the companion book for the decision not to answer.

One caveat applies to the whole chapter. No pretrained model is used. All corpora are synthetic, and both “generators” are small, fully specified programs: an extractive answerer that picks a sentence, and a template generator that turns the retrieved evidence into a distribution over answers and samples from it. They are stand-ins. They expose the mathematics (what a loss bounds, what a dimension can store, what a guarantee requires) and the evaluation methodology (how to estimate an error rate, compare two systems, calibrate an abstention rule). They do not tell you how a particular language model behaves. With a real model the numbers will differ, claim extraction will itself be a model with its own errors, and the verifier will be a trained entailment model rather than a word-overlap score. The procedures carry over; the printed values do not.

Continue with the book

Explore the full treatment, worked examples, and exercises in Applied AI Under Uncertainty.


Companion article for Applied AI Under Uncertainty, published by Choral Software. Article text and original examples © 2026 Choral Software. All rights reserved.

Scroll to Top