top of page

Maximum Marginal Relevance: Balancing Relevance and Diversity in Grocery AI Retrieval (2026 Guide)

Sep 1
20 min read

Imagine a shopper asks:

What do I need for taco night?

A semantic retrieval system searches a grocery knowledge base and returns:

  1. Ground beef taco recipe

  2. Ground beef tacos for families

  3. Easy beef taco dinner

  4. Weeknight ground beef tacos

  5. Classic beef taco recipe

Every result is:

relevant.

But together, they are also:

highly redundant.

The shopper might have been better served by a set containing:

  • Taco protein options

  • Tortillas

  • Salsa

  • Cheese

  • Avocado or guacamole

  • Vegetarian filling

  • Grocery list

  • Store-specific availability

The retrieval problem is therefore not merely:

Which documents are most relevant to the query?

It can also be:

Which relevant documents add useful information that the other selected documents do not already provide?

That is the problem addressed by Maximal Marginal Relevance, commonly abbreviated MMR and also frequently called Maximum Marginal Relevance in modern retrieval tooling.

The original work by Jaime Carbonell and Jade Goldstein introduced MMR as a method for combining query relevance with information novelty, with the goal of reducing redundancy while maintaining relevance in retrieved documents and summaries.

Modern retrieval libraries continue to use the same underlying idea. LangChain, for example, describes maximal marginal relevance search as optimizing simultaneously for similarity to the query and diversity among selected documents.

For grocery AI retrieval, that tradeoff can be extremely useful.

A shopper asking:

healthy breakfast ideas from my grocery store

does not necessarily need:

five near-duplicate oatmeal passages.

A RAG system may perform better with context spanning:

  • Oatmeal

  • Greek yogurt

  • Fruit

  • Cottage cheese

  • Whole-grain toast

provided those results remain:

relevant enough to the request.

This leads to the central principle of this guide:

Similarity finds relevant candidates. MMR asks whether the next candidate contributes something new.

And the defining retrieval principle is:

The best context set is not always the collection of individually most similar passages.

Table of Contents

  1. What Is Maximum Marginal Relevance?

  2. Why Retrieval Diversity Matters

  3. Relevance vs Redundancy

  4. What Does “Marginal” Mean?

  5. How MMR Works

  6. The MMR Objective

  7. Query Similarity

  8. Candidate Redundancy

  9. The Lambda Tradeoff

  10. How MMR Selects Results Iteratively

  11. Grocery Retrieval Example

  12. Taco Night Example

  13. Product Discovery Example

  14. Recipe Retrieval Example

  15. Department Search Example

  16. Location Search Example

  17. Multi-Location Retrieval

  18. Dietary Search Example

  19. Weekly Ad Retrieval

  20. MMR and RAG

  21. Why Redundant RAG Context Can Be Wasteful

  22. MMR and Context Windows

  23. MMR and Context Selection

  24. MMR vs Top-k Similarity Search

  25. MMR vs Reranking

  26. MMR vs Cross-Encoder Reranking

  27. MMR vs Hybrid Retrieval

  28. MMR vs Dense Retrieval

  29. MMR vs Sparse Retrieval

  30. MMR vs Late Interaction and ColBERT

  31. MMR and HNSW

  32. MMR and Vector Databases

  33. MMR and Multi-Stage Retrieval

  34. MMR and Query Fan-Out

  35. MMR and Entity Resolution

  36. MMR and Content Chunking

  37. MMR and Passage-Level Optimization

  38. MMR and Information Gain

  39. MMR and Source Freshness

  40. Relevance-Diversity Failure Modes

  41. Too Much Relevance

  42. Too Much Diversity

  43. Diversity Without Constraint Satisfaction

  44. Diversity Without Freshness

  45. Diversity Across the Wrong Entity

  46. The Grocery MMR Selection Model

  47. The Grocery Context Diversity Matrix

  48. The DIVERSE Framework

  49. What Grocery Marketers Can Control

  50. What Grocery Marketers Cannot Control

  51. Does Google Use MMR?

  52. Does ChatGPT Search Use MMR?

  53. Common MMR Myths

  54. Grocery MMR Retrieval Checklist

  55. Frequently Asked Questions

  56. Final Thoughts

What Is Maximum Marginal Relevance?

Maximum Marginal Relevance is a selection strategy that tries to balance:

relevance to the query

against:

redundancy with items already selected.

Suppose retrieval produces:

20 candidate passages.

A normal top-k similarity approach might simply choose:

the five passages with the highest query similarity.

MMR instead chooses results:

iteratively.

At each step, it asks something conceptually like:

Which remaining candidate is highly relevant to the query while also being sufficiently different from what I have already selected?

That difference is essential.

