Concept guide · Embeddings and vector search
What is maximum marginal relevance?
A slower explanation for when the short interview answer is not enough. Start with the intuition, then connect it to the technical idea and the way an interviewer expects you to reason about it.
ML area
Generative AI → Diversity and redundancy control
Interview format
Core · Scenario
Question
GENAI-042
Start with the idea
In simple terms
Maximum marginal relevance tries to select results that are relevant to the question but not copies of one another. It can give the model broader evidence without filling the context with duplicate chunks.
Make it concrete
If the top ten results are ten overlapping paragraphs from one policy page, MMR may keep a few of those and add a related exception or definition from another section.
Build the answer
How to approach it
- 1Diagnose duplicate or overlapping candidates before adding MMR.
- 2Explain the relevance-versus-diversity trade-off.
- 3Tune it against downstream answer and citation quality.
Go one level deeper
The technical explanation
MMR balances query similarity with similarity to already selected results. A high diversity weight can improve coverage but may remove the strongest repeated evidence or introduce less relevant passages. Use it when redundancy is a measured problem, and evaluate answer correctness, citation coverage, and context size rather than assuming diverse retrieval is always better.
Say this in the interview
Maximum marginal relevance balances similarity to the query against redundancy among selected results. It can improve context diversity when a vector search returns many near-duplicate chunks, but too much diversity may remove the most useful repeated evidence. Tune it against answer quality, not variety alone.
Keep preparing