Build a Diversity-Aware Re-Ranking Layer for Recommendation Results


recommendation-systems ranking model-evaluation classical-ml
View full code for this problem

ML Problem & Solution

Diversity-Aware Re-Ranking

Three objectives share one word, and they do not move in the same direction

⏱ 35 min read 📐 Advanced 🎯 Classical ML

The homepage shelf has twenty slots and a product manager who has stopped trusting it. The ranking model is the best one the team has ever shipped, offline recall is up, the online test was positive, and every slot on the shelf is the same kind of thing. A user who bought one espresso grinder sees twenty espresso grinders. The model is not broken. It is answering exactly the question it was trained on, which is “for each item independently, how likely is this user to interact with it”, and the twenty highest answers to that question are near-duplicates of each other because the question never mentioned the other nineteen slots.

This is the structural problem with ranking by a per-item score, and it is worth being precise about why no amount of model improvement fixes it. Relevance is a property of an item. Diversity is a property of a set. A model that emits one number per item has no representation in which the sentence “these twenty items are too similar to each other” can even be written down, so it cannot be penalised for it. Our measured baseline puts 77.8% of its twenty slots in a single category and covers 3.36 of eight available categories. That is not a tuning failure, it is the arg-max of the objective.

The conventional framing of the fix is a trade: accept a little less relevance in exchange for a little more variety, and argue about the exchange rate. That framing turns out to be wrong at the interesting end of the range, and discovering why is most of this post. In our measurements a modest amount of diversification raises intra-list diversity from 0.3439 to 0.4988 and raises recall@20 from 0.4207 to 0.4227 at the same time. The exchange rate is favourable because it is not an exchange: a slate that is 77.8% one category cannot reach the 28% of held-out items that sit outside the user’s primary category, so spreading the slate buys coverage of outcomes the concentrated slate was structurally missing.

The harder half of the post is that “diversity” is three different objectives wearing one word. How varied is one user’s slate; how much of the catalogue gets any exposure at all across all users; and how well a slate matches that particular user’s own taste mix. We measure all three and they move in different directions, including one method that is the best in the table on two of them and the worst on the other two.

An analogy for the whole area: a relevance model is a waiter who brings you twenty portions of the thing you ordered most often. Intra-list diversity asks for a varied plate. Aggregate diversity asks that the kitchen’s whole menu get cooked sometimes, which is the restaurant’s problem and not yours. Calibration asks that if you order fish seventy percent of the time, the plate is about seventy percent fish. Those are three different complaints and a single “make it more diverse” ticket satisfies at most one.

Formally: given a frozen relevance model producing scores s(u, i) and a retrieved candidate pool C(u) of 200 items, select a slate S(u) of 20 items maximising recall@20 on one held-out interaction per user, subject to raising ground-truth intra-list diversity above the un-diversified baseline of 0.3439, and without degrading per-user calibration.

Framing the Problem

This is a combinatorial subset selection problem layered on top of a ranking problem, which is a different object from everything in this track so far. The decision variable is a set, the objective is not a sum over items, and the search space for one user is 200 choose 20, so every method here is a greedy approximation and the interesting question is which approximation.

The relevance model is frozen, deliberately and throughout. Post 29 measured two-hop path counting at 0.4207 recall@20, tuned node2vec at 0.4207 and tuned ALS at 0.4153, so the choice among them is noise on this data. We hold one still and vary only the layer above it, because a re-ranking result that was obtained while also re-tuning the base model is uninterpretable.

Constraints:

  • The candidate pool is fixed at 200 of 1,200 items. A re-ranker reorders what retrieval returned and can never reach the other 1,000, which caps per-user catalogue coverage at 200/1200 = 0.1667. This number is almost never reported in diversity work and it bounds every result below.
  • The slate is 20 items and flat. No carousels, no pagination, no position bias beyond NDCG’s discount.
  • Re-ranking happens per request. Whatever we choose runs inside a latency budget with the user waiting, which in practice decides more deployments than either method’s quality.
  • The diversity attribute has 8 categories, so distinct-categories-per-slate is capped at min(20, 8) = 8.

The success metric is the pair (recall@20, ground-truth intra-list diversity), reported as a frontier rather than as a single number, because any single setting of any method’s knob is an arbitrary point. The guardrail metrics are NDCG@20; catalogue coverage and exposure Gini for aggregate exposure; calibration error as KL between the user’s history mix and the slate mix; and cold-user recall@20 separately, since 1,126 of 3,000 test users have 8 or fewer training interactions.

Metric That Matters

Intra-list diversity has to be measured against an attribute the relevance model has never seen. Measured in the model's own embedding space, a diversifier scores itself on how far it moved through a geometry it built, which is partly circular. Our companion codebase reports both: the same slates scored in the model's item space and against a planted category label. The two columns agree on direction here, which is the reassuring result, but only the second one can adjudicate the claim, and on a real system it has to come from an independent source such as an editorial taxonomy.

Out of scope: learning the diversity objective into the model’s own loss, which removes the layer and the pool ceiling together and is the real production direction; hierarchical or overlapping taxonomies; page-level and carousel-level diversity; and fairness-of-exposure constraints on the supply side, which share the mathematics and have a different objective.

Key Insight

Freezing the base model is what makes the experiment readable, and it is also the design that leaves value on the table. A two-stage score-then-reorder architecture can only ever shuffle what stage one retrieved, so its ceiling is set by a decision made upstream of it. Every disappointing production diversity result we have seen traces to a pool too small to contain the diversity the layer was asked to produce.

Data and Features

The graph is the one post 29 used, which keeps the relevance numbers comparable across the two posts:

3,000 users, 1,200 items, 42,519 edges, density 0.0118
8 planted categories, community purity 0.72
item degree: median 17, max 1283, top decile holds 49.75% of degree
base relevance model: two-hop path count, FROZEN at 0.4207 recall@20
candidate pool: 200 of 1,200  =>  per-user coverage ceiling 0.1667
slate k: 20, so distinct categories is capped at min(20, 8) = 8

Community purity of 0.72 is the single number that makes this post work. 28% of every user’s interactions come from outside their primary category, so 28% of held-out items do too. Hold that against the baseline slate’s max category share of 0.778 and the arithmetic is already suggestive: the relevance-optimal slate concentrates its mass in one category while roughly a quarter of the targets it is scored against are elsewhere. This is not a quirk of a generator. Any real preference distribution with a cross-category tail has the same property, and the size of that tail is the size of the free lunch available to a diversifier.

The features of a re-ranking layer are the candidate pool and the similarity matrix, and the second one is where the design decisions live.