MMR is not simply:

find diverse documents.

It is:

find relevant documents while penalizing excessive redundancy.

Why Retrieval Diversity Matters

Suppose an AI assistant retrieves five passages for:

best high-protein breakfast foods at a grocery store

Pure Similarity Results

  1. Greek yogurt is high in protein.

  2. Greek yogurt provides a protein-rich breakfast.

  3. High-protein Greek yogurt is useful at breakfast.

  4. Greek yogurt can increase breakfast protein.

  5. Greek yogurt varieties offer protein.

Very relevant.

But informationally:

repetitive.

Now compare:

Diverse Relevant Results

  1. Greek yogurt

  2. Eggs

  3. Cottage cheese

  4. Protein oatmeal

  5. Smoked salmon

The second set may provide:

more useful coverage of the information need.

The goal is not diversity for its own sake.

It is:

useful non-redundancy.

Relevance vs Redundancy

This article should make this distinction visually obvious.

Relevance

How well does this candidate address the query?

Redundancy

How much does this candidate repeat information already selected?

A document can be:

extremely relevant

and still add:

almost nothing new.

That means:

high relevance does not automatically imply high marginal value.

What Does “Marginal” Mean?

In MMR, “marginal” refers conceptually to:

the additional value of selecting one more item.

Suppose the selected set already contains:

a detailed passage about organic strawberries.

Now another passage is:

another detailed passage about organic strawberries.

Its incremental value may be:

low.

But a relevant passage about:

organic blueberries

could add:

a new dimension of useful information.

Therefore:

marginal relevance asks what a candidate adds beyond what is already selected.

How MMR Works

MMR operates:

iteratively.

Imagine a candidate pool:

ABCDEF

The system first selects:

a strong query-relevant result.

Then it evaluates remaining candidates based on:

  1. Query relevance

  2. Similarity to already selected results

Conceptually:

Relevant to Query − Redundant With Selected Set

The process repeats until:

the desired number of results is selected.

The MMR Objective

A common conceptual formulation is:

MMR = λ × Query Relevance − (1 − λ) × Redundancy

More formally, at each selection step the system chooses a remaining candidate that balances:

similarity to the query

against:

maximum similarity to an already selected result.

A commonly used form is:

arg max [ λ Sim(candidate, query) − (1 − λ) max Sim(candidate, selected) ]

The original MMR research framed the method around combining relevance and novelty, while modern implementations expose a tunable parameter controlling that tradeoff.

The exact scoring implementation can vary.

The important concept is:

reward query relevance, penalize redundancy.

Query Similarity

The first component asks:

How relevant is this candidate to the shopper's question?

Example query:

vegetarian taco dinner

Candidate:

Black bean tacos with avocado and salsa.

Strong relevance.

Candidate:

Apple pie recipe.

Very low relevance.

MMR still requires:

relevance.

Diversity does not rescue:

irrelevant content.

Candidate Redundancy

The second component asks:

How similar is this candidate to what has already been selected?

Suppose:

Selected

Black bean tacos with avocado.

Candidate A

Easy black bean taco recipe.

Candidate B

Roasted cauliflower tacos.

Candidate A might be:

more similar to both the query and selected passage.

Candidate B may provide:

more new information.

MMR can choose Candidate B if:

its relevance remains strong enough.

The Lambda Tradeoff

Many MMR implementations use:

λ

to control the balance between:

relevance and diversity.

LangChain's current implementation exposes lambda_mult from 0 to 1, where values closer to 1 emphasize query similarity and values closer to 0 emphasize diversity.

Conceptually:

λ → 1

Prioritize:

relevance.

Results may become:

more redundant.

λ → 0

Prioritize:

diversity.

Results may become:

less directly relevant.

Somewhere Between

Attempt to balance:

both.

But there is no universal:

best grocery MMR lambda.

That should be evaluated for:

  • Query type

  • Corpus

  • Retrieval stage

  • Context size

  • Use case

How MMR Selects Results Iteratively

Suppose the query is:

healthy lunch ideas

Candidate scores begin with:

  1. Chicken salad — 0.92

  2. Grilled chicken salad — 0.90

  3. Caesar chicken salad — 0.89

  4. Turkey wrap — 0.86

  5. Lentil bowl — 0.84

  6. Tuna sandwich — 0.82

Pure top-3 similarity could return:

three chicken salads.

MMR might instead select:

  1. Chicken salad

  2. Turkey wrap

  3. Lentil bowl

because after the first chicken salad:

additional chicken-salad candidates become increasingly redundant.

This is the MMR intuition.

Grocery Retrieval Example

Query:

foods for a high-protein breakfast

