Pointwise Mutual Information: What Retrieval Adds to Generation, in Bits
Generation begins with an answer prior p(a|q) and a retrieved document sharpens it to a posterior p(a|q,d); the log-ratio of the two is the pointwise mutual information of that document for that answer — positive for a relevant filing, negative for a distractor that costs bits — and its average is the conditional mutual information I(A;D|Q), the entropy retrieval removes, the same quantity the dense encoder's InfoNCE objective maximized a lower bound on
From “did the right document come back” to “how many bits did it add”
The evaluation layer scored retrieval by presence. A metric is a sample mean of per-query scores (set metrics): recall asks what fraction of the relevant documents were returned, average precision weights them by rank. These are estimators of whether the right documents came back, and they are the right question when the failure mode is a missing document.
But a retrieval-augmented generator does not consume a recall number. It consumes the documents, and it produces an answer. The question that matters for generation is not whether a document was returned but what it did to the answer — and the natural unit for that is the bit. Generation begins, before any retrieval, with a distribution over answers conditioned on the query alone, the prior . It is uncertain: an analyst’s question may pin a sector but not the specific company, so the prior spreads its mass and carries entropy . A retrieved document sharpens that distribution to a posterior , and the amount of uncertainty it removes is measured in bits.
Retrieval value is entropy reduction: the bits a document removes from the answer’s uncertainty. Per answer it is the pointwise mutual information ; on average it is the conditional mutual information .
The prior spreads over the sector's companies (uncertain). The gold filing (doc 1) sharpens the posterior onto a* and gives a positive pmi; the same-sector distractor (doc 0) sharpens onto the wrong company, so pmi at a* turns negative — it costs bits. A far-sector filing barely touches a*.
Finance vMF corpus reused from the dense-retrieval 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. I(A;D|Q) = 1.183 bits (H(A|Q) = 2.059 → H(A|Q,D) = 0.876). Numbers mirror pmi_retrieval_value.py; the lab recomputes entropy, pmi, and histogram bins in closed form.
The lab above is the topic in four panels, and we take each in turn: the prior sharpening into a posterior as a document is retrieved, with the bits removed and the pmi at the true answer read off; the histogram where a relevant filing’s pmi is positive and a distractor’s is negative; the diminishing returns of a redundant second document; and the InfoNCE bound the encoder maximized, beside the recall axis that bits are orthogonal to.
The answer model: a prior, a posterior, and the log-ratio between them
To measure bits we need probabilities, and a retriever gives us geometry — query and document directions and the inner products between them. We turn the geometry into an answer model in the way retrieval-augmented generation does: a retrieval distribution over documents, a per-document answer distribution, and a prior that is the marginal of the two. We reuse the dense-retrieval finance geometry — four sectors, two companies each, one filing per company — so the answer prototypes are the company filing directions, and the answer to a query is which company it concerns.
Definition 1 (The answer prior, posterior, and pointwise mutual information).
Let the answer space be the companies with unit prototypes , and let be unit query and document vectors. The retrieval distribution is the dual-encoder MIPS softmax
the per-document answer posterior sums the query’s and the document’s evidence in log-space,
and the prior is the RAG marginal over which document is retrieved,
The pointwise mutual information of document for answer is the log-ratio
the logarithm of the Radon–Nikodym derivative of the posterior answer measure with respect to the prior answer measure. The marginal definition of the prior is load-bearing — it is what makes the mutual information identity below close exactly, rather than approximately.
The orientation of pmi is the whole point: it is positive when a document raises an answer’s probability above its prior and negative when it lowers it. A document is not uniformly informative; it carries different bits about different answers, and — as we will see — it can carry negative bits about the true one.
Information gain and the bits retrieval adds
Average pmi over the posterior and you get the per-document information gain, the KL divergence from prior to posterior; average that over which document is retrieved and over queries and you get the conditional mutual information — the bits retrieval adds. The Shannon entropy and the KL divergence are developed in full on formalML; here we assemble them into one identity and verify it three ways.
Theorem 1 (Retrieval value is entropy reduction).
For a fixed query , with the prior the marginal of the posterior,
and averaging over queries gives , the bits retrieval adds.
Proof.
Write . Because the prior is the marginal, , the ratio inside the joint sum is , so the joint sum collapses to , the expected-gain form. Expanding the logarithm as and using the marginal once more turns the same expression into . Nonnegativity is Gibbs’ inequality: each , so the -weighted average is too. The notebook computes all three forms and asserts they agree — they coincide to machine precision (maximum pairwise disagreement to the printed precision), with bits dropping to bits, a gain of bits.
∎The three forms are not three approximations that happen to be close; they are one number written three ways, and the proof is what guarantees it. The entropy-reduction form is the slogan — retrieval removes uncertainty — the expected-gain form is the per-document decomposition the next sections lean on, and the joint sum is the definition of mutual information itself.
A relevant filing adds bits; a distractor costs them
The expected gain is always nonnegative — any document that moves the belief has positive gain in the Shannon sense. But the gain is an average over answers, and the pointwise pmi at a particular answer need not be positive. The answer that matters is the true one, , and there the sign is diagnostic.
Proposition 1 (The sign of pmi at the true answer).
A relevant filing — the gold company’s own document — raises the posterior on above the prior, so . A plausible distractor — a different company’s filing in the same sector — sharpens the posterior onto the wrong company, lowering the probability of , so , even though the distractor’s information gain — it moves belief, just toward the wrong answer. A document that costs bits at the truth is a document that, in expectation, makes the generator more likely to be wrong.
This is a proposition about the toy, not a theorem about relevance labels, and it is one we run rather than assume: across the query set the mean pmi at the true answer is bits for relevant filings and bits for distractors, and of distractors land on the negative side (Panel B). The point of pmi as a word-association score was always that the sign carries meaning — co-occurrence above chance is positive, below chance negative — and the same sign here separates evidence that helps the generator from evidence that misleads it. It is also the precise sense in which a high-recall retriever can hurt: returning a fluent, on-topic, wrong passage is returning negative bits.
Diminishing returns: a redundant document adds almost nothing
If one document adds bits, do two add twice as many? Only if the second is new. The bits a sequence of documents adds obey the chain rule of mutual information, and redundancy makes the later terms vanish.
Proposition 2 (Saturation is the chain rule of mutual information).
The information two documents add about the answer decomposes as
When is redundant with — the same filing again — the conditional term is near zero: the posterior is already where put it, and a second copy barely moves it. A novel — a different filing — leaves the conditional term large.
Measured as belief movement , the gold filing moves the posterior bits from the prior; a second identical copy then adds only bits, while a different filing adds (Panel C). The marginal value of evidence diminishes with redundancy — which is exactly why a context window should be filled with diverse passages rather than the top- near-duplicates a similarity search returns. Quantifying that diversity gain is a submodular-coverage problem, the subject of context selection, the topic this one points forward to.
The encoder maximized a lower bound on these bits
The dense encoder did not learn its geometry by accident. It was trained by contrastive learning, and the InfoNCE objective it minimized is, up to sign, a lower bound on the mutual information between a query and its positive document — the same whose answer-side payoff this topic measures.
Corollary 1 (InfoNCE is a lower bound on I(Q;D), ceilinged at log(N+1)).
For an in-batch problem with one positive and negatives, the InfoNCE loss satisfies
The bound can never exceed its ceiling — even a perfect critic () certifies at most bits — so it saturates: certifying more information requires more in-batch negatives, not just a better encoder.
The ceiling is the load-bearing caveat, and Panel D shows it directly: as the batch grows from two candidates to eight, the bound climbs but stays strictly under the rising line. So the encoder’s training and the retriever’s value are two views of one quantity — training pushed down to maximize a lower bound on , and the bits a retrieved document adds to the answer are that information cashed out at generation time. (The bound is loose, and the empirical from a finite batch is a notoriously unreliable point estimate of the true MI — the variational-bounds literature is a catalog of the bias; the robust statement is the saturation, not a number.)
Bits added is a different axis from recall
Return finally to the set-metric layer. On this corpus retrieval is easy: the gold filing is the query’s nearest company prototype, so it is always rank one, and recall@k and average precision are saturated at for every query. By the set-metric reading, every query is equally, perfectly served.
Yet the bits retrieval adds range from to across those same queries (Panel D, right). The variation is real — an ambiguous query whose prior was spread wide gains more than one whose prior already leaned toward the answer — and recall is blind to it. Recall measures presence: did the document come back. Mutual information measures contribution: how much did it change the answer. They are different axes, and an evaluation that reports only the first cannot see what retrieval actually did for generation.
What retrieval adds, in one line
The evaluation layer asked whether the right documents came back; this topic asks how many bits they add to the answer. The answer is the conditional mutual information , assembled from a prior , a posterior , and the pointwise log-ratio between them. The pieces carry the lessons forward: a distractor with negative pmi is the seed of the faithfulness question — when does retrieved evidence ground an answer versus mislead it; the chain rule and diminishing returns are the relevance term in context selection; and the prior-to-posterior sharpening, read as a channel, is the retriever as a noisy channel whose recall and precision bound the bits it can deliver — Fano’s inequality lower-bounds the answer error by the residual entropy . The dense encoder maximized a lower bound on exactly these bits. We now have the unit the rest of the information-theory layer is measured in.
Connections
- the direct prerequisite supplies both the encoder and the corpus this topic measures: the same von Mises–Fisher finance geometry (four sectors, two companies each, one filing per company) induces the answer model here, and the dual encoder whose rank-d ceiling that topic proved is exactly the retriever whose per-document bits we now quantify — the score it ranks by and the information it adds are two readings of one inner product dense-retrieval-dual-encoders
- that topic proved InfoNCE is a lower bound on the mutual information I(q;d⁺) ceilinged at log(N+1); this topic measures that same mutual information directly as the bits retrieval adds, so the contrastive loss the encoder minimized and the retrieval value we compute are the same quantity approached from opposite sides — training maximized a lower bound on exactly the I(Q;D) this topic estimates, and the log(N+1) saturation reappears as the ceiling on certifiable bits infonce-contrastive-objective
- that topic scored retrieval by whether the relevant set came back — recall, AP, MAP over the same legs and corpus; this topic shows bits-added is a DIFFERENT axis: on an easy corpus where the gold filing is always retrieved, recall reads 1.0 for every query while the information actually delivered varies, so presence is not contribution set-metrics-precision-recall-map-mrr
- the probability ranking principle ranks documents by probability of relevance to minimize expected loss; pointwise mutual information gives the information-theoretic relevance score behind that ordering — ranking by how much each document sharpens the answer posterior is ranking by bits, so this topic supplies the bits-based relevance signal the ranking principle assumes exists and orders by probability-ranking-principle
- the query-likelihood model scores a document by the probability it generates the query, P(q|d); pointwise mutual information is the symmetric log-ratio relating that generative score to relevance, since pmi(q;d) = log P(q|d)/P(q) is the query-likelihood log-odds, so this topic reframes the language-model relevance score that topic built as the bits a document carries about the query query-likelihood-language-models
- the capstone wired a full filings-and-transcripts RAG pipeline and measured it with recall@k; this topic adds the information-theoretic axis that pipeline never reported — how many bits each retrieved passage adds to the generated answer — and exhibits the distractor that costs bits, the redundant passage that adds none, and the gap between a passage's rank and its information value capstone-multimodal-financial-rag
References & Further Reading
- paper A Mathematical Theory of Communication — Shannon (1948) The founding paper: entropy H as the bits of uncertainty in a source, mutual information as the entropy a channel removes — the H(A|Q) − H(A|Q,D) = I(A;D|Q) identity this topic instantiates is Shannon's; Bell System Technical Journal 27 (1948)
- book Elements of Information Theory — Cover & Thomas (2006) The standard reference for entropy, KL divergence, mutual information, the chain rule I(A;D₁,D₂|Q) = I(A;D₁|Q) + I(A;D₂|Q,D₁) behind the saturation panel, and pmi as the log density-ratio whose expectation is MI; 2nd edition, Wiley
- paper Word Association Norms, Mutual Information, and Lexicography — Church & Hanks (1990) The origin of pointwise mutual information as an NLP association score: log P(x,y)/(P(x)P(y)) for word co-occurrence — the same pmi we apply to (answer, document) pairs; Computational Linguistics 16(1)
- paper Representation Learning with Contrastive Predictive Coding — van den Oord, Li & Vinyals (2018) InfoNCE / CPC: minimizing the loss maximizes a lower bound on the mutual information between query and positive, I(q;d⁺) ≥ log(N+1) − L — the bound this topic measures against, and the source of the log(N+1) saturation ceiling on certifiable bits
- paper On Variational Bounds of Mutual Information — Poole, Ozair, van den Oord, Alemi & Tucker (2019) The unifying treatment of variational MI bounds — the bias–variance tradeoff of MI estimators, InfoNCE as a low-variance lower bound, and why estimating MI from samples is hard — the methodological caveat behind this topic's MI-estimation rigor flag; ICML 2019
- 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: a retriever marginalizes a generator p(a|q) = Σ_d p(d|q) p(a|q,d) over retrieved documents — the prior-to-posterior sharpening this topic measures the bits of, with p(a|q,d) the per-document posterior; NeurIPS 2020
- book Information Theory, Inference, and Learning Algorithms — MacKay (2003) Entropy and mutual information from a Bayesian-inference viewpoint, and Fano's inequality lower-bounding answer error by the conditional entropy H(A|Q,D) — the bridge to the retriever-as-noisy-channel topic; Cambridge University Press, freely available