Maximum Marginal Relevance (MMR) is a query-focused summarization algorithm that iteratively selects passages by maximizing a linear combination of their relevance to a user's query and their novelty relative to passages already chosen. Originally proposed by Carbonell and Goldstein in 1998, MMR constructs a ranked list where each new selection is both highly pertinent to the information need and minimally redundant with the existing set, preventing repetitive content in the final summary.
Glossary
Maximum Marginal Relevance (MMR)

What is Maximum Marginal Relevance (MMR)?
A method for selecting passages that balances relevance to a query against redundancy with already-selected passages, ensuring diverse and informative summaries.
The algorithm operates by computing a marginal relevance score for each candidate passage, defined as λ * Sim1(D_i, Q) - (1-λ) * max Sim2(D_i, D_j), where λ controls the relevance-diversity trade-off. In legal text summarization, MMR is particularly valuable for multi-document fusion tasks, such as synthesizing case law, where it ensures the summary captures distinct legal arguments from different precedents rather than repeatedly selecting semantically similar holdings.
Key Characteristics of MMR
Maximum Marginal Relevance (MMR) is a query-focused summarization method that selects passages by balancing their relevance to the query against their redundancy with already-selected passages.
The Core Formula
MMR operates on a greedy selection principle formalized as:
MMR = argmax[ λ * Sim(D_i, Q) - (1-λ) * max Sim(D_i, D_j) ]
- D_i: Candidate document or passage under consideration
- Q: The user's query or information need
- D_j: Documents already selected for the summary
- λ (lambda): A tunable parameter between 0 and 1
When λ=1, the algorithm behaves as a standard relevance-only ranker. When λ=0, it maximizes diversity by aggressively penalizing similarity to already-chosen items.
The Diversity-Recency Trade-off
The λ parameter is the critical control knob that determines the relevance-diversity balance:
- High λ (0.7-0.9): Prioritizes query relevance. Useful when the information need is narrow and focused, such as finding a specific contract clause.
- Low λ (0.3-0.5): Prioritizes novelty and diversity. Essential for multi-document legal summarization where covering distinct precedents matters more than repeating the same point.
- Default practice: Most legal AI implementations start at λ=0.5 and tune based on ROUGE and BERTScore evaluation against attorney-written summaries.
In legal contexts, a lower λ prevents the summary from redundantly restating the same holding from multiple citations.
Greedy Incremental Selection
MMR builds the summary one passage at a time using an iterative greedy algorithm:
- Compute relevance scores for all candidate passages against the query
- Select the single most relevant passage as the first item
- For each subsequent selection, compute the MMR score for every remaining candidate, penalizing similarity to all already-selected passages
- Repeat until the desired summary length is reached
This greedy approach is not globally optimal but is computationally efficient—O(n²) in the number of candidates—making it practical for large legal document collections where exhaustive search would be infeasible.
Similarity Functions
The effectiveness of MMR depends heavily on the choice of similarity metric:
- TF-IDF Cosine Similarity: The original and still widely-used approach. Represents passages as sparse vectors weighted by term frequency-inverse document frequency.
- Dense Embedding Similarity: Modern legal AI systems use embeddings from models like Legal-BERT or Instructor-XL to capture semantic similarity beyond keyword overlap.
- Hybrid Approaches: Combining lexical (BM25) and semantic (dense vector) similarity scores often yields the best results for legal text, where precise terminology matters.
For cross-document alignment in multi-case analysis, embedding-based similarity is essential because different courts may use distinct phrasing for identical legal concepts.
Application in Multi-Document Legal Summarization
MMR is particularly well-suited for synthesizing multiple legal documents:
- Case law synthesis: When summarizing 50+ precedents on a legal question, MMR ensures the output covers distinct holdings rather than repeating the most-cited case.
- Contract portfolio review: Analyzing hundreds of vendor agreements for a specific clause type benefits from MMR's diversity mechanism to surface unique variations.
- Regulatory change detection: MMR can select a diverse set of changed provisions across multiple amended statutes, preventing the summary from focusing exclusively on one section.
In practice, legal AI platforms combine MMR with source attribution so each selected passage retains a citation link to its originating document.
Limitations and Modern Extensions
Despite its widespread adoption, MMR has known limitations:
- Greedy suboptimality: The incremental selection can miss globally better passage combinations
- Static λ: A single λ value applies uniformly, but optimal trade-offs may vary across different sections of a summary
- No semantic compression: MMR selects full passages verbatim; it cannot fuse information from two passages into a single, denser statement
Modern extensions address these gaps:
- Adaptive MMR: Varies λ dynamically based on the information content already covered
- Neural MMR: Replaces the hand-crafted formula with a learned scoring function trained on attorney-annotated summaries
- Chain-of-Density integration: Uses MMR for initial passage selection, then applies abstractive compression to fuse selected content
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Frequently Asked Questions
Clear answers to the most common questions about Maximum Marginal Relevance and its application in legal document summarization.
Maximum Marginal Relevance (MMR) is a query-focused summarization algorithm that selects passages by balancing their relevance to a user's query against their redundancy with already-selected passages. The algorithm operates iteratively: it first identifies the most relevant passage to the query, then for each subsequent selection, it scores remaining candidates using a linear combination of their similarity to the query and their maximum similarity to any already-chosen passage. A tunable lambda parameter (typically between 0 and 1) controls this trade-off. When lambda is high, relevance dominates; when low, diversity is prioritized. In legal contexts, this prevents a summary from repeatedly selecting the same precedent or statutory citation, ensuring broad coverage of distinct legal arguments across a case corpus.
Related Terms
Understanding Maximum Marginal Relevance requires familiarity with the core summarization paradigms and evaluation frameworks it bridges. These related concepts define the technical landscape of legal text condensation.
Extractive Summarization
A technique that verbatim copies the most salient sentences from a source document to form a summary. Unlike abstractive methods, it does not generate new text.
- Mechanism: Ranks sentences by importance using features like term frequency or graph centrality
- MMR Connection: MMR is a classic extractive algorithm that re-ranks sentences to penalize redundancy
- Legal Use Case: Pulling key holdings directly from judicial opinions without risking paraphrasing errors
Abstractive Summarization
A technique that generates new, concise phrasing to capture the core meaning of source text, potentially rephrasing or paraphrasing the original content.
- Mechanism: Uses sequence-to-sequence models to produce novel sentences not found in the source
- Contrast with MMR: MMR is extractive; abstractive methods can fuse information across sentences
- Legal Risk: Requires rigorous factual consistency checks to prevent hallucination in generated text
Query-Focused Summarization
The task of generating a summary that specifically answers a user's natural language question rather than providing a generic overview of the document.
- MMR's Native Domain: MMR was explicitly designed for query-focused settings, balancing relevance to the query against novelty
- Legal Application: Answering 'What is the standard of review applied?' from a 50-page appellate decision
- Key Distinction: Differs from generic summarization by incorporating a user information need into the salience model
LexRank
A graph-based extractive summarization algorithm that computes sentence importance using eigenvector centrality in a similarity graph.
- Mechanism: Builds a graph where nodes are sentences and edges represent cosine similarity between TF-IDF vectors
- MMR Comparison: LexRank selects central sentences but does not explicitly penalize redundancy; MMR adds a diversity constraint
- Legal Use: Identifying the most representative sentences in a multi-document collection of related case law
Multi-Document Fusion
The process of synthesizing information from multiple source documents into a single, coherent, and non-redundant summary.
- Core Challenge: Identifying and resolving overlapping or contradictory information across documents
- MMR's Role: MMR's redundancy penalty is critical for multi-document settings where the same fact may appear verbatim in several sources
- Legal Scenario: Merging factual backgrounds from a trial court opinion, appellate brief, and amicus filings into one timeline
ROUGE (Recall-Oriented Understudy for Gisting Evaluation)
A set of metrics that automatically evaluate summary quality by counting overlapping n-grams between a candidate summary and a human-written reference.
- Variants: ROUGE-1 (unigrams), ROUGE-2 (bigrams), ROUGE-L (longest common subsequence)
- MMR Evaluation: MMR-generated summaries are often benchmarked using ROUGE scores against gold-standard legal abstracts
- Limitation: ROUGE measures lexical overlap, not factual consistency or legal reasoning quality

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us