Context Selection: Submodular Coverage, MMR, and Determinantal Point Processes
Once retrieval returns more candidate passages than the window can hold, which subset do you keep? Ranking by relevance packs the context with near-duplicates that each add almost nothing — the diminishing returns PMI measured in bits — so the right objective is monotone submodular coverage, for which greedy is provably within 1−1/e of the optimum (Nemhauser–Wolsey–Fisher), while MMR trades relevance against redundancy as a popular heuristic with no such guarantee, and a determinantal point process makes diversity a probability P(S) ∝ det(L_S), the squared volume of the selected feature vectors, so two near-duplicates span a flat parallelepiped and are almost never drawn together — and at a fixed budget every one of these diversity-aware rules beats plain top-k on the answer it ultimately produces.
From “how much to read” to “what to choose”
The previous topic ended with a verdict and an unfinished sentence. The verdict: a bigger context window does not relax the retrieval problem, it sharpens it — answer quality peaks at the smallest context that carries the answer and declines as you stuff the window, because the extra passages are redundant at best and same-sector distractors at worst. The unfinished sentence: the right response is not a larger window but a better-chosen one, and “the discipline of choosing that handful is what the rest of the layer is about.”
This is that discipline. Retrieval hands us a ranked list of candidate passages, more than the budget can hold; we must pick a subset of size . The naive rule is top- by relevance, and we already know its failure mode: the highest-scoring passages of a confusable company are near-copies of one another, so top- spends its budget re-reading the same fact. We want instead a subset that covers what the query needs — relevant, but also spread out, with little redundancy. The good news is that this is not a vague design preference. It is a clean optimization problem with a real approximation theorem, and the honest accounting of which popular methods earn that theorem and which do not is most of what this topic is.
We will formalize three answers — submodular coverage, the MMR heuristic, and determinantal diversity — on the same finance geometry the rest of the arc used, and read each through the imported answer model so the numbers chain. The thread that ties them together is the property we have been circling since PMI measured it in bits: diminishing returns.
Diminishing returns, formalized
Let be the candidate pool returned by retrieval, with unit-vector embeddings , and let score any subset by how well it serves the query. Two properties make tractable.
Definition 1 (Monotone submodular set functions).
The marginal gain of adding an element to a set is
is normalized if , monotone (nondecreasing) if , and submodular if for all and all ,
Submodularity is exactly diminishing returns: adding to a smaller set helps at least as much as adding it to a larger one. (Equivalently, for all .)
This is not a new phenomenon for us; it is a name for one we measured. The PMI topic showed that a second, identical filing moves the answer belief almost not at all — far less than the first filing, and far less than a genuinely novel one. Read that as a set function: the marginal value of the redundant passage, added to a set that already contains its twin, is tiny. Submodularity is that inequality holding for every pair of nested sets at once. Panel A of the lab plots the marginal gains of greedy selection and watches them shrink — the discrete signature of a submodular objective.
Coverage as a covering: the facility-location objective
We need a concrete that rewards covering the pool rather than re-reading one corner of it.
Definition 2 (Facility-location coverage).
With a nonnegative similarity between candidates (we use the clipped cosine ) and nonnegative item weights , the facility-location coverage of a selection is
Each candidate in the pool is “covered” by its single closest representative in ; the objective rewards a set that has, for every candidate the query weights, some close member. It is the Lin–Bilmes summarization objective and the classical facility-location function.
The geometric reading is the whole point: asks how well the chosen handful stands in for the whole pool. Two near-duplicates both close to one region cover it about as well as either alone — so the second adds little, which is precisely the diminishing returns we are after. The convention is load-bearing, and we will see in the proof exactly where.
Theorem 1 (Facility-location coverage is monotone submodular).
With and , is normalized, monotone nondecreasing, and submodular.
Proof. Normalization is the convention . For monotonicity, fix a candidate ; if then because the maximum is taken over a superset. Multiplying by and summing over gives .
For submodularity it suffices to prove each summand is submodular, since a nonnegative combination of submodular functions is submodular. Fix and write . Let and , and set and , so . The marginal gain of adding to a set whose current best similarity is is
Hence and . Because is nonincreasing in and , we get , i.e. . Summing the submodular over proves submodular.
The engine is the hinge : once a candidate is well covered (large incumbent best match ), there is less room for a new near-duplicate to improve its coverage. That is diminishing returns made geometric. (The nonnegativity of is what makes consistent with monotonicity and keeps the hinge argument clean; a signed cosine would break both.)
The greedy guarantee
Maximizing subject to is NP-hard. But a one-line algorithm does remarkably well.
Algorithm 1 (Greedy selection under a budget).
Start with . For , add the element of largest marginal gain,
and return . (Minoux’s lazy-greedy keeps a priority queue of stale marginal gains; since submodularity guarantees gains only shrink, most are never recomputed — the same output, far faster. The notebook checks the lazy and standard selections are identical.)
Theorem 2 (Nemhauser–Wolsey–Fisher: greedy is a (1−1/e)-approximation).
Let be monotone, submodular, and normalized, and let with maximizer . Then
Proof. Fix iteration with current set , and order the optimum as with . By monotonicity and the exact telescoping identity for marginal gains,
Each conditioning set contains , so submodularity bounds every term by its value at : . And greedy takes the best available marginal, so for every . With and nonnegative marginals,
Write the residual gap . The inequality says , so by induction from ,
Finally increases to from below, so .
Three remarks on what the proof uses and what it promises. Monotonicity enters twice — to write and to let the marginals stay nonnegative; submodularity enters in the single inequality bounding each optimum-element’s marginal by its value at ; normalization sets . Remove monotonicity and the recurrence fails — this is exactly the door MMR walks through below. And the constant is not slack in the analysis: Feige (1998) showed that no polynomial algorithm beats for max-coverage unless , and Nemhauser–Wolsey (1978) proved the same in the value-oracle model. So is the best a tractable method can promise.
Greedy coverage f(Sₖ) rises and flattens: each pick's marginal gain Δₖ is no larger than the one before — the diminishing returns that define a submodular set function, the same saturation PMI measured in bits. Facility-location coverage is submodular (witness ≈ 0.00); the answer-information gain we'd like to optimize is not (witness -0.71 < 0) — synergistic evidence breaks it — so coverage is the clean backbone that earns a theorem. (The cleanest counterexample: a synergistic pair where each observation alone is worth 0 bits yet together they are worth 1 bit — the marginal gain increases with conditioning, the opposite of diminishing returns.)
Finance vMF corpus reused from the dense-retrieval / long-context geometry: 16 query pools of 9 candidates each — 5 sector-generic near-duplicates (ambiguous between the gold company and its confusable peer, the highest relevance), one lower-relevance disambiguator near the gold prototype, and 3 distractors. The answer is read through the imported answer_posterior_topk (a synthetic softmax stand-in, not an LLM). MMR uses λ = 0.5. Numbers mirror context_selection_submodular_dpp.py; the lab recomputes only the marginal-gain differences and the (1−1/e) floor.
Panel B shows the guarantee with teeth. On a small constructed instance, greedy grabs the biggest set first and reaches of the optimal — a real gap, the realized ratio — yet it sits comfortably above the floor. (On the smooth finance pool greedy happens to reach the optimum; the bound is a worst-case promise, and the worst case is where it earns its keep.)
MMR: the heuristic that does not earn the theorem
The field’s standard diversity tool predates the submodular framing and is worth stating precisely, because its relationship to the theorem is the topic’s central honesty note.
Definition 3 (Maximal Marginal Relevance).
Maximal Marginal Relevance (Carbonell–Goldstein, 1998) selects sequentially: with the set chosen so far, it adds
trading the candidate’s relevance against its redundancy with the chosen set. At it is exactly top-; at it is pure dispersion.
Proposition 1 (MMR carries no (1−1/e) guarantee).
MMR is not covered by Theorem 2, for two distinct reasons that should both be stated plainly.
- It is not greedy on a fixed set function. The penalty is computed against the evolving chosen set , not as the marginal gain of any single fixed . There is no objective whose greedy argmax equals MMR’s at every step, so a theorem about greedy on one monotone submodular simply does not apply.
- The closest fixed objective is submodular but non-monotone. The natural MMR-flavored set function, , is submodular (a modular relevance term plus a negated supermodular pairwise term) but not monotone: adding a redundant passage to a large set can decrease it, as the new pairwise penalties outweigh its relevance. Monotonicity is exactly the hypothesis Theorem 2 requires.
Non-monotone submodular maximization has its own theory — double-greedy achieves unconstrained (Buchbinder et al.) — but plain MMR is not that algorithm and inherits none of its bounds.
None of this makes MMR bad. It is cheap, effective, and the historical origin of diversity-aware selection; in the lab it lands between top- and the submodular methods. The point is only that its "" is folklore, not theorem. The clean monotone-submodular backbone for a provable guarantee is facility-location coverage — and, as we will now see, the log-determinant.
Diversity as volume: determinantal point processes
There is a second, probabilistic route to diversity, and its geometry is beautiful.
Definition 4 (Determinantal point processes and the volume geometry).
An L-ensemble DPP over with a positive semidefinite kernel assigns to each subset
If is a Gram matrix of feature vectors, then
the squared volume of the parallelepiped the selected feature vectors span. Diversity is geometric: near-duplicate passages give near-collinear ‘s, a degenerate near-zero-volume solid, hence near-zero probability. A DPP structurally suppresses redundant subsets.
The kernel factors the trade-off cleanly. Write with a relevance scalar and a unit diversity feature , so with . Then, by multilinearity of the determinant in the rows and columns of ,
This is the Kulesza–Taskar quality–diversity decomposition: the probability of a set rises with the relevance of its members and with how spread out they are. Panel C of the lab shows the geometry directly — the candidate pool in two dimensions, with each method’s selection highlighted, and the factorization read off a worked triple.
log det is submodular, so DPP MAP inherits the guarantee
Finding the most probable set — the DPP MAP — is the natural selection rule, and it connects straight back to Theorem 2.
Theorem 3 (log det(I + L_S) is monotone submodular).
For positive semidefinite , the function is normalized, monotone nondecreasing, and submodular.
Proof. Write the marginal gain of adding to . Let (positive definite), let be the cross-column and . The block-determinant (Schur-complement) identity gives
The quantity is the Schur complement of — in the Gaussian-process reading where is a covariance, it is the posterior variance of feature after conditioning on the features in . The shift is what makes this clean: the full block matrix is , so its inverse is . The Schur complement is the reciprocal of the diagonal entry of that inverse, and since every diagonal entry of a matrix is at most , the Schur complement is ; hence and is monotone. For submodularity, the Schur complement is nonincreasing under additional conditioning — conditioning on more elements can only reduce posterior variance (the “information never hurts” fact for Gaussians, the Loewner-order monotonicity of the Schur complement of a larger principal block). So gives , and since is increasing, .
Because is monotone submodular and normalized, greedy maximization of under inherits the guarantee of Theorem 2 — and that greedy is precisely fast greedy DPP MAP (Chen et al., 2018), each step a Schur-complement (Cholesky rank-one) update. The notebook reuses the same greedy maximizer for facility location and for , differing only in the value oracle.
Corollary 1 (Certified diversity, with an honest boundary).
Greedy on returns a set within of the optimum of that surrogate. The exact -DPP MAP — — is NP-hard, so the certified object is the monotone surrogate, not the raw determinant. The regularization is also what keeps the objective finite when a near-duplicate makes singular (raw ). The notebook handles that singular case with a small ridge.
The objective we actually want, and why it is not submodular
Coverage and are the clean backbones. But the objective most faithful to the rest of this layer is neither — it is the answer-information gain, and it does not behave.
Remark (Information gain is the honest hinge).
The objective we would like to maximize is
the multi-document generalization of the bits PMI measured. It is monotone and normalized. But mutual information of a set of observations with a target is not submodular in general. The cleanest counterexample is a synergistic pair: let with independent fair bits. Each observation alone is useless — — yet together they determine , so bit. The marginal gain of therefore increases with conditioning,
the opposite of diminishing returns. This is not only an abstract example: on our finance corpus the numerical submodularity witness for is clearly negative (), while facility-location coverage’s is . Submodularity of information gain holds only under structural assumptions, the cleanest being conditional independence of the observations given the target (Krause–Guestrin, 2005). So we optimize coverage — which is submodular and earns Theorem 2 — and treat information gain as the motivating-but-caveated quantity it is.
It is worth keeping the ledger explicit, because the differentiator of this topic is the honesty about it:
| Object | Status |
|---|---|
| Facility-location coverage is monotone submodular | Theorem (proved, Theorem 1) |
| Greedy gets on monotone submodular | Theorem (proved, Theorem 2) |
| is monotone submodular, so greedy DPP MAP gets | Theorem (proved, Theorem 3) |
| Exact -DPP MAP | NP-hard (cited) |
| MMR has a guarantee | False / folklore (Proposition 1) |
| Information gain is submodular | Conditional — only under conditional independence |
| Diverse selection beats top- at fixed on a redundant pool | Demonstrated (run, pinned) |
That last row is the payoff, and it is the reason any of this matters for an answer.
Proposition 2 (Diversity-aware selection beats top-k at a fixed budget (demonstrated)).
We build, for each query, a candidate pool with the redundancy structure that makes selection bite: a tight
cluster of sector-generic near-duplicates that support the gold company and its confusable peer about
equally — and carry the highest query relevance — plus a single, less-relevant disambiguating passage
near the gold prototype, plus low-relevance distractors. Reading each method’s selection through the
imported answer_posterior_topk under an equal attention budget, at budget :
where is the posterior mass on the true company. Top- spends all three slots inside the redundant cluster, where the generics support gold and peer equally, and leaves the answer split; coverage and DPP reach the disambiguator and resolve it. The notebook asserts the observed ordering and the seed-independent coverage contrast.
This is a demonstrated proposition, pinned to the run, not a universal law. The mechanism is the honest one: diversity helps not for its own sake but because the disambiguating evidence is less query-similar than the redundant cluster, so only a coverage- or quality-aware selector reaches it. On a pool with no redundancy, coverage and relevance coincide and the gap vanishes — the correct boundary condition. One caveat the lab makes visible: diversity raises the mass on the truth while spreading the remaining mass across more companies, so the answer entropy actually rises; quality here is mass-on-truth, not low entropy, and we do not claim the latter.
What context selection trades, in one line
At a fixed budget, choose for coverage and diversity, not relevance alone: the greedy choice is provably within of optimal for the right (monotone submodular) objective, MMR is the cheap heuristic that does not earn that bound, a DPP makes diversity the squared volume of the selected vectors, and on a redundant pool every diversity-aware rule beats top- on the answer it produces — because top- re-reads the same fact while a covering set buys the disambiguating evidence.
Connections
- PMI proved a redundant second filing adds almost no bits — the chain rule of mutual information, not a heuristic; this topic makes that the defining property of the selection objective: submodularity IS diminishing returns, the marginal coverage of a near-duplicate passage is near-zero, and the saturation it measured in bits is the same asymmetry the greedy marginal-gain curve plots, so the bits PMI counted are the coverage greedy declines to re-buy pmi-retrieval-value
- the long-context topic showed answer quality Q(k) is flat over the redundant top-k set and declines as same-sector distractors dilute the budget, leaving a better-CHOSEN window as the open problem; this topic solves it — it imports the very answer_posterior_topk that produced that Q(k) and shows diversity-aware selection beats plain top-k on Q at the SAME budget, turning 'a bigger window is not better' into 'a better-spread window is' retrieval-vs-long-context
- the noisy-channel topic spent bits read to buy down answer error and read the recall–precision point as rate–distortion; this topic chooses WHICH bits to read — the subset that maximizes coverage rather than recall — so selecting a high-coverage low-redundancy set is choosing the channel input that delivers the most distinct evidence per slot, the discrete face of that rate–distortion budgeting retriever-as-noisy-channel
- chunking decides the granules retrieval can return; this topic decides which granules to keep, and the two interact — finer chunks raise candidate redundancy and make the diversity term do more work, so the segmentation choice upstream sets how much the submodular/DPP selection downstream must spread to cover the query without re-reading the same passage twice chunking-as-segmentation
- that topic defined recall@k and precision@k as set-membership scores indifferent to redundancy; this topic shows why presence is not coverage — two passages can both be 'relevant' (counted by recall) yet span near-zero added volume (det(L_S)≈0), so a coverage- or determinant-based objective scores the diversity the set metrics cannot see, and MMR/DPP optimize for it directly set-metrics-precision-recall-map-mrr
- the dense dual-encoder geometry — sectors of confusable companies at a measured same-sector cosine — is both the candidate pool and the similarity kernel here: facility-location's sim(i,j), MMR's max_{d'∈S} sim(d,d'), and the DPP kernel all read off the same inner products the dual encoder learned, so the embedding geometry that makes companies confusable is exactly what the diversity term must overcome dense-retrieval-dual-encoders
References & Further Reading
- paper An Analysis of Approximations for Maximizing Submodular Set Functions—I — Nemhauser, Wolsey & Fisher (1978) The (1−1/e) guarantee: greedy maximization of a monotone submodular function under a cardinality constraint returns at least 1−1/e ≈ 0.632 of the optimum — the theorem proved in full here; Mathematical Programming 14 (1978)
- paper Best Algorithms for Approximating the Maximum of a Submodular Set Function — Nemhauser & Wolsey (1978) The companion value-oracle lower bound: no polynomial algorithm beats 1−1/e in the oracle model, so the greedy constant is optimal, not an artifact of the analysis; Mathematics of Operations Research 3(3)
- paper The Use of MMR, Diversity-Based Reranking for Reordering Documents and Producing Summaries — Carbonell & Goldstein (1998) Maximal Marginal Relevance: λ·rel(d,q) − (1−λ)·max_{d'∈S} sim(d,d') — the field's workhorse diversity reranker, a heuristic with no submodular guarantee in general (the rigor flag); SIGIR 1998
- book Determinantal Point Processes for Machine Learning — Kulesza & Taskar (2012) The DPP reference: P(S) ∝ det(L_S) as squared volume, the quality–diversity factorization L = diag(q) S diag(q), sampling, and log-det MAP — the probabilistic diversity model; Foundations and Trends in Machine Learning 5(2–3), preprint arXiv:1207.6083
- paper Near-Optimal Nonmyopic Value of Information in Graphical Models — Krause & Guestrin (2005) Information gain is submodular UNDER conditional independence of the evidence — and the caveat that it need not be otherwise — the bridge from PMI's bits-added to a submodular objective, and the assumption in the rigor flag; UAI 2005
- paper Accelerated Greedy Algorithms for Maximizing Submodular Set Functions — Minoux (1978) Lazy greedy: exploiting submodularity to skip marginal-gain recomputations, returning the same (1−1/e) set far faster — the practical algorithm behind the greedy curve; Optimization Techniques, LNCIS 7, Springer
- paper A Class of Submodular Functions for Document Summarization — Lin & Bilmes (2011) Facility-location and saturated-coverage submodular objectives for selecting a representative subset — the coverage function f(S) = Σ_i w_i max_{j∈S} sim(i,j) this topic selects context with; ACL-HLT 2011
- paper Fast Greedy MAP Inference for Determinantal Point Process to Improve Recommendation Diversity — Chen, Zhang & Zhou (2018) The greedy log-det MAP approximation that makes DPP selection practical — exact MAP is NP-hard, handled by an incremental Cholesky greedy on the monotone surrogate; NeurIPS 2018
- paper A Threshold of ln n for Approximating Set Cover — Feige (1998) The hardness companion: 1−1/e is the best approximation any polynomial algorithm can achieve for max-coverage unless P = NP, so the greedy bound is tight; Journal of the ACM 45(4)
- book Elements of Information Theory — Cover & Thomas (2006) The chain rule of mutual information behind diminishing returns, and the entropy framing of coverage carried over from the PMI and long-context topics; 2nd edition, Wiley