# The candidate pool, sorted by relevance so rank 0 is the relevance-optimal
# item. The sort is not required by the re-rankers; every diagnostic that
# asks "how far down the pool did we reach" needs it.
def candidate_pool(scores, train_pairs, pool):
    s = scores.copy()
    s[train_pairs[:, 0], train_pairs[:, 1]] = -np.inf   # mask seen items
    pool = min(pool, s.shape[1])
    idx = np.argpartition(-s, kth=pool - 1, axis=1)[:, :pool]
    rows = np.arange(s.shape[0])[:, None]
    order = np.argsort(-s[rows, idx], axis=1)
    return idx[rows, order]

The two similarity spaces, and why it matters which one you pick

A diversifier needs to know that two items are similar. The convenient answer is the relevance model’s own embedding space, because it is already computed. The honest answer is an attribute sourced independently of the relevance model. These are different, and the difference is measurable.

# Two similarity spaces for the same items. The first is the relevance
# model's own opinion; the second is a label no model has seen.
def model_similarity(item_factors):
    norms = np.linalg.norm(item_factors, axis=1, keepdims=True)
    unit = item_factors / np.maximum(norms, 1e-12)
    S = unit @ unit.T
    np.clip(S, 0.0, 1.0, out=S)      # clip, do not shift: shifting
    np.fill_diagonal(S, 1.0)         # compresses the scale and moves the knee
    return S

def truth_similarity(item_comm):
    # 1.0 for items sharing a planted category, else 0.0. Available here only
    # because the graph is generated. On a real log this is an editorial
    # taxonomy, a supplier category, or a language tag.
    return (item_comm[:, None] == item_comm[None, :]).astype(np.float64)

Diversifying in each space and scoring against both:

re-ranker diversified in recall@20 ILD model (self-reported) ILD truth (real) distinct cat calib KL
none, top-k - 0.4207 0.3281 0.3439 3.36 0.540
MMR at 0.3 model space 0.4140 0.5351 0.6040 6.34 0.305
MMR at 0.3 truth space 0.4153 0.5459 0.6182 7.47 0.270

The result is not that the model-space proxy fails. It captures 0.2601 of the 0.2743 of real diversity available from using the true label, so it works and it works well. The result is that it is strictly dominated: diversifying on the independent attribute is better on every column at once, including relevance and calibration, so no trade-off is being made and there is nothing to argue about. The proxy is what you use when you have nothing else, and the measured cost of having nothing else is that whole row of simultaneous small losses.

Key Insight

Relevance has to be rescaled per user before it is traded against anything. MMR adds two terms, so their scales set the effective trade-off weight, and a raw path-count score has a per-user scale that grows with history length. Without rescaling, one global lambda diversifies heavy users aggressively and leaves light users untouched, which presents as a puzzling segment-dependent effect and is an arithmetic bug. Post 23 measured the general form of this, where an unmatched blend weight rounds to zero and a two-model ensemble silently becomes one model.

The Naive Baseline

Two baselines, and the second one is the one that keeps the rest of the post honest.

Top-k by relevance is the thing we are trying to beat, scoring 0.4207 recall@20 with an intra-list diversity of 0.3439, 3.36 distinct categories per slate and a max category share of 0.778.

Random selection from the candidate pool is the baseline that almost every published diversity table omits, and it is essential. Shuffle the 200 candidates, take 20, and measure.

# The control that matters. Any diversifier unable to beat a permutation of
# the candidate pool on the relevance-versus-diversity frontier is not doing
# anything a shuffle could not.
def random_pool_select(pool_idx, k, seed=0):
    rng = np.random.default_rng(seed)
    out = np.empty((pool_idx.shape[0], k), dtype=np.int64)
    for u in range(pool_idx.shape[0]):
        out[u] = rng.choice(pool_idx[u], size=k, replace=False)
    return out

Random selection scores a ground-truth intra-list diversity of 0.6459, which is higher than either real diversifier achieves at its default setting, at a recall@20 of 0.0883, which is 21% of the baseline. That pairing is the whole reason the row has to be in the table: diversity numbers are trivially purchasable by loosening the ranking, so a diversity result without this control cannot be distinguished from having simply ranked worse. Both MMR and the DPP clear this point by a wide margin, which is the measurement that justifies them rather than an assumption.

Key Insight

A good baseline for a diversity layer is not a weaker diversifier, it is a method that cheats: one that buys the target metric without doing the work. Random selection from the pool buys 0.6459 of intra-list diversity by discarding the ranking, and the popularity penalty buys 0.851 of catalogue coverage without ever examining a slate. Both belong in the main table, because a diversity number is only evidence of anything once the cheap ways of producing it are on the page next to it.

Common Pitfall

Reporting a diversity gain without a random-shuffle control. Our random row posts an intra-list diversity of 0.6459 against MMR's 0.4988 at its default, so on the diversity column alone the shuffle is the better method, and it costs 79% of the recall to get there. Any paper, dashboard or experiment write-up that shows diversity up and relevance down by an unstated amount is reporting a point that a random permutation may already dominate.

The Solution

