FAILURE MAP
← Case archive

FA-99516 / Vector retrieval ranking / Open access

Vector retrieval: MMR repeatedly selects the top relevance score · case 01

MMR repeatedly selects the top relevance score.

Verified by executionVariant 1 · 6 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

The first implementation ignores redundancy, and the attempted ranking measures redundancy only against a fixed first choice.

THE FAILURE

The first implementation ignores redundancy, and the attempted ranking measures redundancy only against a fixed first choice.

Unsuccessful approach: A fixed-anchor penalty cannot account for redundancy with later selected vectors.

Case contract

Rows [id,relevance,{other_id: similarity}]; choose max relevance - lambda*maximum similarity to selected IDs iteratively.

Why this case matters

An offline vector retrieval toy model isolates one ranking contract from embedding generation, storage, and serving.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(rows, k, lam):
    return [r[0] for r in sorted(rows,key=lambda r:(-r[1],r[0]))[:k]]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
rows=[['a',0.9,{'b':0.9,'c':0.0}],['b',0.8,{'a':0.9,'c':0.1}],['c',0.7,{'a':0.0,'b':0.1}]]
check('penalty changes second',solve(rows,2,1.0),['a','c'])
check('later redundancy update',solve([['a',0.9,{'b':0.0,'x':0.1,'c':0.0}],['b',0.8,{'a':0.0,'x':0.9,'c':0.0}],['x',0.85,{'a':0.1,'b':0.9,'c':0.0}],['c',0.7,{'a':0.0,'b':0.0,'x':0.0}]],3,1.0),['a','b','c'])
check('lower relevance wins diversity',solve(rows,2,0.5),['a','c'])
check('one choice',solve(rows,1,1.0),['a'])
check('empty',solve([],N,1),[])
check('diverse beats near duplicate',solve([['x',0.8,{'y':0.9,'z':0.1}],['y',0.7,{'x':0.9,'z':0.2}],['z',0.6,{'x':0.1,'y':0.2}]],2,1.0),['x','z'])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
penalty changes second['a', 'b']['a', 'c']Failed
later redundancy update['a', 'x', 'b']['a', 'b', 'c']Failed
lower relevance wins diversity['a', 'b']['a', 'c']Failed
one choice['a']['a']Passed
empty[][]Passed
diverse beats near duplicate['x', 'y']['x', 'z']Failed

SHA-256 / 582783a9999324e2271ab11fb45336e9a87e8194034300b8a905423738b1732f

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(rows, k, lam):
    anchor=max(rows,key=lambda r:r[1])[0] if rows else None
    return [r[0] for r in sorted(rows,key=lambda r:(-(r[1]-lam*r[2].get(anchor,0)),r[0]))[:k]]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
rows=[['a',0.9,{'b':0.9,'c':0.0}],['b',0.8,{'a':0.9,'c':0.1}],['c',0.7,{'a':0.0,'b':0.1}]]
check('penalty changes second',solve(rows,2,1.0),['a','c'])
check('later redundancy update',solve([['a',0.9,{'b':0.0,'x':0.1,'c':0.0}],['b',0.8,{'a':0.0,'x':0.9,'c':0.0}],['x',0.85,{'a':0.1,'b':0.9,'c':0.0}],['c',0.7,{'a':0.0,'b':0.0,'x':0.0}]],3,1.0),['a','b','c'])
check('lower relevance wins diversity',solve(rows,2,0.5),['a','c'])
check('one choice',solve(rows,1,1.0),['a'])
check('empty',solve([],N,1),[])
check('diverse beats near duplicate',solve([['x',0.8,{'y':0.9,'z':0.1}],['y',0.7,{'x':0.9,'z':0.2}],['z',0.6,{'x':0.1,'y':0.2}]],2,1.0),['x','z'])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
penalty changes second['a', 'c']['a', 'c']Passed
later redundancy update['a', 'b', 'x']['a', 'b', 'c']Failed
lower relevance wins diversity['a', 'c']['a', 'c']Passed
one choice['a']['a']Passed
empty[][]Passed
diverse beats near duplicate['x', 'z']['x', 'z']Passed

SHA-256 / 96950219bed84b5684e684512c2f37fcedb5923a3351dc40969c793034fbc08b

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 6 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

Verification & scope

Inputs are small exact toy vectors and scores. No production index, ANN recall, embedding quality, or latency claim is implied. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.

Observations recorded using Python 3.12.14 at 2026-09-30T16:48:24.912931+00:00.

Case digest / 1fa128348987629b0c61cacd67c726a03b3250e76d5d1dc06bbaf4806341e6ce