FAILURE MAP
← Case archive

FA-98346 / Token sampling filters / Open access

Token sampling: Nucleus filtering excludes the token that crosses p · case 01

Nucleus filtering excludes the token that crosses p.

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

ROOT CAUSE

The candidate that takes cumulative mass past p is discarded before it is appended to the retained prefix.

THE FAILURE

The candidate that takes cumulative mass past p is discarded before it is appended to the retained prefix.

Unsuccessful approach: The attempted strict crossing rule adds one extra token when the cumulative mass exactly equals p.

Case contract

Sort by descending probability then token ID; retain the shortest prefix whose cumulative mass is at least p. For p<=0 keep none; p>1 keeps all.

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(probabilities, p):
    if p<=0:return []
    ranked=sorted(probabilities,key=lambda t:(-probabilities[t],t)); out=[]; mass=0
    for t in ranked:
        mass += probabilities[t]
        if mass > p: break
        out.append(t)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('crossing included',solve({'a':.6,'b':.3,'c':.1},.8),['a','b'])
check('exact boundary',solve({'a':.5,'b':.5},.5),['a'])
check('zero mass target',solve({'a':1.0},0),[])
check('all mass',solve({'a':.6,'b':.4},1),['a','b'])
check('tie order',solve({'z':.5,'a':.5},.5),['a'])
check('empty',solve({},.7),[])
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
crossing included['a']['a', 'b']Failed
exact boundary['a']['a']Passed
zero mass target[][]Passed
all mass['a', 'b']['a', 'b']Passed
tie order['a']['a']Passed
empty[][]Passed

SHA-256 / 9023cb5612ea9f852aab49ce6b85ce79e5fdce965ebc49412bf171ecc529794d

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(probabilities, p):
    if p<=0:return []
    ranked=sorted(probabilities,key=lambda t:(-probabilities[t],t)); out=[]; mass=0
    for t in ranked:
        mass += probabilities[t]
        if mass > p: out.append(t); break
        out.append(t)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('crossing included',solve({'a':.6,'b':.3,'c':.1},.8),['a','b'])
check('exact boundary',solve({'a':.5,'b':.5},.5),['a'])
check('zero mass target',solve({'a':1.0},0),[])
check('all mass',solve({'a':.6,'b':.4},1),['a','b'])
check('tie order',solve({'z':.5,'a':.5},.5),['a'])
check('empty',solve({},.7),[])
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
crossing included['a', 'b']['a', 'b']Passed
exact boundary['a', 'b']['a']Failed
zero mass target[][]Passed
all mass['a', 'b']['a', 'b']Passed
tie order['a', 'z']['a']Failed
empty[][]Passed

SHA-256 / 4c0894742f214c5cfd2dfaa325f2171e45badb9b460d4961421e178b44cc5a69

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

Case digest / d7be039b0f0332c49603abd1e9aececd13514f500efbf97949b8d1ada73053d1