A four-stage diversity-aware re-ranking pipeline. Stage one contrasts posts 21 to 29, where relevance is a property of one item so a score matrix suffices to rank and report recall at k, against post 30 where diversity is a property of a set so the slate becomes the unit of evaluation and a score matrix can no longer compute the metric, and states the problem: the relevance-optimal slate puts 77.8 percent of its 20 slots in one of 8 categories and covers only 3.36 distinct categories while community purity of 0.72 means 28 percent of held-out items lie outside the user's primary category, so the slate structurally cannot reach a quarter of what it is scored on. Stage two freezes the base model at the two-hop path count scoring 0.4207 recall@20, noting post 29 measured node2vec at 0.4207 and ALS at 0.4153 so the choice is noise, and establishes that the candidate pool of 200 of 1,200 items caps per-user coverage at 0.1667 while at pool equal to k equal 20 every re-ranker is identical to top-k at any lambda giving 0.4207 and intra-list diversity 0.3439, making it dead code, with achievable diversity growing to 0.6359 at pool 800 then reversing at the full 1,200 catalogue to 0.5882 diversity and 0.3683 recall because a pool of everything contains items with no relevance. Stage three presents three diversifiers: MMR from 1998 using one minus lambda times relevance minus lambda times the MAX similarity, greedy, using the max because already having seen an item is the redundancy a user notices; the DPP greedy MAP from 2018 with kernel L equals diag q times S times diag q where q is exp of theta times relevance, the determinant being a squared volume so it detects collective redundancy; and calibration from 2018 using one minus lambda times relevance minus lambda times the KL divergence between user and slate mixes, which matches the user's own mix rather than maximising spread since a ninety percent one-category user wants that. It then shows the similarity-space comparison where diversifying in model space gives ground-truth intra-list diversity 0.6040, 6.34 distinct categories, recall 0.4140 and calibration KL 0.305, while diversifying in truth space gives 0.6182, 7.47, 0.4153 and 0.270, so the proxy is not illusory since it captures 0.2601 of the 0.2743 available but is strictly dominated, better on all four columns at once. Stage four gives the results table where top-k with no re-rank scores recall@20 0.4207, NDCG@20 0.2365, ground-truth intra-list diversity 0.3439, 3.36 distinct categories, max category share 0.778, coverage 0.373, Gini 0.867, calibration KL 0.540 and cold recall 0.4636; MMR at lambda 0.2 scores 0.4227, 0.2359, 0.4988, 5.13, 0.673, 0.333, 0.896, 0.358 and 0.4671; the DPP at theta 8.0 scores 0.4143, 0.2350, 0.5574, 5.30, 0.619, 0.383, 0.906, 0.366 and 0.4574; calibrated at lambda 0.5 scores 0.4190, 0.2348, 0.4057, 4.10, 0.745, 0.362, 0.876, 0.146 and 0.4618; the popularity penalty at beta 0.15 scores 0.3710, 0.2109, 0.0709, 1.44, 0.956, 0.851, 0.734, 1.044 and 0.4139; and random from pool scores 0.0883, 0.0310, 0.6459, 5.62, 0.547, 0.983, 0.464, 0.442 and 0.0773. Four results follow: first, a modest amount of diversity is better than free since MMR at lambda 0.2 beats the baseline on both recall and cold recall while raising diversity 0.3439 to 0.4988 and categories 3.36 to 5.13; second, the best row on an aggregate dashboard is the worst slate, since the popularity penalty is best on coverage by plus 0.477 and Gini by minus 0.133 and worst on intra-list diversity by minus 0.2730, calibration by plus 0.504 and max category share by plus 0.178 to 0.956, with slates only 1.44 categories wide, because inside a top-N pool popularity correlates with category diversity as popular items are popular across categories while a user's rare items are the deep tail of their own category; third, random from pool reaches 0.6459 diversity above both real diversifiers at 21 percent of baseline recall so without that control a diversity number cannot be told from loosened ranking; and fourth, MMR raises intra-list diversity while lowering catalogue coverage from 0.373 to 0.333 and the DPP raises spread by 0.5401 while degrading calibration by 0.400, so three objectives share one word and move in three directions

Three methods, which answer three different questions, and one control that looks like a fourth method and is not.

Maximal Marginal Relevance

MMR (Carbonell and Goldstein, SIGIR 1998) is the oldest and still the most widely deployed diversifier. Build the slate greedily; at each step pick the candidate maximising

(1 - lambda) * relevance(i) - lambda * max_{j in chosen} sim(i, j)

The analogy: hiring a panel where each new candidate is scored on their own merit minus how much they resemble the single person already on the panel they most resemble. The max rather than the mean is the detail that makes it work, and it encodes a claim about users: the redundancy a person actually notices is “I have already seen this one”, not “this is vaguely like the average of what I have seen”.

# Greedy MMR, vectorised across users and looped over slate positions. That
# is the right way round: k is 20 and n_users is 3,000.
def mmr_select(scores, pool_idx, sim, k, lam):
    n_users, pool = pool_idx.shape
    rows = np.arange(n_users)[:, None]
    rel = _normalise_rows(scores[rows, pool_idx])      # per-user [0, 1]
    if lam <= 0.0:
        return pool_idx[:, :k]

    chosen = np.zeros((n_users, k), dtype=np.int64)
    max_sim = np.zeros((n_users, pool))
    taken = np.zeros((n_users, pool), dtype=bool)
    for step in range(k):
        obj = (1.0 - lam) * rel - lam * max_sim
        obj[taken] = -np.inf
        pick = np.argmax(obj, axis=1)
        taken[np.arange(n_users), pick] = True
        picked_items = pool_idx[np.arange(n_users), pick]
        chosen[:, step] = picked_items
        new_sim = sim[picked_items][np.arange(n_users)[:, None], pool_idx]
        np.maximum(max_sim, new_sim, out=max_sim)       # running max
    return chosen

Determinantal point processes

A DPP is the principled version of what MMR approximates. Build a kernel over the candidate pool, L = diag(q) S diag(q) with q_i = exp(theta * rel_i), and the probability of a subset is proportional to det(L_Y). A determinant is a squared volume, so a set of mutually similar items spans little volume and is improbable. Relevance enters as a per-item scaling and diversity as the geometry, and one determinant balances them with no additive terms to rescale.

The analogy against MMR: MMR penalises each new hire against the most similar person already on the panel. A DPP scores the whole panel by the volume its members span, so it notices that three people can each be pairwise tolerable and still collectively redundant.

Exact MAP is NP-hard, so we use the fast greedy algorithm of Chen, Zhang and Zhou (NeurIPS 2018), which maintains an incremental Cholesky factorisation. At each step the marginal gain of item i is d_i^2, and selecting j applies one rank-one correction to every other d_i^2. That is O(pool) per step instead of recomputing determinants, and because it is a Cholesky it fails honestly: if the kernel loses positive-definiteness, d_i^2 goes negative and we can stop rather than return nonsense.

# Greedy DPP MAP, per user, with incremental Cholesky updates.
def dpp_select(scores, pool_idx, sim, k, theta, eps=1e-10):
    n_users, pool = pool_idx.shape
    rows = np.arange(n_users)[:, None]
    rel = _normalise_rows(scores[rows, pool_idx])
    q = np.exp(theta * rel)

    out = np.empty((n_users, k), dtype=np.int64)
    for u in range(n_users):
        idx = pool_idx[u]
        S = sim[np.ix_(idx, idx)]
        L = (q[u][:, None] * S) * q[u][None, :]
        di2 = np.diag(L).astype(np.float64).copy()
        c = np.zeros((k, pool))
        selected, mask = [], np.ones(pool, dtype=bool)
        for t in range(k):
            j = int(np.argmax(np.where(mask, di2, -np.inf)))
            if di2[j] <= eps:                 # kernel exhausted, fail loudly
                break
            selected.append(j)
            mask[j] = False
            dj = float(np.sqrt(di2[j]))
            e = (L[j, :] / dj) if t == 0 else (
                (L[j, :] - c[:t, j] @ c[:t, :]) / dj)
            c[t, :] = e
            di2 = di2 - e ** 2
            di2[j] = -np.inf
        out[u] = idx[np.array(selected[:k])]
    return out

Calibration, which wants a different slate entirely

MMR and the DPP maximise spread, which pushes every user toward a slate covering many categories. Calibrated recommendation (Steck, RecSys 2018) asks something different: that the slate’s category mix match the user’s own history mix. A user whose history is 90% one category should get a slate that is about 90% that category, and handing them an evenly spread slate is a failure rather than a success.