Candidate pool:

  • Greek yogurt

  • Greek yogurt guide

  • Best Greek yogurt brands

  • Eggs

  • Cottage cheese

  • Protein oatmeal

  • Peanut butter

  • Smoked salmon

Pure semantic similarity could over-select:

Greek yogurt content.

MMR may produce:

a broader high-protein breakfast set.

This can be especially useful when the downstream AI system needs:

multiple complementary pieces of evidence.

Taco Night Example

Query:

What should I buy for taco night?

Candidate pool:

  • Ground beef taco recipe

  • Classic taco recipe

  • Taco seasoning guide

  • Tortilla guide

  • Salsa page

  • Guacamole page

  • Mexican cheese guide

  • Vegetarian taco filling

  • Store weekly ad

A pure relevance ranking may cluster around:

taco recipes.

MMR can encourage coverage across:

  • Protein

  • Tortillas

  • Seasoning

  • Toppings

  • Salsa

  • Cheese

The result becomes:

more useful as a shopping answer.

Product Discovery Example

Query:

snacks for a school lunch

A similarity-only retriever could return:

five granola-bar products.

MMR could return:

  • Granola bar

  • Applesauce

  • Pretzels

  • Cheese snack

  • Fruit cup

But diversity must not overpower:

dietary constraints.

If the query is:

nut-free snacks for school

every selected candidate must still satisfy:

the nut-free requirement.

This gives us a critical rule:

Diversity should operate inside the eligible candidate set—not replace eligibility.

Recipe Retrieval Example

Query:

easy dinners using chicken

Pure similarity:

  • Chicken pasta

  • Creamy chicken pasta

  • Garlic chicken pasta

  • One-pot chicken pasta

MMR:

  • Chicken pasta

  • Sheet-pan chicken

  • Chicken stir-fry

  • Chicken tacos

The latter provides:

broader meal possibilities.

Department Search Example

Query:

What services does your meat department offer?

Relevant candidate passages might cover:

  • Custom cutting

  • Grinding

  • Special orders

  • Marinated meats

  • Butcher consultation

If the top five results all discuss:

custom cutting,

the generated response may miss:

the broader service set.

MMR can help surface:

complementary evidence.

Location Search Example

Query:

What makes the Downtown grocery location useful?

Potential information:

  • Pharmacy

  • Seafood counter

  • Bakery

  • Pickup

  • Late hours

  • Parking

  • Prepared foods

A similarity retriever might over-select:

several location-description passages.

A diversity-aware selector might surface:

different useful attributes.

But all selected content must still belong to:

Downtown.

Multi-Location Retrieval

This is where diversity can become dangerous.

Suppose the query is:

What services are available at FreshTown Downtown?

Candidate set:

Downtown

  • Bakery

  • Curbside pickup

Northside

  • Pharmacy

  • Delivery

A diversity algorithm might prefer:

Pharmacy + Delivery

because they add novel information.

But they are:

the wrong location.

Therefore:

entity filtering must precede or constrain diversity selection.

A perfect diversity objective applied to:

the wrong candidate universe

still produces:

the wrong answer.

Dietary Search Example

Query:

gluten-free breakfast options

MMR might diversify results across:

  • Gluten-free cereal

  • Yogurt

  • Eggs

  • Gluten-free bread

  • Fruit

That can improve:

informational breadth.

But gluten-free status should come from:

explicit, reliable product information.

MMR does not verify:

dietary safety.

Weekly Ad Retrieval

Query:

best dinner deals this week

Suppose candidates include:

  • Chicken breast promotion

  • Another chicken breast promotion snippet

  • Chicken weekly-ad landing page

  • Salmon sale

  • Pasta sale

  • Vegetable sale

MMR could reduce:

duplicate chicken information

and increase:

promotional variety.

This can produce richer context for:

meal planning.

But current promotion dates must still be:

enforced.

MMR and RAG

MMR became especially relevant again with:

retrieval-augmented generation.

A RAG system may retrieve several passages and insert them into:

the LLM context.

If those passages are highly redundant:

valuable context capacity is wasted.

MMR can help select:

a diverse set of relevant passages

from a larger candidate pool.

The simplified pipeline:

Query → Retrieve Candidates → MMR Selection → Context → Generate

This is one reason modern vector-store frameworks expose MMR retrieval directly. LangChain's vector-store interface, for example, fetches a larger candidate pool and then selects a smaller set using maximal marginal relevance.

Why Redundant RAG Context Can Be Wasteful

Suppose an LLM has room for:

five grocery passages.

If all five say:

Downtown has a bakery,

then the context may fail to include:

  • Bakery hours

  • Custom cakes

  • Pickup

  • Deli

  • Pharmacy

Redundant passages consume:

context budget

without contributing equivalent new information.

