FAILURE MAP
← Case archive

FA-98401 / Token sampling filters / Open access

Token sampling: Token bias is applied after repetition adjustment · case 01

Token bias is applied after repetition adjustment.

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

ROOT CAUSE

The repeated-token transform branches on the raw logit and bias is added afterward.

THE FAILURE

The repeated-token transform branches on the raw logit and bias is added afterward.

Unsuccessful approach: Dividing biased scores regardless of sign mishandles a bias that makes a negative logit remain negative.

Case contract

Add per-token bias to base logits first, then apply the sign-aware repetition transform to seen tokens.

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, bias, seen, penalty):
    return {t:((v/penalty if v>=0 else v*penalty) if t in seen else v)+bias.get(t,0) for t,v in scores.items()}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('bias changes sign branch',solve({'a':-2.0},{'a':5.0},['a'],2),{'a':1.5})
check('unseen bias',solve({'a':N},{'a':3.0},[],2),{'a':N+3.0})
check('negative biased logit',solve({'a':-5.0},{'a':1.0},['a'],3),{'a':-12.0})
check('no bias',solve({'a':4.0},{},['a'],2),{'a':2.0})
check('empty',solve({}, {'a':N},['a'],2),{})
check('zero score bias',solve({'a':0.0},{'a':2.0},['a'],2),{'a':1.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 fixtureActualExpectedOutcome
bias changes sign branch{'a': 1.0}{'a': 1.5}Failed
unseen bias{'a': 4.0}{'a': 4.0}Passed
negative biased logit{'a': -14.0}{'a': -12.0}Failed
no bias{'a': 2.0}{'a': 2.0}Passed
empty{}{}Passed
zero score bias{'a': 2.0}{'a': 1.0}Failed

SHA-256 / 33328b4428d82f4ce7a795b2a2289bca70837528a439991184301d5f16350be2

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(scores, bias, seen, penalty):
    out={}
    for t,v in scores.items():
        b=v+bias.get(t,0); out[t]=(b/penalty if t in seen else b)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('bias changes sign branch',solve({'a':-2.0},{'a':5.0},['a'],2),{'a':1.5})
check('unseen bias',solve({'a':N},{'a':3.0},[],2),{'a':N+3.0})
check('negative biased logit',solve({'a':-5.0},{'a':1.0},['a'],3),{'a':-12.0})
check('no bias',solve({'a':4.0},{},['a'],2),{'a':2.0})
check('empty',solve({}, {'a':N},['a'],2),{})
check('zero score bias',solve({'a':0.0},{'a':2.0},['a'],2),{'a':1.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 fixtureActualExpectedOutcome
bias changes sign branch{'a': 1.5}{'a': 1.5}Passed
unseen bias{'a': 4.0}{'a': 4.0}Passed
negative biased logit{'a': -1.3333333333333333}{'a': -12.0}Failed
no bias{'a': 2.0}{'a': 2.0}Passed
empty{}{}Passed
zero score bias{'a': 1.0}{'a': 1.0}Passed

SHA-256 / bb293246d63ec4c17fad2e2e26aeffc77a57017054c4565d54402466d8b64a22

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.802654+00:00.

Case digest / d31f4575878b53ac07fd269e1d7be2517c4cb908d42745720c359ab830287374