# Greedy maximisation of relevance minus KL(user mix || slate mix). The
# objective is submodular in the slate, so greedy is within 1 - 1/e of
# optimal, which is a better guarantee than anything MMR offers.
def calibrated_select(scores, pool_idx, item_comm, user_mix, k, lam,
                      n_comm, smoothing=0.01):
    n_users, pool = pool_idx.shape
    rows = np.arange(n_users)[:, None]
    rel = _normalise_rows(scores[rows, pool_idx])
    pool_comm = item_comm[pool_idx]
    chosen = np.zeros((n_users, k), dtype=np.int64)
    counts = np.zeros((n_users, n_comm))
    taken = np.zeros((n_users, pool), dtype=bool)
    eye = np.eye(n_comm)
    for step in range(k):
        trial = counts[:, None, :] + eye[pool_comm] + smoothing
        trial = trial / trial.sum(axis=2, keepdims=True)
        p = user_mix[:, None, :]
        kl = np.sum(p * (np.log(p) - np.log(trial)), axis=2)
        obj = (1.0 - lam) * rel - lam * kl
        obj[taken] = -np.inf
        pick = np.argmax(obj, axis=1)
        taken[np.arange(n_users), pick] = True
        chosen[:, step] = pool_idx[np.arange(n_users), pick]
        counts[np.arange(n_users), pool_comm[np.arange(n_users), pick]] += 1.0
    return chosen

The popularity penalty, which is the control

Subtract beta * log1p(degree) from each score and take the top k. This is in the codebase because it is not a diversity method and it is essential to include one that is not. It never looks at what else is in the slate, so it cannot control any set property, and it improves every aggregate exposure metric on any dashboard. The results section is where that matters.

The hyperparameters, with the rule that set them. MMR’s lambda is 0.2, chosen by an explicit rule rather than by taste: the largest lambda whose recall is not below the un-diversified baseline. The DPP’s theta is 8.0, the cheap end of its frontier and roughly comparable to MMR’s default. Calibration’s lambda is 0.5. The candidate pool is 200, which the scaling section revisits.

Key Insight

The design decision that mattered most was setting MMR's lambda by a stated rule instead of by inspection. Our first sweep ran lambda over 0.3 to 0.9, every value cost relevance, and the conclusion wrote itself as a conventional trade-off with an exchange rate. Extending the grid downward found that 0.10 and 0.20 are both above the baseline on recall, which inverts the entire framing of the section. A sweep that begins at its boundary cannot discover that the quantity it is trading is not actually a trade.

Evaluation and Metrics

The unit of evaluation is a slate, which means every metric takes an (n_users, k) array of item indices rather than a score matrix. That is the central mechanical difference between this post and the previous nine, and it is what makes intra-list diversity expressible at all.

Four families, because they answer four questions:

# Relevance from a slate: the held-out item's position in the slate, or absent.
def relevance_metrics(slate, test_pairs, k_values=(10, 20)):
    k_max = slate.shape[1]
    test_u, test_i = test_pairs[:, 0], test_pairs[:, 1]
    rows = slate[test_u]
    hit_mask = rows == test_i[:, None]
    found = hit_mask.any(axis=1)
    rank = np.where(found, hit_mask.argmax(axis=1), k_max) + 1
    out = {}
    for k in k_values:
        hit = found & (rank <= k)
        out[f"recall@{k}"] = float(hit.mean())
        out[f"ndcg@{k}"] = float(
            np.where(hit, 1.0 / np.log2(rank + 1.0), 0.0).mean())
    return out

# Intra-list diversity: 1 minus mean pairwise similarity within each slate.
# The max is returned too, because the mean hides the failure a user notices:
# one near-duplicate pair barely moves a mean over 190 pairs.
def intra_list_diversity(slate, sim):
    k = slate.shape[1]
    iu = np.triu_indices(k, k=1)
    means = np.empty(slate.shape[0])
    maxes = np.empty(slate.shape[0])
    for u in range(slate.shape[0]):
        vals = sim[np.ix_(slate[u], slate[u])][iu]
        means[u], maxes[u] = vals.mean(), vals.max()
    return {"ild": float(1.0 - means.mean()),
            "mean_max_pairwise_sim": float(maxes.mean())}

# Calibration: KL(user history mix || slate mix). Lower is better.
def calibration_error(slate, item_comm, user_mix, n_comm, smoothing=0.01):
    n_users, k = slate.shape
    comm = item_comm[slate]
    counts = np.full((n_users, n_comm), smoothing)
    np.add.at(counts, (np.repeat(np.arange(n_users), k), comm.reshape(-1)), 1.0)
    qmix = counts / counts.sum(axis=1, keepdims=True)
    kl = np.sum(user_mix * (np.log(user_mix) - np.log(qmix)), axis=1)
    return {"calibration_kl": float(kl.mean())}

The headline comparison. ILD truth is against the planted category label; calib KL, gini and max cat are lower-is-better; everything else is higher-is-better:

re-ranker recall@20 NDCG@20 ILD model ILD truth distinct cat max cat coverage gini calib KL cold recall@20
top-k, no re-rank 0.4207 0.2365 0.3281 0.3439 3.36 0.778 0.373 0.867 0.540 0.4636
MMR at 0.2 0.4227 0.2359 0.4501 0.4988 5.13 0.673 0.333 0.896 0.358 0.4671
DPP at 8.0 0.4143 0.2350 0.4996 0.5574 5.30 0.619 0.383 0.906 0.366 0.4574
calibrated at 0.5 0.4190 0.2348 0.3797 0.4057 4.10 0.745 0.362 0.876 0.146 0.4618
popularity penalty 0.3710 0.2109 0.1313 0.0709 1.44 0.956 0.851 0.734 1.044 0.4139
random from pool 0.0883 0.0310 0.6048 0.6459 5.62 0.547 0.983 0.464 0.442 0.0773

Three things in that table are worth stating as results.

MMR at lambda 0.2 is better than the baseline on relevance and diversity simultaneously. recall@20 goes 0.4207 to 0.4227, cold-user recall@20 goes 0.4636 to 0.4671, ground-truth intra-list diversity goes 0.3439 to 0.4988, and distinct categories per slate goes 3.36 to 5.13. NDCG@20 is the single exception, slipping 0.2365 to 0.2359, which says the diversified slate contains the right item slightly more often and places it marginally lower.

The popularity penalty is best in the table on both aggregate metrics and worst on both slate-level ones. Coverage 0.373 to 0.851 and Gini 0.867 to 0.734, while ground-truth intra-list diversity collapses 0.3439 to 0.0709 and distinct categories per slate falls to 1.44. Its slates are nearly single-category.