This gives us one of the strongest lines in the article:

Retrieval quality is not just about finding strong passages. It is about assembling a strong set of passages.

MMR and Context Windows

A context window has:

finite capacity.

Even very large context windows should not automatically be filled with:

duplicate evidence.

The objective is not:

maximum content.

It is:

maximum useful coverage.

MMR can therefore serve as:

a context-efficiency mechanism.

But it is not itself:

context-window management.

MMR and Context Selection

The previous multi-stage retrieval article distinguished:

retrieval

from:

context selection.

MMR can operate:

between them.

Conceptually:

Candidate Retrieval → MMR Diversification → Evidence Evaluation → Context Selection

Or MMR itself may serve as part of:

context selection.

The architectural location depends on:

implementation.

Its conceptual job remains:

reduce redundant selections while preserving relevance.

MMR vs Top-k Similarity Search

This is the simplest comparison.

Top-k Similarity

Choose:

the k candidates most similar to the query.

MMR

Choose:

candidates that balance similarity to the query with difference from already selected candidates.

So:

Top-k asks: Which are closest?
MMR asks: Which relevant candidate adds the most new value next?

MMR vs Reranking

MMR can be considered:

a form of reranking or selection.

But not every reranker is:

MMR.

A conventional relevance reranker might reorder candidates based on:

query-document relevance.

MMR additionally considers:

relationships among the selected documents.

This is key.

Traditional reranking evaluates candidates against the query. MMR also evaluates candidates against one another.

MMR vs Cross-Encoder Reranking

Cross-encoder reranking asks:

How relevant is this candidate to the query?

MMR asks:

How relevant is this candidate to the query, and how much does it duplicate what I already selected?

They can therefore work together:

Retrieve → Cross-Encoder Rerank → MMR Diversify

or potentially:

Retrieve → MMR → Rerank

depending on architecture.

No universal ordering applies.

The critical distinction:

Cross-encoders improve relevance precision. MMR improves set-level relevance diversity.

MMR vs Hybrid Retrieval

Hybrid retrieval combines:

multiple candidate-generation methods.

For example:

sparse + dense.

MMR selects:

a diverse relevant subset.

So:

Hybrid Retrieval = Where candidates come from.
MMR = How a useful non-redundant set can be selected from candidates.

MMR vs Dense Retrieval

Dense retrieval can return:

semantically similar candidates.

Because semantically similar candidates can themselves be:

highly similar to one another,

dense retrieval is a natural place where:

redundancy can emerge.

MMR can operate after:

dense candidate retrieval.

MMR vs Sparse Retrieval

Sparse search can also return:

repetitive results.

For example, exact phrase matching may retrieve:

multiple pages containing nearly identical wording.

MMR is not limited to:

dense retrieval.

The diversity logic can conceptually operate over:

any candidate pool where relevance and candidate-candidate similarity can be evaluated.

MMR vs Late Interaction and ColBERT

The previous article addressed:

fine-grained relevance matching.

ColBERT asks:

how well do detailed query representations interact with detailed document representations?

MMR asks:

after relevant candidates exist, which ones form the strongest non-redundant set?

So:

ColBERT improves candidate relevance resolution.
MMR improves candidate-set composition.

These are fundamentally different layers.

MMR and HNSW

HNSW can generate:

approximate nearest-neighbor candidates.

Those candidates may then be:

passed to MMR.

Conceptually:

Query → Embedding → HNSW → 50 Candidates → MMR → 8 Diverse Candidates

The specific numbers are illustrative.

LangChain's MMR API explicitly separates:

fetch_k

from:

k,

illustrating the common pattern of fetching a larger candidate pool before selecting a smaller diversified result set.

MMR and Vector Databases

Some vector-store interfaces support MMR as:

a retrieval option.

The system can:

  1. Run similarity search

  2. Fetch a candidate pool

  3. Apply MMR

  4. Return a smaller set

This demonstrates that MMR often sits:

downstream of base vector similarity search.

But:

MMR is not itself a vector database.

MMR and Multi-Stage Retrieval

Now place MMR in the broader architecture.

Question↓Candidate Generation↓Hybrid Fusion↓Filtering↓Entity Resolution↓Relevance Reranking↓MMR Diversity Selection↓Evidence Evaluation↓Context Selection↓Grounding↓Generation

This is one possible pipeline.

MMR's unique responsibility is:

set-level redundancy control.

MMR and Query Fan-Out

Query fan-out can create:

multiple related retrieval branches.

Example:

best grocery store for taco night

Potential subqueries:

  • Taco meat

  • Tortillas

  • Salsa

  • Produce

  • Cheese

  • Store hours

When results from those branches are combined:

redundancy can appear.

