advanced rag-information-theory 30 min read

The Retriever as a Noisy Channel: Recall, Precision, and Information Limits

Read the retriever as a communication channel: a query enters, a context comes back, a generator decodes an answer. A recall failure ERASES the relevant filing, so the bits delivered fall exactly as recall × I(A;D|Q) — the capacity of a binary erasure channel — and Fano's inequality turns the residual entropy H(A|Q,D) into a floor on the answer error that no generator beats. A precision failure SUBSTITUTES a plausible distractor, and the generator answers confidently wrong while that same entropy floor sees nothing. Recall sets the floor; precision governs whether you hit it.

From “how many bits did it add” to “how many bits survive the channel”

The previous topic measured what a retrieved document is worth to the generator in bits: the conditional mutual information I(A;DQ)=H(AQ)H(AQ,D)I(A;D\mid Q) = H(A\mid Q) - H(A\mid Q,D), the entropy retrieval removes from the answer. That measurement assumed the document arrived. A deployed retriever is not so obliging — it misses relevant filings and returns plausible wrong ones — and the question this topic asks is what those failures do to the bits, and what the bits do to the answer.

The reframing is a single move: read the retriever as a communication channel. A query qq enters; the channel emits a context — one retrieved document dp(dq)d \sim p(d\mid q); the generator decodes an answer a^\hat a. This is the noisy-channel reading of retrieval that goes back to Berger and Lafferty, made information-theoretic: a channel has a capacity — the most information it can carry — and a converse — Fano’s inequality, which turns whatever uncertainty the channel leaves into a floor on the decoder’s error. The two failure modes of a retriever are the two classical ways a channel corrupts a message, and they map onto the two words of this topic’s title. A recall failure is an erasure; a precision failure is a substitution. They are co-equal headlines, and they tell opposite stories about what an information bound can see.

Definition 1 (The retrieval channel and its two corruptions).

The clean channel is the answer model of the previous topic: input qq, output a document Dp(dq)D \sim p(d\mid q), decoder a^=argmaxap(aq,D)\hat a = \operatorname{argmax}_a p(a\mid q, D). Its delivered information is I(A;DQ)I(A;D\mid Q) and its residual uncertainty is H(AQ,D)=EqEdqH(p(q,d))H(A\mid Q,D) = \mathbb{E}_{q}\,\mathbb{E}_{d\mid q}\, H\big(p(\cdot\mid q,d)\big).

The erasure channel (a recall failure) returns the retrieved context with probability recall\mathrm{recall}; with probability 1recall1-\mathrm{recall} the context is erased and the generator falls back to the non-informative uniform belief — without a document, it knows nothing.

The substitution channel (a precision failure) returns the relevant filing with probability 1ε1- \varepsilon and, with probability ε\varepsilon, a plausible same-sector distractor in its place.

We will treat the two channels in turn. The corpus is the one the previous topic built and this one never rebuilds: four sectors, two companies each, one filing per company, so K=8K=8 answers that are also the 88 documents, with 3232 sector-ambiguous queries and temperatures τ=τdoc=0.2\tau = \tau_{\mathrm{doc}} = 0.2. On the clean channel the answer model carries I(A;DQ)=1.18I(A;D\mid Q) = 1.18 bits, dropping H(AQ)=2.06H(A\mid Q) = 2.06 bits of prior uncertainty to H(AQ,D)=0.88H(A\mid Q,D) = 0.88 bits — the numbers the notebook owns and asserts.

Recall is an erasure channel; its capacity is the recall

The cleanest channel in information theory is the binary erasure channel: each symbol arrives intact with probability 1ε1-\varepsilon or is replaced by an erasure mark ?? with probability ε\varepsilon, and the receiver always knows which. Its capacity is 1ε1-\varepsilon: the fraction of symbols that survive. A retriever that misses the relevant filing with probability 1recall1-\mathrm{recall} is exactly this channel for the answer, and the consequence for the delivered bits is an identity, not an approximation.

Theorem 1 (The delivered bits are the recall fraction of the clean bits).

Under the erasure channel, the information the channel delivers about the answer is

