FA-98371 / Token sampling filters / Open access
Token sampling: Repetition penalty pushes positive and negative scores alike · case 01
Repetition penalty pushes positive and negative scores alike.
ROOT CAUSE
All seen logits are divided, reversing the intended penalty effect for negative logits.
THE FAILURE
All seen logits are divided, reversing the intended penalty effect for negative logits.
Unsuccessful approach: Multiplying every seen score also pushes positive logits upward.
Case contract
For seen tokens and positive penalty, divide nonnegative logits by penalty and multiply negative logits by penalty; unseen logits stay unchanged.
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, seen, penalty):
return {t:(v/penalty if t in seen else v) for t,v in scores.items()}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('both signs',solve({'a':4.0,'b':-2.0,'c':3.0},['a','b'],2),{'a':2.0,'b':-4.0,'c':3.0})
check('penalty one',solve({'a':-3.0},['a'],1),{'a':-3.0})
check('empty history',solve({'a':N},[],3),{'a':N})
check('zero logit',solve({'a':0.0},['a'],2),{'a':0.0})
check('absent token',solve({'x':-N},['z'],2),{'x':-N})
check('multiple seen',solve({'a':6.0,'b':-1.0},['a','b'],3),{'a':2.0,'b':-3.0})
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 |
|---|---|---|---|
| both signs | {'a': 2.0, 'b': -1.0, 'c': 3.0} | {'a': 2.0, 'b': -4.0, 'c': 3.0} | Failed |
| penalty one | {'a': -3.0} | {'a': -3.0} | Passed |
| empty history | {'a': 1} | {'a': 1} | Passed |
| zero logit | {'a': 0.0} | {'a': 0.0} | Passed |
| absent token | {'x': -1} | {'x': -1} | Passed |
| multiple seen | {'a': 2.0, 'b': -0.3333333333333333} | {'a': 2.0, 'b': -3.0} | Failed |
SHA-256 / b0321cb4834bda2cf1dbd0ebc2f9eabe6ba094bbed076614f4d9ca95c618a54c
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(scores, seen, penalty):
return {t:(v*penalty if t in seen else v) for t,v in scores.items()}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('both signs',solve({'a':4.0,'b':-2.0,'c':3.0},['a','b'],2),{'a':2.0,'b':-4.0,'c':3.0})
check('penalty one',solve({'a':-3.0},['a'],1),{'a':-3.0})
check('empty history',solve({'a':N},[],3),{'a':N})
check('zero logit',solve({'a':0.0},['a'],2),{'a':0.0})
check('absent token',solve({'x':-N},['z'],2),{'x':-N})
check('multiple seen',solve({'a':6.0,'b':-1.0},['a','b'],3),{'a':2.0,'b':-3.0})
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 |
|---|---|---|---|
| both signs | {'a': 8.0, 'b': -4.0, 'c': 3.0} | {'a': 2.0, 'b': -4.0, 'c': 3.0} | Failed |
| penalty one | {'a': -3.0} | {'a': -3.0} | Passed |
| empty history | {'a': 1} | {'a': 1} | Passed |
| zero logit | {'a': 0.0} | {'a': 0.0} | Passed |
| absent token | {'x': -1} | {'x': -1} | Passed |
| multiple seen | {'a': 18.0, 'b': -3.0} | {'a': 2.0, 'b': -3.0} | Failed |
SHA-256 / 826bfd54dae3b0befcd8a3a5a8e5ad406fbd77f3c42791f74369eff927d36f49
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:12.372598+00:00.
Case digest / c2c1e6f640d053cfe6470299f397afd21d4c285b7a49f96471ecaa4effecd1d7