FAILURE MAP
← Case archive

FA-98396 / Token sampling filters / Open access

Token sampling: Temperature scales normalized probabilities · case 01

Temperature scales normalized probabilities.

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

ROOT CAUSE

Temperature is applied after exponentiation, changing normalization rather than logit sharpness.

THE FAILURE

Temperature is applied after exponentiation, changing normalization rather than logit sharpness.

Unsuccessful approach: Silently returning empty for invalid temperature conceals the contract error and does not implement positive-temperature softmax.

Case contract

For positive temperature, return softmax(logit/temperature) over all tokens; empty input returns empty.

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, temperature):
    import math
    m=max(logits.values(),default=0); ex={t:math.exp(v-m)/temperature for t,v in logits.items()}; z=sum(ex.values())
    return {t:v/z for t,v in ex.items()}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('softens gap',solve({'a':2.0,'b':0.0},2.0)['a'],1/(1+math.exp(-1)))
check('sharpens gap',solve({'a':2.0,'b':0.0},.5)['a'],1/(1+math.exp(-4)))
check('equal logits',solve({'a':N,'b':N},3.0),{'a':.5,'b':.5})
check('empty',solve({},1.0),{})
check('shift invariant',solve({'a':1002.0,'b':1000.0},2.0)['a'],1/(1+math.exp(-1)))
check('single',solve({'x':-9.0},.3),{'x':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
softens gap0.88079707797788230.7310585786300049Failed
sharpens gap0.88079707797788230.9820137900379085Failed
equal logits{'a': 0.5, 'b': 0.5}{'a': 0.5, 'b': 0.5}Passed
empty{}{}Passed
shift invariant0.88079707797788230.7310585786300049Failed
single{'x': 1.0}{'x': 1.0}Passed

SHA-256 / c41c7d89be0fbc8e90a2b904b4faa669edbf4083365409c09a707f144c12eafc

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(logits, temperature):
    import math
    if temperature<=0: return {}
    m=max(logits.values(),default=0); scaled={t:v*temperature for t,v in logits.items()}; m=max(scaled.values(),default=0); ex={t:math.exp(v-m) for t,v in scaled.items()}; z=sum(ex.values())
    return {t:v/z for t,v in ex.items()}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('softens gap',solve({'a':2.0,'b':0.0},2.0)['a'],1/(1+math.exp(-1)))
check('sharpens gap',solve({'a':2.0,'b':0.0},.5)['a'],1/(1+math.exp(-4)))
check('equal logits',solve({'a':N,'b':N},3.0),{'a':.5,'b':.5})
check('empty',solve({},1.0),{})
check('shift invariant',solve({'a':1002.0,'b':1000.0},2.0)['a'],1/(1+math.exp(-1)))
check('single',solve({'x':-9.0},.3),{'x':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
softens gap0.98201379003790850.7310585786300049Failed
sharpens gap0.73105857863000490.9820137900379085Failed
equal logits{'a': 0.5, 'b': 0.5}{'a': 0.5, 'b': 0.5}Passed
empty{}{}Passed
shift invariant0.98201379003790850.7310585786300049Failed
single{'x': 1.0}{'x': 1.0}Passed

SHA-256 / a84fc2edf9f84be253ba4ff1d1a1ba777efd7c066cb5c57acd221fb25eef069c

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

Case digest / 7d3ae79926c85aaf2eee24c211697ee47be7a75a3cd2a040381466556b5aa0c8