Random from the pool beats both real diversifiers on the diversity column. 0.6459 against MMR’s 0.4988 and the DPP’s 0.5574, at 21% of the baseline recall.

The frontier, which is the only honest comparison

A single parameter setting per method is not a comparison, because each method’s knob has its own arbitrary scale. The frontier is:

method param recall@20 NDCG@20 ILD truth distinct cat coverage calib KL
MMR 0.00 0.4207 0.2365 0.3439 3.36 0.373 0.540
MMR 0.10 0.4257 0.2376 0.4097 4.07 0.361 0.440
MMR 0.20 0.4227 0.2359 0.4988 5.13 0.333 0.358
MMR 0.30 0.4140 0.2321 0.6040 6.34 0.304 0.305
MMR 0.50 0.3887 0.2153 0.7929 7.98 0.308 0.445
MMR 0.70 0.3473 0.1937 0.8627 7.98 0.450 0.715
MMR 0.90 0.2477 0.1571 0.8622 7.98 0.750 1.047
DPP 8.00 0.4143 0.2350 0.5574 5.30 0.383 0.366
DPP 4.00 0.3880 0.2248 0.7675 7.15 0.323 0.447
DPP 2.00 0.3247 0.2018 0.8840 7.98 0.302 0.940
DPP 1.00 0.2810 0.1867 0.8900 7.98 0.376 1.310
DPP 0.25 0.2617 0.1764 0.8914 7.98 0.523 1.389
random - 0.0883 0.0310 0.6459 5.62 0.983 0.442

Matching on relevance rather than on parameter: at recall near 0.414, MMR reaches an ILD of 0.6040 while the DPP reaches 0.5574. At recall near 0.388, MMR reaches 0.7929 against the DPP’s 0.7675. MMR is above the DPP at every matched point measured here, which is the reverse of what the determinant formulation’s elegance suggests. The plausible reason is that a max over pairs penalises exactly what a user notices, a visible near-duplicate, while a determinant optimises a volume nobody perceives directly.

Key Insight

Catalogue coverage is U-shaped in lambda: 0.373, 0.361, 0.333, 0.304, 0.308, 0.450, 0.750. It falls while MMR is still relevance-led and rises only once lambda is large enough that relevance has stopped mattering. The mechanism is that MMR rewards items dissimilar to the rest of a slate, those are the cross-category bridge items, and the bridge items are the same items for every user. So each slate becomes more varied while the union of all slates becomes narrower. An objective defined per-slate has no mechanism to control a property defined across slates, and the sign of the induced effect is not predictable from the objective.

Metric That Matters

The metric that would catch a silent regression here is per-user calibration KL, and it is the one most likely to be missing. The DPP at theta 2.0 improves intra-list diversity by 0.5401 and degrades calibration by 0.400 on the same slates, because spreading a slate evenly across eight categories is precisely wrong for a user whose history is concentrated in one. A dashboard carrying intra-list diversity and recall would show that configuration as a clear win. The users whose taste is narrowest are exactly the ones it hurts, and they are invisible in a mean over all users unless calibration is reported.

Common Pitfalls and Failure Modes

Five diversity traps with the number each cost, three of them a metric disagreeing with another metric. Trap one is a sweep that starts at its boundary, costing the post's conclusion: the first lambda grid was 0.3, 0.5, 0.7, 0.9, every value cost relevance and the draft conclusion was that diversity costs accuracy, but extending downward gives lambda 0.00 at recall@20 0.4207, NDCG 0.2365, ground-truth intra-list diversity 0.3439, 3.36 distinct categories, coverage 0.373 and calibration KL 0.540 as baseline, lambda 0.10 at 0.4257, 0.2376, 0.4097, 4.07, 0.361 and 0.440 which is better on every column, lambda 0.20 at 0.4227, 0.2359, 0.4988, 5.13, 0.333 and 0.358 still above baseline recall, lambda 0.30 at 0.4140, 0.2321, 0.6040, 6.34, 0.304 and 0.305 as the first value that costs, and lambda 0.90 at 0.2477, 0.1571, 0.8622, 7.98, 0.750 and 1.047, so a sweep starting at its boundary cannot discover that the quantity it trades is not a trade, and recall and NDCG disagree about where free ends by one grid point. Trap two is one word covering three objectives moving in three directions, costing the shipping of the opposite: as deltas against top-k, MMR at lambda 0.3 gives minus 0.0067 recall, plus 0.2600 intra-list diversity, minus 0.069 coverage, plus 0.048 Gini, minus 0.235 calibration KL and minus 0.183 max category share; the DPP at theta 2.0 gives minus 0.0960, plus 0.5401, minus 0.071, plus 0.103, plus 0.400 and minus 0.549; calibrated at lambda 0.5 gives minus 0.0017, plus 0.0617, minus 0.012, plus 0.009, minus 0.394 and minus 0.033; the popularity penalty at beta 0.15 gives minus 0.0497, minus 0.2730, plus 0.477, minus 0.133, plus 0.504 and plus 0.178; and random from pool gives minus 0.3323, plus 0.3020, plus 0.609, minus 0.403, minus 0.098 and minus 0.231, so the popularity penalty is best on coverage and Gini and worst on intra-list and calibration, meaning a dashboard carrying only coverage and Gini would rank it the best diversifier, while the DPP raises spread by 0.5401 and degrades calibration by 0.400 on the same slates. Trap three is that an objective defined per slate cannot control a property defined across slates, costing minus 0.069 of coverage: MMR raises intra-list diversity and lowers catalogue coverage, and the coverage curve across lambda 0.00, 0.10, 0.20, 0.30, 0.50, 0.70 and 0.90 is U-shaped at 0.373, 0.361, 0.333, 0.304, 0.308, 0.450 and 0.750, because MMR rewards items dissimilar to the rest of a slate which are the cross-category bridge items, and those are the same items for every user, so each slate gets more varied while the union gets narrower, with coverage rising again only once lambda is large enough that relevance stops mattering. Trap four is comparing two diversifiers at one setting each, costing the wrong winner: at the defaults the DPP at theta 8.0 reaches intra-list diversity 0.5574 against MMR at lambda 0.2's 0.4988 so the DPP looked stronger, but theta and lambda are not comparable, and matching on relevance instead gives at recall about 0.414 MMR reaching 0.6040 at lambda 0.30 against the DPP's 0.5574 at theta 8 so MMR wins by 0.0466, and at recall about 0.388 MMR reaching 0.7929 at lambda 0.50 against the DPP's 0.7675 at theta 4 so MMR wins by 0.0254, meaning MMR is above the DPP at every matched point measured, because a determinant describes set redundancy better but a max over pairs is the better recommender objective since users notice near-duplicates and not slate volume. Trap five is a candidate pool the size of the slate, costing the whole layer silently: all rows at the shipped lambda of 0.2: at pool 20 the coverage ceiling is 0.0167 and top-k and MMR both give recall 0.4207 and diversity 0.3439 with 3.36 categories and 0.373 coverage making MMR a no-op at any lambda, at pool 50 the ceiling is 0.0417 with MMR at 0.4223 and 0.4602, at pool 200 the ceiling is 0.1667 with MMR at 0.4227 and 0.4988 which is the headline table's row, at pool 800 the ceiling is 0.6667 with MMR at 0.4207 and 0.5207 which is the best diversity, and at pool 1200 the ceiling is 1.0000 but MMR reverses to 0.3800 recall and 0.4615 diversity, while top-k recall stays flat at 0.4207 by construction since the top 20 of a larger pool is the same top 20, so a retrieval stage tuned to return exactly the slate length makes the layer dead code that still spends latency and no metric reports it as absent only as ineffective, and MMR coverage FALLS monotonically from 0.373 to 0.323 while the ceiling rises to 0.6667 so the pool was never the binding constraint on aggregate coverage, the bridge-item concentration was
Pitfall Why It Happens How to Detect How to Fix
Sweeping the trade-off parameter from a non-zero start The method is framed as a trade-off, so a grid of trade-offs feels right Check whether the grid includes 0 and whether the argmax is interior; ours selected its boundary Always include 0 and extend downward. Lambda 0.10 and 0.20 are both above baseline recall here
Treating diversity as one number The word is one word, and dashboards have limited columns Report intra-list, aggregate and calibration together; our methods move them in opposite directions Name which of the three is the goal before choosing a method
Shipping a popularity penalty as a diversity feature It improves coverage and Gini immediately and is one line Look at distinct categories per slate; ours fell from 3.36 to 1.44 Use it for aggregate exposure only, and never report it as intra-list diversity
Measuring diversity in the relevance model’s own space The embeddings are already there and need no new data source Compare against an independently sourced attribute Source a taxonomy. The proxy is dominated on all four metrics, not just the self-reported one
Comparing two diversifiers at one setting each Each method has a default and defaults look comparable Plot the frontier; our DPP wins at defaults and loses at every matched relevance Compare frontiers, matching on relevance rather than on parameter value
A candidate pool near the slate length Retrieval is tuned separately, often to return just enough Check pool against k; at pool equal to k the layer is a no-op at any lambda Size the pool for the diversity you want. Ours peaks at 800 and reverses at the full catalogue
Not rescaling relevance per user before the trade-off Scores look like scores and the trade-off looks dimensionless Diversity effects that vary with user history length Normalise each user’s candidate relevance to [0, 1] first
Reporting diversity without a random-shuffle control The shuffle feels too trivial to include Compare against random selection from the pool: ours gets ILD 0.6459 at 21% of baseline recall Put the random row in the main table, not an appendix

