FAILURE MAP
← Case archive

FA-98511 / Beam search bookkeeping / Open access

Beam search: duplicate token paths occupy multiple beam slots · case 01

duplicate token paths occupy multiple beam slots.

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

ROOT CAUSE

Equivalent token sequences reached through different parents are retained separately.

THE FAILURE

Equivalent token sequences reached through different parents are retained separately.

Unsuccessful approach: Keeping the first occurrence ignores a later duplicate with a better score.

Case contract

Rows [token_tuple,score]; return one row per sequence with its highest score, ordered by score descending then sequence.

Why this case matters

Beam decoders rely on consistent hypothesis state while expanding and ranking candidates.

1 / The failure

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

N = 1
observations = []
def solve(rows):
    return sorted(rows,key=lambda r:(-r[1],r[0]))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
rows=[[("a",),-N],[("a",),-1],[("b",),-2]]
check('best duplicate score',solve(rows),[[('a',),-1],[('b',),-2]])
check('unique rows',solve([[('z',),N],[('a',),N+1]]),[[('a',),N+1],[('z',),N]])
check('empty paths',solve([]),[])
check('same empty sequence',solve([[(),0],[(),-1]]),[[(),0]])
check('equal score sequence tie',solve([[('z',),N],[('a',),N]]),[[('a',),N],[('z',),N]])
check('single path',solve([[('x',),N]]),[[('x',),N]])
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
best duplicate score[[['a'], -1], [['a'], -1], [['b'], -2]][[['a'], -1], [['b'], -2]]Failed
unique rows[[['a'], 2], [['z'], 1]][[['a'], 2], [['z'], 1]]Passed
empty paths[][]Passed
same empty sequence[[[], 0], [[], -1]][[[], 0]]Failed
equal score sequence tie[[['a'], 1], [['z'], 1]][[['a'], 1], [['z'], 1]]Passed
single path[[['x'], 1]][[['x'], 1]]Passed

SHA-256 / 06ba0b554a55ab6b81ef2dd04966afc75f8121ea6f9e1904260c54f60e5bca5a

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(rows):
    return sorted({r[0]:r for r in rows}.items(),key=lambda x:(-x[1][1],x[0])) and [max([r for r in rows if r[0]==seq],key=lambda r:r[1]) for seq in dict.fromkeys(r[0] for r in rows)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
rows=[[("a",),-N],[("a",),-1],[("b",),-2]]
check('best duplicate score',solve(rows),[[('a',),-1],[('b',),-2]])
check('unique rows',solve([[('z',),N],[('a',),N+1]]),[[('a',),N+1],[('z',),N]])
check('empty paths',solve([]),[])
check('same empty sequence',solve([[(),0],[(),-1]]),[[(),0]])
check('equal score sequence tie',solve([[('z',),N],[('a',),N]]),[[('a',),N],[('z',),N]])
check('single path',solve([[('x',),N]]),[[('x',),N]])
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
best duplicate score[[['a'], -1], [['b'], -2]][[['a'], -1], [['b'], -2]]Passed
unique rows[[['z'], 1], [['a'], 2]][[['a'], 2], [['z'], 1]]Failed
empty paths[][]Passed
same empty sequence[[[], 0]][[[], 0]]Passed
equal score sequence tie[[['z'], 1], [['a'], 1]][[['a'], 1], [['z'], 1]]Failed
single path[[['x'], 1]][[['x'], 1]]Passed

SHA-256 / dc6cf3d5c41cb94b1cea36a30a89798c0fb1238c4f20dfba2b5c50fea2b60326

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

This is a finite toy beam-state contract and makes no claim about neural model quality or production decoding. 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:13.669357+00:00.

Case digest / b69572e1fe5f2abbfe279b67faabeb60d658d7215e2a2b0db50e406af401d410