Interactive retrieval diversity laboratory

Relevant is not the same as useful.

Maximum Marginal Relevance reranks a candidate pool one item at a time. Each next chunk must answer the query while adding something the selected context does not already repeat.

MMR(d) = lambda * relevance(q, d) - (1 - lambda) * max similarity(d, selected)
0 of 4 selected
0.60
Redundancy measure

The highest scores can all be echoes.

Relevance-only ranking has no memory of earlier results. MMR recomputes a redundancy penalty after every pick, so the order depends on what is already in the context.

Top-k by relevance only

    Greedy MMR order

      Mean relevance0.00MMR result set
      Pairwise redundancy0.00Lower repeats less
      Aspect coverage0 / 0Unique candidate intents
      Selection step0 / 4Greedy picks completed

      Diversity is conditional on the context you already chose.

      MMR is a greedy reranker, not a diversity oracle. It needs a useful candidate pool, comparable score scales, and an evaluation target that rewards coverage instead of novelty for its own sake.

      Relevance establishes the candidate pool.

      MMR usually reranks documents retrieved by another system. If an important aspect never enters the pool, the diversity term cannot invent it.

      Lambda changes the product behavior.

      At lambda 1, the order is relevance-only. As lambda falls, similarity to selected items matters more. Extremely low values can reward novelty that is barely useful.

      The first pick is always relevance-first.

      Before anything is selected, the redundancy term is zero. The highest-relevance candidate wins the opening step under the standard formulation.

      Score scales must be compatible.

      Cosine relevance and redundancy may have different distributions. Normalize, calibrate, and tune lambda on held-out retrieval tasks rather than copying a default.

      Near-duplicate chunks expose the value.

      Overlapping windows can dominate top-k while adding few new facts. MMR can free context space for another aspect, but deduplication upstream may be cheaper.

      One greedy decision at a time.

      The score is recalculated for every unselected candidate after each addition. That changing selected set is the defining state of the algorithm.

      Candidate pool

      Start with query-relevant documents.

      A retriever supplies more candidates than the final context can hold. Preserve raw relevance scores and embeddings or another document-similarity representation.

      Marginal score

      Subtract the strongest redundancy.

      For each remaining document, find its maximum similarity to any selected document. One near-copy is enough to create the full penalty in the standard MMR objective.

      Greedy update

      Add the best score, then recompute.

      The chosen document joins the selected set. Every remaining redundancy term can now change, so MMR is a sequential selection process rather than one static sort.

      Evaluation

      Measure utility and coverage together.

      Track relevance, answer quality, citation support, unique aspects, and token cost. Lower similarity is not automatically better if the new chunks do not help the downstream task.

      A diversified context should cover more of the question without spending its token budget on loosely related novelty.

      A production checklist for diverse retrieval.

      Tune on representative queries and retain the relevance-only baseline. The goal is not a visually scattered embedding map; it is better use of limited context.

      • Log raw relevance, redundancy, lambda, candidate-pool size, and selection order.
      • Compare exact deduplication, clustering, MMR, and learned reranking at equal latency.
      • Evaluate downstream answer completeness and citation support, not diversity alone.
      • Monitor score distributions when the embedding model, corpus, or chunking policy changes.