MMR can potentially help select:

complementary evidence across the combined pool.

But query fan-out itself already introduces:

information diversity.

So these mechanisms should not be confused.

MMR and Entity Resolution

Diversity is useful only after:

entity relationships are correct.

For query:

What can I buy at Downtown?

Do not diversify by pulling:

Northside-only services.

MMR must operate within:

the correct entity boundary.

This produces another signature line:

Diversify the answer—not the entity.

MMR and Content Chunking

Poor chunking can produce:

many nearly identical chunks.

For example, five overlapping chunks may all repeat:

the same department description.

Retrieval then returns:

redundant passages.

MMR can reduce:

the downstream impact.

But it does not fix:

bad source chunking.

The better approach is:

good semantic chunking + diversity-aware selection.

MMR and Passage-Level Optimization

Strong passages should be:

  • Focused

  • Specific

  • Independently understandable

  • Entity-aligned

If every passage says:

the same generic thing,

MMR has little useful diversity to work with.

Therefore:

retrieval diversity begins with information diversity.

MMR and Information Gain

MMR has a natural relationship to:

information gain.

Information Gain asks:

does this content contribute something genuinely useful?

MMR asks:

does this candidate add useful novelty relative to what is already selected?

They are not the same.

But both resist:

repetitive information.

A useful distinction is:

Information Gain = Does the source add something new to the information environment?
MMR = Does this candidate add something new to this selected result set?

MMR and Source Freshness

Suppose:

Candidate A

Current chicken promotion.

Candidate B

Current salmon promotion.

Candidate C

Expired vegetable promotion.

Candidate C may offer:

excellent diversity.

But it is:

stale.

Therefore:

freshness should constrain or precede diversity.

Do not allow novelty to reward:

incorrect information.

Relevance-Diversity Failure Modes

MMR introduces:

a tradeoff.

Tradeoffs create:

failure modes.

The two broad extremes are:

relevance collapse

and:

diversity collapse.

Too Much Relevance

If diversity is given:

almost no weight,

MMR becomes increasingly similar to:

top-k relevance retrieval.

The set may contain:

  • Duplicate passages

  • Near-identical products

  • Repeated facts

  • Overlapping chunks

Result:

high relevance, low information coverage.

Too Much Diversity

If diversity receives:

too much weight,

the system can select candidates that are:

novel but weakly related.

Query:

best vegetables for stir-fry

A poorly balanced system might select:

  • Broccoli

  • Bell peppers

  • Soy sauce

  • Cast-iron skillet

  • Chicken

The set becomes:

varied,

but increasingly:

off-task.

This leads to:

Diversity without relevance is noise.

Diversity Without Constraint Satisfaction

Query:

vegan dinner ideas

Do not diversify into:

  • Chicken curry

  • Salmon bowl

  • Beef tacos

because:

they are different.

Eligibility must remain:

satisfied first.

Diversity Without Freshness

Query:

deals this week

Do not select an expired promotion simply because:

it adds variety.

Diversity Across the Wrong Entity

Query:

Downtown store services

Do not diversify across:

Northside and Westside services.

The rule:

Diversity must remain inside the truth boundary of the query.

The Grocery MMR Selection Model

This should be the article's primary signature visual.

Start with:

CANDIDATE POOL

  • Result A

  • Result B

  • Result C

  • Result D

  • Result E

  • Result F

↓

QUERY RELEVANCE

Which candidates answer:

the shopper's request?

↓

REDUNDANCY CHECK

Which candidates repeat:

already selected information?

↓

MARGINAL VALUE

Which candidate adds:

the strongest useful new information?

↓

SELECT

↓

REPEAT

This becomes:

Relevant → Compare → Diversify → Select → Repeat

The core principle:

MMR evaluates the value of the next result in the context of the results already chosen.


The Grocery Context Diversity Matrix

This should be the most intuitive visual.

Query:

What should I buy for taco night?

Candidate

Query Relevance

Redundancy

Marginal Value

Beef taco recipe

High

Low initially

High

Easy beef taco recipe

High

High

Low

Tortilla guide

High

Low

High

Salsa options

High

Low

High

Guacamole guide

High

Low

High

Chocolate cake guide

Low

Low

Low

This demonstrates:

novel does not automatically mean useful.

The ideal result has:

high relevance + low unnecessary redundancy.


The DIVERSE Framework

This should be the Grocery Growth marketer-facing framework.

It is not the mathematical MMR algorithm.

D — Define the Information Need

Understand whether the shopper needs:

  • One exact answer

  • Several options

  • Multiple categories

  • Supporting evidence

  • Comparative information

Not every query needs:

maximum diversity.

I — Identify Hard Constraints

