Diversity and maximal marginal relevance
Greedily select useful nonredundant evidence while declaring relevance scales, similarity meaning, and the limits of MMR.
On this page
The question for today
What you’ll understand
- Compute an MMR next-document choice against already selected evidence.
- Explain why coefficient meaning depends on relevance and redundancy scales.
- Distinguish reduced similarity from factual coverage or guaranteed global optimality.
A result list containing five near copies of the same explanation may be less useful than a list covering complementary evidence. Diversity can help, but choosing merely different text can also introduce irrelevant material. Carbonell and Goldstein’s original MMR paper combines query relevance with a penalty for similarity to already selected items. This lesson treats that greedy criterion as a declared heuristic, not a guarantee of factual correctness, aspect coverage, or optimal set selection.
Select against the evidence already chosen
Begin with a candidate pool that satisfies the task’s basic eligibility and relevance requirements. For each next choice, compare its relevance with its maximum similarity to any already selected item. The maximum penalizes a close duplicate even if it differs from other selected items. Recompute the penalty after each selection because the selected set changes. Define an initialization policy when the set is empty, such as seeding the highest-relevance item with a deterministic tie rule. Candidate truncation can limit which aspects are available before MMR begins.
Relevance and redundancy need not use the same model. A cross encoder may score query relevance while a document embedding measures inter-document similarity. That is allowed by the original construction, but the scales and failure modes differ. A paraphrase can add no new evidence despite different surface wording, while two similar passages can provide independent corroboration. Decide what redundancy means for the product: duplicate text, repeated claim, same source, or same user intent. One cosine value cannot certify all of those notions simultaneously.
Coefficient values depend on feature scales
A coefficient of one half does not imply equal practical influence when one input ranges from zero to one and another spans tens of units. Calibrate the scale convention or validate transforms and the coefficient together on held-out queries. A strictly increasing relevance transform can preserve a pure relevance ranking yet change MMR decisions because the criterion uses score differences and a weighted penalty. The same issue applies when swapping embedding models: a changed similarity distribution can alter diversity behavior even if each score still lies within nominal bounds.
Positive scaling exposes that dependence algebraically. Multiplying relevance by one factor and redundancy by another changes the effective tradeoff after factoring out an overall positive constant. This is a property of the selection rule, not evidence that either score is calibrated. Negative similarities also need a policy: a negative redundancy value creates a bonus in the raw formula. If the implementation clips, shifts, or otherwise transforms similarities, document that choice and validate its effect rather than presenting it as the unchanged original criterion.
Judge useful coverage rather than difference alone
Evaluate relevance and redundancy jointly with query-specific judgments. Some queries need one exact answer or several corroborating sources, while exploratory queries may benefit from covering several intents. A diversity penalty can suppress an essential closely related document or select a tangential outlier. Inspect those cases rather than optimizing an average similarity statistic alone. The candidate pool, seed choice, desired list length, and tie policy belong in a reproducible experiment. Include the downstream use when deciding whether reduced redundancy actually improves the answer.
The vector lab supplies nonnegative coefficients for a separate hand calculation. Reset, set angle to 0 degrees and magnitude to 1, predict components, then Step: (1,0). Compare a fresh Reset with both angle at 45 degrees and magnitude at 1 before Step: approximately (0.7071,0.7071). Use horizontal coefficient times relevance minus vertical coefficient times redundancy for fixed lesson candidates. The instrument does not select documents, track a selected set, or compute MMR; its components only illustrate how a tradeoff changes.
Work it through
A less redundant second document can win
One document is already selected. Candidate B has relevance 0.85 and maximum similarity 0.9 to the selected set; C has relevance 0.7 and maximum similarity 0.2. Use the displayed criterion with compatible declared scales. Compare λ = 0.6 and λ = 0.9.
At λ = 0.6, B scores 0.6 × 0.85 − 0.4 × 0.9 = 0.15. C scores 0.6 × 0.7 − 0.4 × 0.2 = 0.34, so C wins.
At λ = 0.9, B scores 0.765 − 0.09 = 0.675 and C scores 0.63 − 0.02 = 0.61, so B wins.
The rule switches because B’s relevance advantage is traded against a 0.7 redundancy disadvantage. This computation establishes a heuristic choice, not that C covers a new true fact or B supplies unnecessary evidence.
A diversity coefficient has operational meaning only alongside the score scales and the task’s evidence needs.
The living notebook
Explore the model
Interactive lab · vectors
Coefficients for a relevance-minus-redundancy calculation
Reset, set θ = 0° and r = 1, predict components, then Step: (1,0). Compare a fresh Reset with both θ = 45° and r = 1 before Step: approximately (0.7071,0.7071). Use x·relevance − y·redundancy by hand on B and C; the instrument does not implement MMR or judge evidence.
- x component
- 1.393
- y component
- 0.975
- Magnitude
- 1.7
Playback traces a fixed vector and its projections. Angle and magnitude set the geometry; the moving marker does not change them. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.
Look forA tradeoff changes with coefficients and score scales, while useful diversity needs relevance evidence.
Pause & reason
Check your understanding
Your turn
Try it yourself
With λ = 0.5, candidate A has relevance 0.8 and redundancy 0.7, while B has relevance 0.6 and redundancy 0.1. Compute their criterion values. If relevance is then scaled by ten, compute the effective coefficient under the displayed scale formula.
Take a moment to make a prediction or work it out on paper. Open a hint when you need one.
Give me a hint
Subtract half the redundancy from half the relevance, then use a = 10 and b = 1.
Compare with the solution
A scores 0.4 − 0.35 = 0.05 and B scores 0.3 − 0.05 = 0.25, so B wins under the original scales. Scaling relevance by ten changes the effective coefficient to 5/(5 + 0.5) = 10/11, approximately 0.9091. It strongly favors relevance; a relevance-preserving scale transform need not preserve MMR decisions, and usefulness still requires judgments.
Keep the idea
Take it with you
- MMR recomputes a greedy redundancy penalty against the already selected set.
- Relevance and similarity scales determine the effective coefficient.
- Reduced similarity is a heuristic signal, not proof of factual coverage or an optimal evidence set.
Read further
Original sources and deeper explanations to follow at your own pace.
Optional progress, saved in this browser when available. Revisit any lesson at any time.
Lesson not marked complete.