IT lexicon › AI & ML › MMR

MMR Maximal Marginal Relevance

AI & ML På svenska → Updated: 2026-07-30

Re-ranking technique that balances relevance against diversity — avoids the top-K being near-duplicates of each other.

Carbonell & Goldstein, 1998. For each candidate: score = λ × similarity(query, doc) − (1−λ) × max similarity(doc, already-selected docs). Pick the one with the highest score, add to the result set, repeat. λ closer to 1 = more relevance-driven, closer to 0 = more diversity-driven. Valuable when a vector DB returns 10 near-identical chunks from the same document — MMR spreads them across different sources. Built into LangChain, LlamaIndex.

← Back to the lexicon