FAILURE MAP
← Case archive

FA-98436 / Token sampling filters / Open access

Token sampling: Prompt history is included in repetition adjustment · case 01

Prompt history is included in repetition adjustment.

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

ROOT CAUSE

Only generated tokens are considered, omitting prompt tokens from the repetition history.

THE FAILURE

Only generated tokens are considered, omitting prompt tokens from the repetition history.

Unsuccessful approach: Dropping multiply occurring history tokens loses candidates that still need a one-time presence adjustment.

Case contract

The penalty history is prompt followed by generated tokens; apply the presence penalty once to every scored token in that combined history.

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, prompt, generated, penalty):
    seen=set(generated)
    return {t:v-(penalty if t in seen else 0) for t,v in scores.items()}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('prompt token penalized',solve({'a':4.0,'b':3.0},['a'],[],1),{'a':3.0,'b':3.0})
check('generated token penalized',solve({'b':N},[],['b'],2),{'b':N-2})
check('both sources',solve({'a':5.0,'b':5.0},['a'],['b'],1),{'a':4.0,'b':4.0})
check('empty histories',solve({'x':N},[],[],1),{'x':N})
check('repeated prompt still once',solve({'a':N},['a','a'],[],1),{'a':N-1})
check('unknown history',solve({'x':N},['y'],[],2),{'x':N})
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
prompt token penalized{'a': 4.0, 'b': 3.0}{'a': 3.0, 'b': 3.0}Failed
generated token penalized{'b': -1}{'b': -1}Passed
both sources{'a': 5.0, 'b': 4.0}{'a': 4.0, 'b': 4.0}Failed
empty histories{'x': 1}{'x': 1}Passed
repeated prompt still once{'a': 1}{'a': 0}Failed
unknown history{'x': 1}{'x': 1}Passed

SHA-256 / cc3775fbc239de61f8cf47cb26238da6c3bcc2d40f18deeb98f339deb22a37a0

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(scores, prompt, generated, penalty):
    seen=set(prompt+generated)
    return {t:v-penalty*(1 if t in seen else 0) for t,v in scores.items() if t not in seen or (prompt+generated).count(t)==1}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('prompt token penalized',solve({'a':4.0,'b':3.0},['a'],[],1),{'a':3.0,'b':3.0})
check('generated token penalized',solve({'b':N},[],['b'],2),{'b':N-2})
check('both sources',solve({'a':5.0,'b':5.0},['a'],['b'],1),{'a':4.0,'b':4.0})
check('empty histories',solve({'x':N},[],[],1),{'x':N})
check('repeated prompt still once',solve({'a':N},['a','a'],[],1),{'a':N-1})
check('unknown history',solve({'x':N},['y'],[],2),{'x':N})
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
prompt token penalized{'a': 3.0, 'b': 3.0}{'a': 3.0, 'b': 3.0}Passed
generated token penalized{'b': -1}{'b': -1}Passed
both sources{'a': 4.0, 'b': 4.0}{'a': 4.0, 'b': 4.0}Passed
empty histories{'x': 1}{'x': 1}Passed
repeated prompt still once{}{'a': 0}Failed
unknown history{'x': 1}{'x': 1}Passed

SHA-256 / 8e1e758f3831ff92b8930f391affb347eadfe39ab17a291af47aaa00b05a361c

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

Case digest / 2814a5dd466b246137a0213feaeb69bf16f3c2f93e459872462457ad88f3e546