FA-98341 / Token sampling filters / Open access
Token sampling: Top-k drops the final retained candidate · case 01
Top-k drops the final retained candidate.
ROOT CAUSE
The cutoff subtracts one from a count that is already a slice length.
THE FAILURE
The cutoff subtracts one from a count that is already a slice length.
Unsuccessful approach: Clamping the erroneous k-1 still excludes one valid candidate.
Case contract
Return the k highest-scoring token IDs, ties by ascending ID; k<=0 returns empty and k beyond vocabulary returns all.
Why this case matters
A finite, deterministic token-selection contract isolates one decoding operation from model inference and runtime behavior.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(scores, k):
ranked=sorted(scores,key=lambda t:(-scores[t],t))
return ranked[:max(0,k-1)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('top two',solve({'a':N+2,'b':N+1,'c':N},2),['a','b'])
check('singleton',solve({'a':N},1),['a'])
check('zero',solve({'a':N},0),[])
check('oversized',solve({'b':N,'a':N},9),['a','b'])
check('tie order',solve({'z':N,'a':N},1),['a'])
check('empty',solve({},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 |
|---|---|---|---|
| top two | ['a'] | ['a', 'b'] | Failed |
| singleton | [] | ['a'] | Failed |
| zero | [] | [] | Passed |
| oversized | ['a', 'b'] | ['a', 'b'] | Passed |
| tie order | [] | ['a'] | Failed |
| empty | [] | [] | Passed |
SHA-256 / ead7a2b617ec620bd241b212de4085781dfe758cfe051c1d07f1eb960107de6c
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(scores, k):
ranked=sorted(scores,key=lambda t:(-scores[t],t))
return ranked[:max(0,min(k-1,len(ranked)))]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('top two',solve({'a':N+2,'b':N+1,'c':N},2),['a','b'])
check('singleton',solve({'a':N},1),['a'])
check('zero',solve({'a':N},0),[])
check('oversized',solve({'b':N,'a':N},9),['a','b'])
check('tie order',solve({'z':N,'a':N},1),['a'])
check('empty',solve({},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 |
|---|---|---|---|
| top two | ['a'] | ['a', 'b'] | Failed |
| singleton | [] | ['a'] | Failed |
| zero | [] | [] | Passed |
| oversized | ['a', 'b'] | ['a', 'b'] | Passed |
| tie order | [] | ['a'] | Failed |
| empty | [] | [] | Passed |
SHA-256 / d33875b1ef102eb9318575b3988f312647795b8ad60577e049cd770b9627c5a9
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
These are toy finite-vocabulary contracts with supplied scores, histories, and draws; they do not claim production model quality or compatibility. 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:11.933319+00:00.
Case digest / 588b2c7a5a3a62f28b6c6f8abfcf485450abe6157443443fb7b8be2bfdeef3dd