Before diversification, enforce:

  • Location

  • Dietary requirements

  • Price

  • Time

  • Inventory

  • Store eligibility

V — Verify Entity Ownership

Make sure selected facts belong to:

the correct entity.

E — Establish Relevance

Candidates must still:

answer the query.

R — Reduce Redundancy

Avoid selecting:

multiple passages that contribute essentially the same information.

S — Select Complementary Evidence

Favor relevant candidates that:

expand useful coverage.

E — Evaluate the Final Set

Ask:

Does the collection collectively answer the question better than the individually highest-similarity results would?

So:

DIVERSE = Define → Identify → Verify → Establish → Reduce → Select → Evaluate

This is a Grocery Growth retrieval-content framework.

It is not Google's, OpenAI's, or MMR's internal algorithm.

What Grocery Marketers Can Control

Most grocery marketers will not:

tune an MMR lambda.

But they can improve the diversity and usefulness of the information available to retrieval systems.

Create distinct information about:

  • Products

  • Departments

  • Services

  • Locations

  • Recipes

  • Dietary options

  • Promotions

  • Shopping occasions

  • Customer questions

  • Local specialties

Avoid having:

20 pages saying essentially the same thing.

The source-level principle is:

A retrieval system cannot assemble diverse useful evidence if the website only publishes redundant information.

What Grocery Marketers Cannot Control

For external search and AI platforms, grocery marketers generally cannot control:

  • Whether MMR is used

  • Candidate pool size

  • Lambda

  • Diversity penalty

  • Similarity metric

  • Selection order

  • MMR implementation

  • Context-selection architecture

  • Diversity threshold

  • Result-set optimization

Do not try to optimize:

an imaginary external MMR score.

Does Google Use MMR?

Do not claim:

Google Search or AI Overviews universally use Maximum Marginal Relevance.

Google's public documentation establishes that modern Search and generative features can retrieve and synthesize information from multiple sources.

It does not publicly establish:

a universal MMR implementation, lambda, redundancy formula, or document-diversity score.

MMR should therefore be explained as:

a well-established retrieval and selection technique, not a secret Google ranking mechanism.

Does ChatGPT Search Use MMR?

OpenAI does not publicly specify:

Maximum Marginal Relevance

as a universal ChatGPT Search algorithm.

OpenAI documents web searching, query rewriting, relevance, reliability, and source citations, but not a publisher-facing:

MMR lambda or diversity-selection formula.

So do not claim:

  • ChatGPT universally uses MMR

  • ChatGPT has an MMR score

  • OAI-SearchBot calculates diversity penalties

  • MMR determines ChatGPT citations

Those would be unsupported.

Common MMR Myths

“MMR means Maximum Marginal Relevance.”

You will see both Maximum Marginal Relevance and Maximal Marginal Relevance used. The original Carbonell and Goldstein work uses Maximal Marginal Relevance terminology. Modern tools also commonly use that phrasing.

For this article's title, “Maximum Marginal Relevance” is understandable search language, but the body should mention:

Maximal Marginal Relevance (MMR)

as the original/formal terminology.

“MMR just finds diverse content.”

No.

It balances:

relevance + diversity.

“MMR intentionally selects irrelevant results.”

It should not.

“MMR is a similarity metric.”

No.

It is:

a selection/reranking strategy.

“MMR replaces vector search.”

No.

It often operates:

on candidates already retrieved.

“MMR replaces HNSW.”

No.

“MMR replaces hybrid retrieval.”

No.

“MMR replaces cross-encoder reranking.”

No.

“MMR is a cross-encoder.”

No.

“MMR is ColBERT.”

No.

“MMR is RAG.”

No.

“MMR only works with embeddings.”

The concept predates modern embedding retrieval and was originally developed for information retrieval and summarization.

“MMR always improves results.”

No.

It can hurt relevance if:

diversity is overemphasized.

“More diversity is always better.”

No.

“Lambda 0.5 is the best setting.”

No.

Some software uses 0.5 as a default, but that is not a universal optimum. LangChain currently defaults lambda_mult to 0.5 in its vector-store interface.

“Lambda 1 means maximum diversity.”

Not in LangChain's current lambda_mult convention. There, 1 emphasizes query similarity and 0 maximizes diversity.

Different APIs can expose diversity controls differently, so:

always check implementation semantics.

“MMR verifies whether a product is in stock.”

No.

“MMR checks allergens.”

No.

“MMR determines the correct location.”

No.

“MMR solves stale content.”

No.

“MMR guarantees better grounding.”

No.

It can improve:

context composition,

but grounding remains downstream.

“MMR guarantees citation diversity.”

No.

“Google has an MMR ranking factor.”

No public ranking factor of this kind is documented.

