A retriever can fill its top positions with passages that are individually relevant but nearly interchangeable. Several chunks from one document may repeat the same fact, leaving little room for other evidence in a fixed context budget. Maximum marginal relevance, commonly abbreviated MMR, addresses this at the selection stage by considering both query relevance and redundancy with items already chosen.

MMR does not change the embedding model or recover candidates that retrieval missed. It reranks a candidate pool. That boundary matters: the method can improve variety among available candidates, but it cannot compensate for poor candidate recall.

MMR makes selection depend on prior selections

A standard relevance ranking assigns each candidate a score against the query and sorts once. MMR is iterative. At each selection, it scores an unselected candidate using its relevance to the query and its similarity to the set already selected.

A common form is:

MMR(d) = lambda * sim(d, q)
         - (1 - lambda) * max_{s in S} sim(d, s)

Here, d is an unselected candidate, q is the query, and S is the selected set. The coefficient lambda lies between 0 and 1 in this formulation. The first term rewards query relevance. The second penalizes candidates that resemble an item already in S.

The first item has no selected competitor, so implementations commonly start with the candidate having the strongest query relevance. Subsequent choices depend on what has already entered the result set.

This makes MMR different from a fixed per-document reranker. A candidate’s effective score can change after each selection because the redundancy term changes with S.

The redundancy term changes the ranking objective

Suppose three candidates have query relevance scores of 0.92, 0.90, and 0.84. The first two cover almost identical text, with pairwise similarity 0.96. The third covers a different aspect and has similarity 0.30 to the first result.

After selecting the first candidate, using lambda = 0.7 gives:

candidate B: 0.7 * 0.90 - 0.3 * 0.96 = 0.342
candidate C: 0.7 * 0.84 - 0.3 * 0.30 = 0.498

Candidate C is selected next even though its original query relevance is lower. The calculation is not claiming that C is more relevant in isolation. It states that C adds more value under an objective that includes a redundancy penalty.

That distinction is central to interpreting MMR output. A lower-ranked candidate from the original retriever can move upward because it contributes information that differs from what is already present.

Lambda controls a specific tension

In the formula above, lambda = 1 removes the redundancy penalty and reduces selection to query relevance. Lower values give candidate-to-selection similarity more influence.

This coefficient is not a generic quality setting. Raising it does not make retrieval intrinsically more accurate, and lowering it does not guarantee useful diversity. It changes the objective being optimized during selection.

The useful range depends on the candidate pool and the similarity function. If near-duplicate chunks have similarities clustered close to 1 while distinct relevant chunks are well separated, a modest penalty can change ordering substantially. If all candidate-to-candidate similarities occupy a narrow range, the same coefficient may have little effect.

Comparing coefficient values therefore makes more sense against a fixed evaluation target and fixed score construction than as an isolated parameter search.

Similarity scales must support both terms

The formula combines query-candidate similarity and candidate-candidate similarity numerically. That creates an assumption that the two terms have compatible meaning and scale.

When the same normalized embedding representation and cosine similarity are used for both, the values at least come from the same scoring construction. Even then, their empirical distributions can differ. Query vectors and document vectors may occupy different regions, and document-document similarities may be systematically higher or lower than query-document similarities.

If relevance comes from a cross-encoder while redundancy comes from cosine similarity, direct substitution into the same expression needs additional care. A cross-encoder logit and a cosine value are not automatically comparable measurements. Scaling or transforming one term may be required before lambda expresses the intended balance.

The equation is simple, but its coefficient only has a stable interpretation when the score scales around it are understood.

Candidate pool size limits what MMR can select

MMR operates after an initial retrieval stage. If the final output needs eight chunks but the candidate pool contains only ten, there is little room to trade a redundant high-ranked item for a distinct candidate farther down the original ranking.

A broader pool gives the selector more alternatives. It also increases pairwise similarity work. For a requested output of k items from n candidates, a direct implementation repeatedly compares remaining candidates with the growing selected set. Cached similarity matrices or incremental tracking can avoid recomputing the same pairwise values.

Candidate depth should therefore be treated as part of MMR configuration. The selector cannot diversify across evidence that never entered its input set.

This also separates two evaluation questions. Candidate recall measures whether useful material reaches the pool. Selection quality measures which of those candidates survive into the final set. Mixing the two can make an MMR issue look like a retriever issue, or the reverse.

Chunking can create artificial redundancy

Overlapping chunkers often produce adjacent passages with substantial shared text. A relevance-only retriever may rank several of those chunks together because they contain the same query terms or semantic content.

MMR can suppress that repetition when the embedding similarity between adjacent chunks is high. The result can free positions for material from other regions of the corpus.

There is a boundary, however. Two chunks can be textually similar yet differ in one detail that matters to the application. A strong redundancy penalty may discard one of them. Conversely, two passages can express the same claim with different wording and receive only moderate similarity, allowing semantic duplication to remain.

The behavior is therefore tied to the representation used for the redundancy term. MMR detects similarity through that representation; it has no separate concept of factual duplication.

Document identity can complement vector similarity

Some redundancy is structural rather than semantic. A system may want at most two chunks from the same document, or it may want results from several source groups. Pure MMR does not encode such constraints unless the similarity function happens to reflect them.

Explicit selection rules can be applied alongside MMR. For example, a candidate can be excluded after a per-document quota is reached, then MMR can choose among the remaining candidates. This changes the feasible set rather than trying to force metadata constraints into vector similarity.

Keeping these mechanisms separate makes their effects easier to inspect. Similarity penalties handle representational overlap. Metadata constraints handle known structural requirements.

MMR and rank fusion solve different problems

Rank fusion combines evidence from multiple retrieval orderings. MMR changes the composition of a result set by penalizing redundancy among selected candidates. They can appear in the same retrieval pipeline without being substitutes.

A system might retrieve lexical and dense candidates, fuse those rankings, then apply MMR to the fused pool before constructing model context. In that arrangement, fusion decides which candidates receive support from the retrieval sources. MMR decides which surviving candidates form a less repetitive subset.

Ordering the stages differently changes the available evidence. Applying MMR independently to each source before fusion can remove candidates that would have gained support from agreement across retrievers. Applying it after fusion preserves that agreement signal until the diversity selection stage.

The appropriate order follows the objective assigned to each stage rather than a universal pipeline template.

Diversity needs an evaluation target

A result set with low pairwise similarity is not automatically useful. An aggressive selector can produce varied but weakly relevant passages. The desired behavior is usually conditional: reduce avoidable repetition without discarding evidence needed for the downstream task.

Evaluation can separate relevance from redundancy instead of collapsing both into one informal judgment. Retrieval metrics can track whether relevant candidates survive selection, while overlap measures or application-specific checks can reveal repeated content. For RAG, downstream answer evaluation can also expose cases where diversity removed corroborating passages that the generator needed.

MMR is most precise when treated as a set-composition mechanism. It changes the value assigned to a candidate after other candidates have been selected. That makes it useful when a limited result budget should cover more distinct evidence, but its effect remains bounded by candidate recall, score geometry, chunk construction, and the representation used to define redundancy.