The third row is the one we would warn a team about first, because it is the cheapest to ship and the most confidently wrong. Measured as deltas against top-k, the popularity penalty improves coverage by 0.477 and Gini by 0.133, and degrades ground-truth intra-list diversity by 0.2730, calibration by 0.504, and max category share by 0.178 to a final 0.956. The mechanism is counter-intuitive and general: within a top-N candidate pool, popularity is positively correlated with category diversity, because the popular items are the ones popular across categories while the rare items in a given user’s pool are the deep-tail items of that user’s own category. Penalising popularity therefore strips out precisely the cross-category items.

Key Insight

Six of these eight pitfalls are a metric disagreeing with another metric rather than a bug in any method, which is unusual and is what makes this problem area so easy to get wrong in good faith. Every method in our table is correct, every number is reproducible, and a team could ship any one of them while believing it had improved diversity. The defence is not better code, it is reporting intra-list, aggregate and calibration together in one call, so that no table can quietly omit the column that reverses the conclusion.

Common Pitfall

The single most common mistake on this exact problem is shipping a popularity penalty, watching catalogue coverage rise from 0.373 to 0.851 and exposure Gini fall from 0.867 to 0.734, and reporting that diversity has improved. On the same slates, categories per slate fell from 3.36 to 1.44 and the max single-category share rose to 0.956, so what the user sees became dramatically less varied while every aggregate number improved. The two families of metric are not two views of one quantity, and a method optimising neither can move them in opposite directions at once.

Scaling and Productionizing

The arithmetic that decides a re-ranking deployment is latency per request, not training cost. There is no training here at all; the layer runs with the user waiting.

back of envelope, per request, slate k = 20
  MMR, pool 200     k * pool similarity lookups      ~4,000 lookups, <1 ms compiled
  MMR, pool 1000    k * pool                         ~20,000 lookups, ~2 ms
  DPP, pool 200     k * pool rank-one updates        ~4,000 flops * 20, ~3 ms compiled
  DPP, pool 1000    kernel build is pool^2           1e6 entries, ~15 ms, usually too slow
  calibration       k * pool * n_categories          4,000 * 8 = 32,000, ~2 ms

The DPP’s kernel build is quadratic in the pool, which is the practical reason MMR is deployed more often regardless of either method’s frontier. At a pool of 1,000 the kernel is a million entries built per request, and a system with a 10 millisecond re-ranking budget cannot afford it, so the choice is usually made by the latency budget before quality enters the discussion.

The candidate pool is the parameter that matters most and it is owned by a different team than the one tuning lambda:

pool coverage ceiling top-k recall@20 MMR recall@20 MMR ILD truth MMR distinct cat MMR coverage
20 0.0167 0.4207 0.4207 0.3439 3.36 0.373
50 0.0417 0.4207 0.4223 0.4602 4.69 0.348
100 0.0833 0.4207 0.4217 0.4793 4.91 0.343
200 0.1667 0.4207 0.4227 0.4988 5.13 0.333
400 0.3333 0.4207 0.4217 0.5110 5.27 0.328
800 0.6667 0.4207 0.4207 0.5207 5.39 0.323
1200 1.0000 0.4207 0.3800 0.4615 4.75 0.340

All rows are at the shipped lambda = 0.2, so the pool 200 row is the headline table’s MMR row.

At pool 20 the re-ranker is identical to top-k in every column at any lambda, because there is nothing to reorder. That is obvious once stated and it is a real production failure mode: a retrieval stage tuned to return exactly the slate length turns the re-ranking layer into dead code that still consumes latency, and no metric reports it as absent, only as ineffective. At the other end, the full catalogue is worse than a pool of 800 on both axes, losing 0.0407 of recall and 0.0592 of diversity, because a pool containing everything includes items with no relevance at all and MMR will cheerfully select them. Note also that MMR’s catalogue coverage falls monotonically from 0.373 to 0.323 as the ceiling rises from 0.0167 to 0.6667, which says the pool was never the binding constraint on aggregate coverage. The bridge-item concentration described above was.

