FA-98531 / Beam search bookkeeping / Open access
Beam search: length counter advances for prompt positions · case 01
length counter advances for prompt positions.
ROOT CAUSE
The bookkeeping count starts at the input prompt length rather than at zero generated tokens.
THE FAILURE
The bookkeeping count starts at the input prompt length rather than at zero generated tokens.
Unsuccessful approach: Subtracting one from total sequence size only works for a one-token prompt.
Case contract
Given prompt token count and generated token batches, return generated length after each step.
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(prompt_length, batches):
return [prompt_length+sum(batches[:i+1]) for i in range(len(batches))]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('prompt excluded',solve(N,[1,1,1]),[1,2,3])
check('multi-token append',solve(2*N,[2,1]),[2,3])
check('no generated tokens',solve(N,[]),[])
check('zero prefix',solve(0,[1]),[1])
check('empty append step',solve(N,[0,1]),[0,1])
check('varying batch sizes',solve(7,[N,2]),[N,N+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 |
|---|---|---|---|
| prompt excluded | [2, 3, 4] | [1, 2, 3] | Failed |
| multi-token append | [4, 5] | [2, 3] | Failed |
| no generated tokens | [] | [] | Passed |
| zero prefix | [1] | [1] | Passed |
| empty append step | [1, 2] | [0, 1] | Failed |
| varying batch sizes | [8, 10] | [1, 3] | Failed |
SHA-256 / c19a7f491f9baa313707d7d51468628ba1eec2172f8bb59397b526d823f2d27a
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(prompt_length, batches):
return [prompt_length+sum(batches[:i+1])-1 for i in range(len(batches))]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('prompt excluded',solve(N,[1,1,1]),[1,2,3])
check('multi-token append',solve(2*N,[2,1]),[2,3])
check('no generated tokens',solve(N,[]),[])
check('zero prefix',solve(0,[1]),[1])
check('empty append step',solve(N,[0,1]),[0,1])
check('varying batch sizes',solve(7,[N,2]),[N,N+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 |
|---|---|---|---|
| prompt excluded | [1, 2, 3] | [1, 2, 3] | Passed |
| multi-token append | [3, 4] | [2, 3] | Failed |
| no generated tokens | [] | [] | Passed |
| zero prefix | [0] | [1] | Failed |
| empty append step | [0, 1] | [0, 1] | Passed |
| varying batch sizes | [7, 9] | [1, 3] | Failed |
SHA-256 / bb6855008090f5ec0053d8ec842b30dae1bef934647dca697531e1ae498837b4
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:14.106361+00:00.
Case digest / 794ff6b0d48330ee073d39476b50e13a8e04a7cc673b12b44774bd9de8f48864