FA-98491 / Beam search bookkeeping / Open access
Beam search: length normalization changes accumulated search scores · case 01
length normalization changes accumulated search scores.
ROOT CAUSE
The decoder feeds a ranking-only adjustment back into subsequent token accumulation.
THE FAILURE
The decoder feeds a ranking-only adjustment back into subsequent token accumulation.
Unsuccessful approach: Keeping only normalized values and adding new token deltas still corrupts later ranks.
Case contract
Given token deltas and alpha, return prefix raw totals; alpha is reserved for final ranking.
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(deltas, alpha):
return [sum(deltas[:i+1])/(1+alpha*(i+1)) for i in range(len(deltas))]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('raw prefix totals',solve([-N,-2],1),[-N,-N-2])
check('single step',solve([-3],N),[-3])
check('empty steps',solve([],N),[])
check('positive toy deltas',solve([N,1],2),[N,N+1])
check('later negative step',solve([0,-N,-1],.5),[0,-N,-N-1])
check('zero penalty',solve([-1,-1],0),[-1,-2])
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| raw prefix totals | [-0.5, -1.0] | [-1, -3] | Failed |
| single step | [-1.5] | [-3] | Failed |
| empty steps | [] | [] | Passed |
| positive toy deltas | [0.3333333333333333, 0.4] | [1, 2] | Failed |
| later negative step | [0.0, -0.5, -0.8] | [0, -1, -2] | Failed |
| zero penalty | [-1.0, -2.0] | [-1, -2] | Passed |
SHA-256 / d2090e4dc4c24d119d3b46f0a9309cd8be69982064d14ca1c8fe63b2a1bfb28f
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(deltas, alpha):
return [sum(deltas[:i+1])/(1+alpha*i) for i in range(len(deltas))]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('raw prefix totals',solve([-N,-2],1),[-N,-N-2])
check('single step',solve([-3],N),[-3])
check('empty steps',solve([],N),[])
check('positive toy deltas',solve([N,1],2),[N,N+1])
check('later negative step',solve([0,-N,-1],.5),[0,-N,-N-1])
check('zero penalty',solve([-1,-1],0),[-1,-2])
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| raw prefix totals | [-1.0, -1.5] | [-1, -3] | Failed |
| single step | [-3.0] | [-3] | Passed |
| empty steps | [] | [] | Passed |
| positive toy deltas | [1.0, 0.6666666666666666] | [1, 2] | Failed |
| later negative step | [0.0, -0.6666666666666666, -1.0] | [0, -1, -2] | Failed |
| zero penalty | [-1.0, -2.0] | [-1, -2] | Passed |
SHA-256 / 667e568a11f4d867a79673259abcc77ac3aa8e64d431b60c237bbdc5502d183d
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.668730+00:00.
Case digest / 054ba06058dc7a070eca5523c5e882ec9aeca6b2c23422fdf269fb557d57dd7b