Re-Ranking for Diversity & Freshness
MMR, DPP, business-rule mixing, why the ranker alone over-concentrates
The ranker scores each item *independently* — it answers "how good is this item for this user?" one item at a time. That's exactly why the top-10 by score can be terrible as a *set*: if the user likes basketball, the 10 highest-scoring items are 10 near-identical basketball clips. The ranker has no notion that showing #2 right after #1 adds almost nothing because they're redundant.
MMR trades relevance against redundancy, greedily. Maximal Marginal Relevance picks items one at a time to maximize `λ·relevance(i) − (1−λ)·max similarity(i, already-picked)`. With λ=0.7 you mostly follow the ranker but penalize an item that's too similar to something already chosen. Concretely: item A scores 0.9, item B scores 0.88 but is 0.95 similar to A — MMR's marginal value for B collapses (0.7·0.88 − 0.3·0.95 ≈ 0.33) so a less-similar 0.80 item can leapfrog it.
DPP models diversity as volume, not pairwise patching. A Determinantal Point Process assigns a set a probability proportional to the *determinant* of a kernel matrix built from item quality and similarity — geometrically, the squared volume the item vectors span. Redundant items are near-parallel vectors spanning near-zero volume, so DPP naturally down-weights whole redundant *sets*, not just adjacent pairs. It's the principled cousin of MMR. Concretely, using the same A/B/C items from the MMR example above: for the redundant set {A, B}, the 2×2 kernel L = [[0.9², 0.9·0.88·0.95], [0.9·0.88·0.95, 0.88²]] = [[0.81, 0.752], [0.752, 0.774]] has det(L) = 0.81·0.774 − 0.752² ≈ 0.061 — tiny, because A and B are near-parallel (0.95 similar). For the diverse set {A, C}, L = [[0.81, 0.9·0.80·0.2], [0.9·0.80·0.2, 0.64]] = [[0.81, 0.144], [0.144, 0.64]] has det(L) = 0.81·0.64 − 0.144² ≈ 0.498 — about 8× larger, because A and C actually span volume (only 0.2 similar). DPP assigns {A, C} far higher probability than {A, B}, the same call MMR made by picking C over B — but reached by comparing whole-set volumes instead of one pairwise penalty.
Freshness and business rules ride the same re-rank stage. New items have thin engagement history, so the ranker systematically under-scores them (a cold-start feedback trap); a freshness boost or an explicit exploration slot in re-ranking counteracts it. Hard business rules — "no more than 2 items per creator in the top 10", "at least 1 item from a followed account" — are also applied here, *after* scoring, because they constrain the *set*, which the per-item ranker structurally cannot.
Key points
- The ranker scores items independently, so the top-k by score is often a redundant set. "Best 10 items" ≠ "best set of 10": 10 near-duplicate basketball clips each score high but collectively bore the user. Diversity is a *set* property the per-item ranker cannot express — it must be imposed after scoring.
- MMR = greedy relevance-minus-redundancy with a λ knob. Pick to maximize λ·rel − (1−λ)·max-sim-to-chosen. λ high → follow the ranker; λ low → aggressively diversify. Cheap, tunable, the default production diversifier.
- DPP = diversity as spanned volume, penalizing whole redundant sets. Set probability ∝ determinant of a quality×similarity kernel = squared volume of the item vectors; near-parallel (redundant) vectors span ~0 volume and are suppressed. More principled than MMR's pairwise patch, at higher compute.
- Freshness boosts and hard business rules live in re-ranking because they constrain the set. Cold items are under-scored by an engagement-trained ranker; freshness/exploration slots counteract it. "≤2 per creator", quotas, and mixing rules apply post-scoring — the per-item ranker can't enforce set-level constraints.
The ranker scores items one at a time, so the top-k by raw score over-concentrates on near-duplicates; re-ranking imposes *set-level* properties — MMR trades relevance against redundancy greedily, DPP models diversity as the volume item vectors span, and freshness boosts plus hard business rules ride the same stage because they too constrain the set.
Recap
- The ranker scores each item independently, so the top-k by score is often a redundant set: it answers "how good is this item for this user?" one at a time, with no notion that #2 adds nothing after #1 if they're near-duplicates. "Best 10 items" ≠ "best set of 10" — diversity is a *set* property the per-item ranker structurally cannot express, so it must be imposed after scoring.
- MMR trades relevance against redundancy greedily: pick items one at a time to maximize λ·relevance(i) − (1−λ)·max-similarity(i, already-chosen). λ high → mostly follow the ranker; λ low → aggressively diversify. Concretely, a 0.88-relevance item that's 0.95-similar to an already-picked item collapses in marginal value, letting a less-similar 0.80 item leapfrog it. Cheap, tunable — the default production diversifier.
- DPP models diversity as spanned volume, not pairwise patching: a Determinantal Point Process gives a set probability ∝ the determinant of a quality×similarity kernel = the squared volume the item vectors span. Redundant items are near-parallel vectors spanning ~0 volume, so DPP down-weights whole redundant *sets*, not just adjacent pairs — the principled cousin of MMR, at higher compute. Concretely, using the earlier A/B/C example: {A, C}'s kernel determinant (≈0.498) is about 8× {A, B}'s (≈0.061) — DPP prefers the diverse set for the same reason MMR does, just measured as spanned volume instead of a pairwise penalty.
- Freshness/exploration slots counter the ranker's under-scoring of new items: thin engagement history makes an engagement-trained ranker systematically under-score fresh items (a cold-start feedback trap), so a freshness boost or explicit exploration slot in re-ranking counteracts it.
- Hard business rules are set-level, so they ride the same re-rank stage after scoring: "no more than 2 items per creator in the top 10," quotas, "at least 1 from a followed account" — these constrain the *set*, which the per-item ranker cannot enforce, so they're applied post-scoring, not in the ranker.
Check your understanding
Q1. Select the two correct statements about why a feed's top-10 by ranker score can be 10 near-identical basketball clips.
- A) The ranker scores each item independently, so it structurally can't represent that item #2 adds little given item #1.
- B) Redundancy is a set-level property; the fix is a re-ranking step like MMR or DPP that penalizes similarity to chosen items.
- C) The ranker is overfit specifically to basketball content, and adding L2 regularization alone makes the duplicates disappear.
- D) The candidates being shown are simply stale, so refreshing the retrieval stage alone resolves the diversity problem.
Q2. Using MMR with λ=0.7: item A has relevance 0.9; item B has relevance 0.88 but similarity 0.95 to the already-picked A; item C has relevance 0.80 and similarity 0.2 to A. Which is picked next and why?
- A) B — it has the higher raw relevance score (0.88 > 0.80), and MMR is defined to always prefer higher relevance.
- B) C — its MMR score of 0.50 beats B's ≈0.33, because B's near-duplication of the already-picked A collapses its value.
- C) A — it gets re-picked a second time here, since it still holds the single highest relevance score of the three items overall.
- D) B and C tie exactly under MMR, so the ranker's original score order breaks the tie in B's favor instead.
Q3. A platform wants to guarantee "no more than 2 posts from the same creator in the top 10" and give brand-new posts a visibility boost. Where do these belong and why?
- A) In re-ranking: the per-creator cap is a set-level constraint the ranker can't enforce, and the freshness boost counters under-scoring.
- B) In the ranker's loss function as two extra penalty terms added directly, since it already scores every item.
- C) In retrieval, by fetching at most 2 items per creator and restricting candidates to only recently-published items.
- D) In the ANN index itself, by weighting creator identity and recency directly into every single item's embedding vector representation instead.
Try it interactively
ML Systems Lab is a free interview-prep platform for ML engineers — work through the full interactive module, quizzes, and drills.
Open ML Systems Lab →