“ChatGPT has a publisher-visible MMR setting.”

No.

“There is MMR schema markup.”

No.

Grocery MMR Retrieval Checklist

Candidate Quality

  •  Candidates genuinely relevant

  •  Wrong-topic candidates removed

  •  Hard constraints enforced

  •  Entity ownership verified

  •  Stale content excluded

Redundancy

  •  Duplicate pages minimized

  •  Overlapping chunks reviewed

  •  Near-identical passages identified

  •  Syndicated/duplicate content controlled

  •  Repeated facts consolidated

Diversity

  •  Different relevant subtopics represented

  •  Different useful product options surfaced

  •  Different supporting evidence considered

  •  Diversity remains query-relevant

  •  Diversity remains entity-correct

If Building Your Own Retrieval System

  •  Similarity-search baseline measured

  •  MMR tested against top-k retrieval

  •  Candidate pool size tested

  •  Final k tested

  •  Lambda tested

  •  Human relevance evaluated

  •  Redundancy measured

  •  Context coverage measured

  •  Latency measured

  •  Downstream RAG answers evaluated

High-Consequence Constraints

  •  Dietary claims explicit

  •  Allergy claims verified

  •  Price current

  •  Inventory current where required

  •  Location correct

  •  Promotion dates current

Claims Discipline

  •  No claim MMR = pure diversity

  •  No claim MMR replaces retrieval

  •  No universal lambda recommendation

  •  No claim MMR verifies facts

  •  No claim Google universally uses MMR

  •  No claim ChatGPT universally uses MMR

  •  No invented MMR ranking factor


Frequently Asked Questions

What is Maximum Marginal Relevance?

Maximum Marginal Relevance, more formally introduced as Maximal Marginal Relevance, is a method for balancing:

query relevance and information novelty.

The original Carbonell and Goldstein work used MMR to reduce redundancy while maintaining relevance in document reranking and summarization.

What does MMR stand for?

Maximal Marginal Relevance.

“Maximum Marginal Relevance” is also widely used colloquially and in search discussions.

What problem does MMR solve?

It helps prevent a selected result set from containing:

too many highly similar or redundant items.

How does MMR work?

Conceptually, it rewards:

similarity to the query

and penalizes:

similarity to already selected candidates.

What is the MMR formula?

A common conceptual form is:

λ × Query Relevance − (1 − λ) × Redundancy

with candidates selected:

iteratively.

What does lambda do?

Lambda controls:

the relevance-diversity tradeoff.

In LangChain's current implementation:

  • 1 emphasizes similarity

  • 0 emphasizes maximum diversity

with values between them balancing the two.

Is 0.5 the best lambda?

No.

It is a common default in some implementations, not:

a universal optimum.

What is fetch_k?

In LangChain's MMR implementation, fetch_k is the number of candidate documents initially fetched before MMR selects the final k documents.

Conceptually:

fetch broadly → diversify/select narrowly.

Why retrieve more candidates than you return?

Because MMR needs:

alternatives to choose among.

If you retrieve only:

exactly the number you plan to return,

the opportunity for diversification is:

limited.

Does MMR use cosine similarity?

It can use similarity values based on:

vector representations,

but the exact similarity function depends on:

implementation.

MMR itself is not:

cosine similarity.

Is MMR a reranker?

It can be used as:

a reranking/selection technique.

Is MMR a cross-encoder?

No.

Is MMR vector search?

No.

It can operate:

downstream of vector search.

Is MMR an embedding model?

No.

Is MMR the same as hybrid retrieval?

No.

Is MMR the same as ColBERT?

No.

Is MMR useful for RAG?

Yes.

It can help produce:

less redundant retrieved context.

Why does diversity matter in RAG?

Because a context window filled with:

duplicate information

can waste space that could contain:

complementary evidence.

Does MMR increase factual accuracy?

Not inherently.

It improves:

result-set composition.

Truth and accuracy require:

reliable source information and downstream validation.

Can MMR hurt retrieval?

Yes.

Excessive diversity weighting can:

reduce query relevance.

Should filters happen before MMR?

Often hard constraints such as:

  • Location

  • Dietary status

  • Time

  • Eligibility

should define the valid candidate universe before or during diversification.

The exact architecture varies.

Can MMR select multiple product categories?

Yes, if:

they remain relevant to the query.

Can MMR help conversational grocery queries?

Potentially.

Broad queries often benefit from:

multiple complementary pieces of information.

Does MMR improve exact product lookup?

Possibly less useful.

If a shopper asks:

UPC 123456

the goal is likely:

one exact match,

not result diversity.

What kinds of grocery queries benefit most from MMR?