Ierasure(A;DQ)=recallI(A;DQ).I_{\mathrm{erasure}}(A; D \mid Q) = \mathrm{recall}\cdot I(A;D\mid Q).
Proof.

Condition on the channel’s binary state EE (transmitted vs. erased), which is independent of the answer given the query. With probability recall\mathrm{recall} the generator sees the clean document, contributing I(A;DQ)I(A;D\mid Q); with probability 1recall1-\mathrm{recall} it sees the erasure symbol. The erasure symbol is a deterministic function of the query (the uniform fallback depends on nothing else), so conditioned on QQ it carries no information about AA: I(A;?Q)=0I(A;\,?\mid Q) = 0. Hence Ierasure(A;DQ)=recallI(A;DQ)+(1recall)0I_{\mathrm{erasure}}(A;D\mid Q) = \mathrm{recall}\cdot I(A;D\mid Q) + (1-\mathrm{recall})\cdot 0. The notebook computes the left side directly across the recall grid and matches recallI0\mathrm{recall}\cdot I_0 to machine precision (test_bec_capacity_linear).

So recall is literally the surviving fraction of the relevant bits — the erasure-channel capacity, read off the retriever. Panel A of the laboratory makes the picture concrete: as you lower the recall, the delivered-bits meter empties in proportion and the answer belief flattens from its peaked clean shape toward the uniform distribution. Nothing about the answers changed; the channel simply passed fewer of the bits that distinguish them.

00.51uniform 1/K0a*234567answer belief p(a | q) through the channel (worked query 5)
bits delivered I = recall · I₀
BEC capacity = recall
0.60
bits delivered I = recall·I₀
0.710 bits
answer-belief entropy
2.695 bits

A retrieval miss erases the relevant filing (probability 1 − recall), and the generator falls back to a non-informative belief. Because the erased symbol is independent of the answer, the retriever is a Binary Erasure Channel: the surviving fraction of the relevant bits is exactly the recall, so the delivered information is I = recall · I₀ and the belief flattens toward uniform.

Finance vMF corpus reused from the PMI topic (8 companies across 4 sectors, one filing per company), 32 sector-ambiguous queries; the answer model is a synthetic softmax stand-in, not an LLM. Clean channel: I₀ = 1.183 bits, H(A|Q) = 2.059 → H(A|Q,D) = 0.876. Numbers mirror retriever_as_noisy_channel.py; the lab recomputes entropy, the Fano floors, and the channel capacities in closed form.

Fano’s inequality: the residual entropy is a floor on the answer error

What recall fails to deliver does not vanish; it stays behind as residual uncertainty. Under the erasure channel the residual entropy is a convex blend,

Herasure(AQ,D)=recallH(AQ,D)+(1recall)log2K,H_{\mathrm{erasure}}(A\mid Q,D) = \mathrm{recall}\cdot H(A\mid Q,D) + (1-\mathrm{recall})\cdot \log_2 K,

rising from 0.880.88 bits on the clean channel toward the full log28=3\log_2 8 = 3 bits of a uniform guess. The reason this residual matters is Fano’s inequality, the converse half of channel coding: it lower-bounds the error of any decoder by the uncertainty the channel leaves.