Retraining cadence does not apply, since there is nothing to train, but the similarity matrix and the category mapping both drift and they are the assets that need a refresh schedule. A taxonomy that gains a category, or an item recategorised by a merchandiser, silently changes every slate.

The monitoring signal that catches this layer degrading silently is distinct categories per slate, tracked daily at a fixed percentile of user history length, alongside calibration KL. Catalogue coverage is the signal most teams have, and our popularity-penalty row is the demonstration that coverage can improve while the user-visible property collapses. Segmenting by history length matters because calibration regressions concentrate in narrow-taste users, who are invisible in a pooled mean.

Key Insight

A re-ranking layer's ceiling is set upstream of it, which makes it an organisational problem as much as a modelling one. The pool size is usually owned by the retrieval team and tuned for recall, the lambda is owned by the ranking team and tuned for diversity, and neither team's metric shows that a pool of 20 makes the second team's work a no-op. Before tuning a diversifier, measure what happens at your actual production pool size.

Real World

Netflix's work on calibrated recommendations (Steck, RecSys 2018) is the source of the calibration objective here, and its framing is the part worth borrowing: the paper's argument is that a user who watches 70% drama and 30% comedy should receive roughly that mix, and that conventional accuracy metrics actively reward amplifying the dominant genre to 100%. Spotify's work on podcast and music sequencing attacks the same problem at the slate level, and YouTube's 2019 multi-objective ranking paper (Zhao et al., RecSys 2019) takes the other architectural branch this post declines: rather than re-ranking a frozen score, it trains a multi-gate mixture-of-experts over several objectives at once and applies a shallow tower for position bias, which removes the two-stage ceiling entirely.

Alternative Approaches

approach relevance cost at matched diversity which diversity it improves serving cost tunability best fit
Top-k, no re-ranking baseline 0.4207 none; 3.36 categories, 0.778 max share zero nothing to tune when the catalogue is naturally varied
MMR best measured, ILD 0.6040 at recall 0.4140 intra-list; aggregate gets worse one max per candidate per slot one interpretable lambda the default choice, and the one to deploy first
DPP greedy MAP ILD 0.5574 at recall 0.4143 intra-list, most aggressively kernel is quadratic in pool theta, with an opaque scale when collective rather than pairwise redundancy is the complaint
Calibrated re-ranking ILD 0.4057 at recall 0.4190 calibration, by 0.394 k times pool times categories one lambda, needs a taxonomy when narrow-taste users are the ones complaining
Popularity penalty 0.3710, and ILD falls 0.2730 aggregate only, coverage +0.477 one subtraction one beta supply-side exposure goals, never user-facing variety
Random from pool 0.0883 intra-list, 0.6459 trivial nothing a control, never a system
Multi-objective in the loss not measured here all three, jointly model-dependent many weights production, when the two-stage ceiling binds

We would ship MMR at lambda 0.2 on this data. It is the only configuration in the table that improves relevance, cold-user relevance and ground-truth diversity at once, its single parameter has an interpretable scale, it costs under a millisecond, and it dominates the DPP at every matched relevance level we measured. The DPP is the better formulation and the worse product decision here, which is a combination worth being comfortable with.

The point at which we would switch is specific. If the complaint coming back from users is “this does not feel like me” rather than “these are all the same”, the objective is calibration and MMR is the wrong tool: calibration improved calibration KL by 0.394 against the shipped MMR’s 0.182 while touching relevance by only 0.0017. If the goal is supply-side, getting exposure for long-tail inventory, then neither is right and a popularity or exposure-fairness term is, with the explicit understanding that it will make individual slates less varied. And if the two-stage ceiling binds, which it does as soon as the pool cannot be enlarged, the answer is to put the objectives into the model’s loss and delete the layer.

Key Insight

Choose the method by naming the complaint first. "These are all the same" is intra-list and wants MMR. "This does not feel like me" is calibration and wants a KL term. "Our long-tail suppliers get no traffic" is aggregate exposure and wants neither, because both diversifiers measurably reduced catalogue coverage here. The methods are not interchangeable implementations of one idea, and the table above shows each one being the worst available choice for one of the three goals.

Key Takeaways

  • Diversity is three objectives sharing one word. Intra-list, aggregate and calibration moved in different directions for every method we measured. Name which one is the goal before picking a method, because each method in our table is the worst available option for one of the three.

  • A modest amount of diversity is better than free. MMR at lambda 0.2 improved recall@20 from 0.4207 to 0.4227 and cold-user recall from 0.4636 to 0.4671 while raising intra-list diversity from 0.3439 to 0.4988. The reason is structural: with community purity of 0.72, a slate concentrating 77.8% of its slots in one category cannot reach 28% of its targets.

  • Sweep the trade-off parameter down to zero. Our first grid started at 0.3, every point cost relevance, and the draft concluded that diversity trades against accuracy. The two points below 0.3 reverse that framing entirely.

  • A popularity penalty is not a diversity method. It was our best row on coverage (+0.477) and Gini (-0.133) and our worst on intra-list diversity (-0.2730) and calibration (+0.504), taking categories per slate down to 1.44. Inside a top-N pool, popularity correlates positively with category variety.

  • An objective defined per-slate cannot control a property across slates. MMR raised intra-list diversity and lowered catalogue coverage from 0.373 to 0.333, because the items that are dissimilar to everything are the same bridge items for every user. Coverage is U-shaped in lambda.

  • Compare diversifiers by frontier, never at one setting each. The DPP beat MMR at the defaults and lost at every matched relevance level: 0.5574 against 0.6040 at recall near 0.414, and 0.7675 against 0.7929 at recall near 0.388.

  • The candidate pool is the real parameter and someone else owns it. At pool equal to the slate length every re-ranker is a no-op at any lambda. Our diversity peaked at pool 800 and reversed at the full catalogue.

  • Measure diversity against an attribute the relevance model never saw. Diversifying in the model’s own space is not illusory, capturing 0.2601 of the 0.2743 available, but it is dominated on all four metrics at once by using an independently sourced label.

The counter-intuitive lesson is about where the win came from. We expected to be writing about an exchange rate, and the interesting result turned out to be that the first slice of diversification is a pure correction rather than a concession: the relevance model was over-concentrated relative to the true preference distribution, and a diversity term is one of the few available ways to fix a mis-specified objective from outside the model. Which means that in the regime that matters most, a “diversity” layer is not trading accuracy for user experience at all. It is buying both, and the reason it looks like a trade in most published tables is that nobody swept the parameter low enough to see the other side.

Frequently Asked Questions

