ML Systems Lab Open interactive version →
Advanced 22 min read re-rankingdiversityMMRDPPfreshness

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

Takeaway

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

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.

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?

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?

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 →