Especially:

  • Recommendations

  • Meal planning

  • Recipe discovery

  • Product alternatives

  • Department overviews

  • Shopping-list generation

  • Broad research questions

  • RAG context assembly

What queries may need less diversity?

Especially:

  • Exact product lookup

  • Exact store hours

  • Exact price

  • Exact location

  • Specific inventory check

For these queries:

precision may dominate diversity.

Does Google use MMR?

Google does not publicly document MMR as a universal public Search or AI Overview retrieval mechanism.

Does ChatGPT Search use MMR?

OpenAI does not publicly document MMR as a universal ChatGPT Search retrieval mechanism.

Should grocery marketers optimize pages for MMR?

Not directly.

Instead:

publish distinct, useful, accurate information rather than many repetitive pages.

Final Thoughts

Retrieval systems often begin with a simple goal:

find the content most relevant to the query.

But when multiple pieces of information are selected, another problem appears:

What if all of the highly relevant results say essentially the same thing?

That is where Maximum—or more formally, Maximal—Marginal Relevance becomes valuable.

MMR introduces a second consideration:

novelty relative to what has already been selected.

The original MMR research explicitly framed the method around combining query relevance with information novelty to reduce redundancy.

Modern retrieval tooling continues to use the same core principle, including vector-store implementations that fetch a larger candidate set and return a smaller collection chosen for both query similarity and diversity.

For grocery AI retrieval, the distinction matters because many shopper questions are:

inherently multi-faceted.

A shopper asking:

What should I buy for taco night?

may benefit from:

tortillas + protein + salsa + cheese + produce

more than:

five nearly identical taco recipes.

A shopper asking:

healthy breakfast options

may benefit from:

yogurt + eggs + fruit + oatmeal + cottage cheese

more than:

five Greek-yogurt passages.

This makes MMR a:

set-optimization technique.

It does not simply ask:

“Which result is best?”

It asks:

“Which result should I add next, given what I have already selected?”

The Grocery MMR Selection Model becomes:

Candidate Pool → Relevance → Redundancy Check → Marginal Value → Select → Repeat

The DIVERSE Framework becomes:

Define → Identify → Verify → Establish → Reduce → Select → Evaluate

Within the wider Grocery Growth retrieval architecture:

Content → Embed → Candidate Retrieval → Filter → Entity Resolve → Relevance Rerank → MMR Diversify → Evidence Evaluate → Context Select → Ground → Generate → Cite

MMR owns:

the diversity and redundancy-control layer.

It does not replace:

  • Retrieval

  • Filtering

  • Entity resolution

  • Freshness

  • Reranking

  • Grounding

  • Citation

And it should never turn:

diversity

into:

randomness.

The three defining lines for this article should be:

Similarity finds relevant candidates. MMR asks whether the next candidate contributes something new.
Retrieval quality is not just about finding strong passages. It is about assembling a strong set of passages.
Diversity without relevance is noise. Relevance without diversity can be repetition.

Want Your Grocery Content to Provide Better Retrieval Coverage?

Grocery Growth helps grocery retailers build clearer, more useful information architectures for traditional search, semantic retrieval, AI-assisted discovery, and modern answer systems.

Optimization can include:

  • Product information

  • Department pages

  • Location architecture

  • Service information

  • Grocery content strategy

  • Semantic SEO

  • Entity optimization

  • Content chunking

  • Passage optimization

  • Information gain

  • Content freshness

  • Internal linking

  • Structured information

  • Crawlability

  • LLM retrieval optimization

  • GEO

  • AEO

  • SEO

  • AI-search optimization

The goal is not to manipulate:

an MMR lambda or an undisclosed diversity score.

It is to create enough:

distinct, accurate, relevant information

that retrieval systems have useful evidence to choose from.

Explore Grocery Growth's SEO and AI-search optimization services.

Written by Grocery Growth

Grocery Growth helps grocery retailers build clearer digital information architectures for traditional search, semantic retrieval, AI-assisted discovery, and modern grocery shopping experiences.

Related Articles

Representation & Matching: Vector Embeddings Explained for Grocery Store Marketers; Cosine Similarity and Semantic Retrieval; Late Interaction Retrieval: ColBERT and Token-Level Matching.

Candidate Generation: Dense vs Sparse Retrieval; Hybrid Retrieval; HNSW Explained.

Candidate Evaluation: Cross-Encoder Reranking; Bi-Encoders vs Cross-Encoders.

Pipeline Architecture: Multi-Stage Grocery Content Retrieval Pipelines.

Content Selection: Content Chunking; Passage-Level Optimization; Information Gain and AI Search.

Downstream AI: RAG and Grocery Store Websites; Grounding in AI Search; Citation Optimization.

Recent Posts

See All

Comments


bottom of page