FAILURE MAP
← Case archive

FA-98391 / Token sampling filters / Open access

Token sampling: A banned token remains in normalized output · case 01

A banned token remains in normalized output.

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

ROOT CAUSE

The ban list is ignored, so a forbidden token receives mass and suppresses survivors.

THE FAILURE

The ban list is ignored, so a forbidden token receives mass and suppresses survivors.

Unsuccessful approach: The attempted version emits zero-probability keys when every candidate is banned.

Case contract

Return softmax probabilities for tokens not in banned; renormalize over survivors, returning empty if none survive.

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(logits, banned):
    import math
    m=max(logits.values(),default=0); ex={t:math.exp(v-m) for t,v in logits.items()}; z=sum(ex.values())
    return {t:p/z for t,p in ex.items()}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('ban high score',solve({'x':10.0,'a':0.0,'b':0.0},['x']),{'a':.5,'b':.5})
check('all banned',solve({'a':N},['a']),{})
check('nothing banned',solve({'a':0.0,'b':0.0},[]),{'a':.5,'b':.5})
check('single survivor',solve({'a':4.0,'b':2.0},['b']),{'a':1.0})
check('empty logits',solve({},[]),{})
check('unknown banned id',solve({'a':N},['z']),{'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
ban high score{'a': 4.5395807829510914e-05, 'b': 4.5395807829510914e-05, 'x': 0.9999092083843409}{'a': 0.5, 'b': 0.5}Failed
all banned{'a': 1.0}{}Failed
nothing banned{'a': 0.5, 'b': 0.5}{'a': 0.5, 'b': 0.5}Passed
single survivor{'a': 0.8807970779778823, 'b': 0.11920292202211755}{'a': 1.0}Failed
empty logits{}{}Passed
unknown banned id{'a': 1.0}{'a': 1.0}Passed

SHA-256 / 231740e309554b36d90ef0ccbeb846b529bb37caec549831469c12f523c3c74e

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(logits, banned):
    import math
    m=max(logits.values(),default=0); ex={t:math.exp(v-m) for t,v in logits.items()}; z=sum(ex.values())
    return {t:p/z for t,p in ex.items() if t not in banned}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('ban high score',solve({'x':10.0,'a':0.0,'b':0.0},['x']),{'a':.5,'b':.5})
check('all banned',solve({'a':N},['a']),{})
check('nothing banned',solve({'a':0.0,'b':0.0},[]),{'a':.5,'b':.5})
check('single survivor',solve({'a':4.0,'b':2.0},['b']),{'a':1.0})
check('empty logits',solve({},[]),{})
check('unknown banned id',solve({'a':N},['z']),{'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
ban high score{'a': 4.5395807829510914e-05, 'b': 4.5395807829510914e-05}{'a': 0.5, 'b': 0.5}Failed
all banned{}{}Passed
nothing banned{'a': 0.5, 'b': 0.5}{'a': 0.5, 'b': 0.5}Passed
single survivor{'a': 0.8807970779778823}{'a': 1.0}Failed
empty logits{}{}Passed
unknown banned id{'a': 1.0}{'a': 1.0}Passed

SHA-256 / f3cf0bff46328c980e3595973782dae61ba0b3a898a21ee27025fefb7a8fd001

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

Case digest / bd1571a184f2bcf22ed6b86cf733f8e39e63bdc5878d958b8c8ca7179552e373