Theorem 2 (Fano's inequality — the hallucination floor).

Let the answer AA take one of KK values and let a^=a^(q,d)\hat a = \hat a(q,d) be any decoder with Bayes error Pe=Pr[a^A]P_e = \Pr[\hat a \neq A]. Then

H(AQ,D)    Hb(Pe)+Pelog2(K1),hencePe    H(AQ,D)1log2K,H(A\mid Q,D) \;\le\; H_b(P_e) + P_e \log_2(K-1), \qquad\text{hence}\qquad P_e \;\ge\; \frac{H(A\mid Q,D) - 1}{\log_2 K},

where HbH_b is the binary entropy. No decoder — no generator, however capable — drives the answer error below this floor.

The loose form on the right makes the structure visible. The floor is vacuous while H(AQ,D)<1H(A\mid Q,D) < 1 bit: a channel that leaves less than one bit of uncertainty permits, in principle, a perfect decoder. As recall falls and the residual climbs past one bit, the floor lifts off zero and rises — on this corpus the crossover is at recall0.94\mathrm{recall} \approx 0.94, after which the floor climbs to 0.670.67 at full erasure, where the generator can do no better than guess. Panel B draws all of it: the residual entropy rising, the Fano floor (loose and tight) lifting off at the one-bit line, and the model’s Bayes error sitting above the floor at every operating point, exactly as the theorem requires (test_fano_is_a_theorem). This is the sense in which recall sets the floor: the bits the retriever fails to deliver become a hard lower bound on the generator’s error that no amount of generation skill can beat.

Precision is a substitution channel — and Fano goes blind

The recall story is the optimistic one: the channel is honest about what it does not know, the residual entropy rises, and Fano’s floor faithfully tracks the growing difficulty. The precision story is the treacherous one. A false positive does not erase the relevant filing — it substitutes a plausible distractor, and the generator reads it with full confidence.

Proposition 1 (Confident contamination is invisible to the entropy floor).

Under the substitution channel, the realized error against the true answer rises linearly to 11 as ε1\varepsilon \to 1: the generator reads the distractor and answers its company. Yet the residual entropy H(AQ,D)H(A\mid Q,D) stays below one bit throughout — both the gold filing and the distractor produce a sharp, confident posterior; they merely peak on different companies. Consequently the Fano floor stays pinned at zero, and the gap between the realized error and the model’s Bayes error widens without bound. An entropy-based limit cannot see a confidently wrong channel.

This is a proposition we run, not assume. Across the query set, reading the gold filing is correct for every query and reading the same-sector distractor is wrong for every query, so the realized error is exactly ε\varepsilon; meanwhile the residual entropy creeps only from 0.600.60 to 0.870.87 bits — never reaching the one bit Fano needs to react — so the floor reads 00 at every ε\varepsilon and the confident-wrong gap grows from 0.12-0.12 to +0.76+0.76 (Panel C, test_confident_wrong_gap_widens). The asymmetry with the recall case is the whole point. Recall failures are honest: they raise the entropy, and Fano accounts for them. Precision failures are confident: they keep the entropy low while making the answer wrong, and no entropy bound accounts for them at all.

The operating point is a rate–distortion choice

The two failures meet in a single design decision. Reading more documents raises recall (more chances to catch the relevant filing) but lowers precision (more false positives in the context), and the generator’s belief blends them. On this corpus the gold filing is always rank one, so recall@k is pinned at 11 and contamination cannot show up as a wrong answer — it shows up as bits of uncertainty added: as kk grows from 11 to 88, precision falls as 1/k1/k while the blended belief’s entropy rises from 0.600.60 toward the full marginal H(AQ)=2.06H(A\mid Q) = 2.06 bits (Panel D). The retriever is choosing a point on a rate–distortion curve — spending rate (bits read) to buy down distortion (answer error) — which is also the information bottleneck the generator imposes on the corpus: keep the bits that predict the answer, discard the rest. Erasure drops the bits the answer needs; substitution injects bits it must not trust.

What the channel can and cannot deliver, in one line

A retriever is a channel, and its two metrics are the channel’s two error mechanisms. Recall is the erasure capacity — the surviving fraction of the relevant bits — and what it fails to deliver becomes, by Fano’s inequality, a floor on the answer error that no generator beats: Pe(H(AQ,D)1)/log2KP_e \ge (H(A\mid Q,D) - 1)/\log_2 K. Precision is the substitution rate, and its failures are confident: they keep the residual entropy low while driving the realized answer wrong, so the information floor sees nothing and the gap it misses is the calibration problem. The bits a retriever delivers bound what the generator can do; whether the generator does it is a question of trusting the right bits — the relevance term in context selection, the faithfulness of the grounded answer, and the calibration of its confidence, each a layer above this one.

Connections

  • the direct prerequisite built the answer model this topic reads as a channel: the retrieval distribution p(d|q), the per-document posterior p(a|q,d), the RAG marginal prior, and the entropy/KL machinery in bits — and it computed the very I(A;D|Q) = H(A|Q) − H(A|Q,D) we now treat as the channel's clean throughput, the bits a recall-degraded channel delivers only a recall fraction of pmi-retrieval-value
  • that topic defined recall and precision as set-membership estimators; this topic recasts the same two numbers as a channel's two error mechanisms — recall as the surviving fraction of an erasure channel, precision as the contamination of a substitution channel — and shows what each does to the information the retriever can deliver and the error the generator must incur set-metrics-precision-recall-map-mrr
  • that topic showed raw retrieval scores are wildly over-confident and must be recalibrated; this topic gives the information-theoretic reason it matters — Fano's floor bounds only the generator's Bayes error, so a confidently-wrong retriever drives the realized error far above the floor, and that realized-vs-Bayes gap is precisely the miscalibration the calibration pillar measures and corrects significance-testing-calibration
  • the LLM-as-judge topic estimated faithfulness as a biased mean of noisy verdicts; this topic supplies the upstream limit — the retriever's residual entropy H(A|Q,D) is a floor on how faithful any generator can be, and the confident-wrong substitution failure is the mechanism a faithfulness judge is built to catch llm-as-judge-ragas
  • InfoNCE trained the encoder by maximizing a lower bound on the query–document information I(Q;D) ceilinged at log(N+1); that mutual information is the channel capacity this topic reads the retriever through, so contrastive training was, all along, buying the bits the erasure channel then delivers a recall fraction of infonce-contrastive-objective
  • the capstone wired a full filings-and-transcripts pipeline and tuned its recall and precision empirically; this topic gives the information limit those knobs trade against — every retrieval miss erases bits the generator cannot recover, and every false positive risks a confident wrong answer the recall metric never sees capstone-multimodal-financial-rag

References & Further Reading

  • paper A Mathematical Theory of Communication — Shannon (1948) The founding paper: channel capacity C = max I(X;Y), the noisy-channel coding theorem, and the binary symmetric and erasure channels whose capacities 1 − H_b(p) and 1 − ε this topic maps onto precision and recall; Bell System Technical Journal 27 (1948)
  • book Elements of Information Theory — Cover & Thomas (2006) The standard reference: Fano's inequality (§2.10) bounding error by conditional entropy, channel capacity (Ch. 7), and the binary erasure and symmetric channels — the three results this topic assembles into the recall floor and precision gap; 2nd edition, Wiley
  • book Transmission of Information: A Statistical Theory of Communications — Fano (1961) The eponymous source of Fano's inequality, H(X|Y) ≤ H_b(P_e) + P_e log(M−1), the converse that lower-bounds decoding error by the residual conditional entropy — read here as the floor a retriever's residual H(A|Q,D) places on answer error; MIT Press
  • book Information Theory, Inference, and Learning Algorithms — MacKay (2003) Entropy, mutual information, and the noisy-channel coding theorem from a Bayesian-inference viewpoint, with Fano's inequality lower-bounding answer error by H(A|Q,D) — the bridge the PMI topic named and this topic crosses; Cambridge University Press, freely available
  • paper Information Retrieval as Statistical Translation — Berger & Lafferty (1999) The classic noisy-channel reading of IR: a query is a noisy encoding of an information need and retrieval inverts the channel — the historical root of the retriever-as-channel framing this topic makes information-theoretic; SIGIR 1999
  • paper Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks — Lewis, Perez, Piktus, Petroni, Karpukhin, Goyal, Küttler, Lewis, Yih, Rocktäschel, Riedel & Kiela (2020) The RAG architecture whose marginal p(a|q) = Σ_d p(d|q) p(a|q,d) is the channel this topic degrades: erasing or substituting the retrieved d is exactly perturbing the document the generator marginalizes over; NeurIPS 2020
  • paper Representation Learning with Contrastive Predictive Coding — van den Oord, Li & Vinyals (2018) InfoNCE / CPC: minimizing the loss maximizes a lower bound on I(q;d⁺) ceilinged at log(N+1) — the query–document channel capacity the retriever was trained to buy, and the bits the erasure channel then passes a recall fraction of