Q: Why not just use the DPP, since it is the principled formulation?

A: Because on this data it lost, and twice over. On the frontier it is below MMR at every matched relevance level we measured: an ILD of 0.5574 against 0.6040 at recall near 0.414, and 0.7675 against 0.7929 at recall near 0.388. And its kernel build is quadratic in the candidate pool, so at a pool of 1,000 it is roughly 15 milliseconds per request against MMR’s 2, which exceeds most re-ranking budgets. The determinant is a better description of set redundancy than a max over pairs, and the max over pairs is the better recommender objective here, plausibly because a visible near-duplicate is what a user actually reacts to.

Q: Why not put the diversity objective in the model’s loss instead of adding a layer?

A: That is the right answer in production and it is out of scope here for a reason worth stating. A two-stage architecture has a ceiling set by the candidate pool, which our pool table quantifies, and a model trained with a slate-level objective does not. What the layer buys is debuggability: the base model is frozen, so every number in this post attributes cleanly to the re-ranking decision, and a diversity regression can be rolled back without retraining. We would build the layer first, learn which of the three diversities the product actually wants, and only then pay for the multi-objective model, because getting that objective wrong is far more expensive than getting a lambda wrong.

Q: Why not just increase the candidate pool, since that is the binding constraint?

A: Partly yes, and it has a measured limit. Diversity improved up to a pool of 800 (ILD 0.6359) and then reversed at the full catalogue of 1,200, where recall fell to 0.3683 and ILD to 0.5882, because a pool containing everything includes items with no relevance at all. The pool also costs retrieval latency and scoring, so it is not free. The useful framing is that the pool sets what the layer could achieve and lambda sets what it does achieve, and tuning the second without measuring the first is how a layer ends up a no-op.

Q: Why is intra-list diversity the headline rather than catalogue coverage?

A: Because they are different objectives and intra-list is the one a user experiences. Our popularity-penalty row makes the case: it has the best coverage in the table at 0.851 and categories per slate of 1.44, so the catalogue is being explored and every individual user is seeing one kind of thing. Coverage is a supply-side and marketplace-health metric and it is a perfectly good goal, but it is not the goal that motivates the complaint this post opens with. Both are reported, and reporting only one is how the two get confused.

Q: How do you keep this from degrading silently in production?

A: Track distinct categories per slate at a fixed percentile of user history length, daily, alongside calibration KL, and treat catalogue coverage as a separate goal with its own target rather than as a proxy for either. The failure to design against is the popularity-penalty shape: a change that improves coverage and Gini while collapsing what any individual user sees. Segment by history length, because calibration regressions concentrate in narrow-taste users and vanish in a pooled mean. The similarity matrix and the category mapping are the drifting assets here, not a model, so they need an explicit refresh schedule and a diff alert when a taxonomy changes.

Q: The free-diversity result is only 0.0020 of recall. Is that real?

A: The magnitude is not the claim and should not be quoted as one. With one held-out item per user, 0.0020 on 3,000 users is 6 users changing outcome, which is well inside the noise of a single split. What is reproducible is the pattern across the sweep: lambda 0.10 and 0.20 are both at or above the baseline, 0.30 onward are all below it, and the decline is monotone from 0.10 onward. The mechanism also predicts it independently, since community purity of 0.72 and a max category share of 0.778 together imply the concentrated slate is missing reachable targets. A production claim would need multiple held-out items per user and across-seed spread, which post 28 made the case for.

Interview Questions

Q: Your ranking model has excellent offline recall and the homepage shelf shows twenty near-identical items. Explain why this is not a model quality problem, and what you would change.

Expected depth: the candidate should identify that relevance is a per-item property and diversity is a set property, so a model emitting one score per item has no representation in which slate redundancy can be penalised. The arg-max of a per-item objective over a correlated catalogue is a redundant set by construction. Strong answers then separate the two architectural responses, a re-ranking layer over a frozen score against a slate-level objective in the loss, and note the re-ranker’s ceiling is the candidate pool. The best answers raise that mild diversification may not cost relevance at all, if the relevance model is over-concentrated relative to the true preference distribution.

Q: Derive MMR and explain why it uses the maximum similarity to the selected set rather than the mean.

Expected depth: the greedy objective (1 - lambda) times relevance minus lambda times max similarity over the chosen set, and the observation that it is a submodular-flavoured greedy selection without MMR itself being submodular. On the max against mean question: the max penalises a candidate that duplicates any single selected item, which matches the redundancy a user perceives (“I have already seen this”), while a mean over 190 pairs is insensitive to one near-duplicate in an otherwise varied slate. Candidates should also raise that the two terms are added, so relevance must be rescaled per user or lambda means different things for users with different history lengths.

Q: A colleague ships a popularity penalty, reports catalogue coverage up from 0.37 to 0.85 and exposure Gini down from 0.87 to 0.73, and calls it a diversity win. What do you say?

Expected depth: that these are aggregate exposure metrics and say nothing about any individual slate, and that a popularity penalty cannot control a set property because it never examines the rest of the slate. The candidate should ask for intra-list diversity and categories per slate; measured here they fell from 0.3439 to 0.0709 and 3.36 to 1.44. The mechanism is the strong answer: within a top-N candidate pool, popular items are the cross-category ones while a user’s rare candidates are the deep tail of their own category, so penalising popularity strips out exactly the items providing variety. Candidates should note the penalty is a legitimate tool for a supply-side exposure goal and simply is not the metric claimed.

Q: How would you compare MMR against a DPP fairly?

Expected depth: not at one parameter setting each, because lambda and theta have unrelated scales. Sweep both and compare frontiers, matching on relevance and reading off diversity (or vice versa). Candidates should name what else has to be held fixed: the same frozen base model, the same candidate pool, the same similarity matrix and the same slate length. Strong answers include a random-selection-from-pool control to establish that both curves beat a permutation, and add per-request latency as a second axis, noting the DPP’s kernel is quadratic in the pool. The measured result here is that the DPP wins at defaults and loses at every matched relevance point.

Q: What does calibrated recommendation optimise, and when is it the wrong objective?

Expected depth: KL divergence between the user’s historical category distribution and the slate’s, so it matches a mix rather than maximising spread, and it is submodular which gives greedy a 1 - 1/e guarantee. Candidates should see that it conflicts with MMR and DPP by design: a user who is 90% one category should receive a concentrated slate, and an evenly spread one is a calibration failure. Measured, the DPP improved intra-list diversity by 0.5401 while degrading calibration by 0.400 on the same slates. It is the wrong objective when the goal is discovery or breaking a filter bubble, since it explicitly reproduces the existing mix and will entrench a user whose history was itself produced by a narrow recommender, which is a feedback-loop problem post 28 measured the general form of.

View full code for this problem