{"abstract":"Adaptive top-a uses an absolute rather than relative gap.","category":"Token sampling filters","checks":6,"contract":"Sort descending with lexical ties; retain the best token and following tokens while their logit is within a times the best-to-second-best gap. a<=0 retains only the best; singleton and empty inputs are handled.","contract_signature":"scores, a","evaluation_group":"w3-tsf-top-a-adaptive-cutoff","failed_approach":"The attempted strict comparison drops candidates exactly at the scaled boundary, including the sole candidate when the gap is zero.","family":"w3-token-sampling-filters-top-a-adaptive-cutoff","id":"FA-98416","implementations":{"attempt":{"sha256":"c90beb568e02f03fd4974dc7e4998dcb22f41279e359173a36fb589d86edf530","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(scores, a):\n    ranked=sorted(scores,key=lambda t:(-scores[t],t))\n    if not ranked:return []\n    gap=scores[ranked[0]]-(scores[ranked[1]] if len(ranked)>1 else scores[ranked[0]])\n    return [t for t in ranked if scores[ranked[0]]-scores[t]<max(0,a)*gap]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('relative gap',solve({'a':10.0,'b':9.0,'c':8.0},2),['a','b','c'])\ncheck('scaled scores',solve({'a':100.0,'b':90.0,'c':80.0},2),['a','b','c'])\ncheck('zero factor',solve({'a':N,'b':N-1},0),['a'])\ncheck('singleton',solve({'x':N},3),['x'])\ncheck('empty',solve({},2),[])\ncheck('lexical best tie',solve({'z':N,'a':N},1),['a','z'])\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"broken":{"sha256":"f1264d7f821c353a83bc763118833282e72a40b289b321643df4d230e87ad3bc","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(scores, a):\n    ranked=sorted(scores,key=lambda t:(-scores[t],t))\n    if not ranked:return []\n    gap=scores[ranked[0]]-(scores[ranked[1]] if len(ranked)>1 else scores[ranked[0]])\n    return [t for t in ranked if scores[ranked[0]]-scores[t]<=a]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('relative gap',solve({'a':10.0,'b':9.0,'c':8.0},2),['a','b','c'])\ncheck('scaled scores',solve({'a':100.0,'b':90.0,'c':80.0},2),['a','b','c'])\ncheck('zero factor',solve({'a':N,'b':N-1},0),['a'])\ncheck('singleton',solve({'x':N},3),['x'])\ncheck('empty',solve({},2),[])\ncheck('lexical best tie',solve({'z':N,'a':N},1),['a','z'])\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"}},"limitations":"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.","method":"Deterministic executable model with adversarial boundary fixtures.","provenance":{"created_by":"Failure Map","dependencies":"Python standard library","family":"w3-token-sampling-filters-top-a-adaptive-cutoff","generated_at":"2026-09-30T16:48:12.801773+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"A finite, deterministic token-selection contract isolates one decoding operation from model inference and runtime behavior.","root_cause":"The acceptance window is treated as a raw logit distance instead of scaling by the best-second gap.","sha256":"10e70411b37d7e8760c0fa3744db3bdf71038ff1c75eeb62e6b231a34e23dbf2","title":"Token sampling: Adaptive top-a uses an absolute rather than relative gap · case 01","variant":1,"variant_policy":"The fixture code references N, supplied as 1 through 5. Fixed boundary checks may repeat. These records share one mechanism and must remain together in evaluation splits.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":28.936,"exit_code":1,"observations":[{"actual":["a","b"],"check":"relative gap","expected":["a","b","c"],"passed":false},{"actual":["a","b"],"check":"scaled scores","expected":["a","b","c"],"passed":false},{"actual":[],"check":"zero factor","expected":["a"],"passed":false},{"actual":[],"check":"singleton","expected":["x"],"passed":false},{"actual":[],"check":"empty","expected":[],"passed":true},{"actual":[],"check":"lexical best tie","expected":["a","z"],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"relative gap\", \"actual\": [\"a\", \"b\"], \"expected\": [\"a\", \"b\", \"c\"], \"passed\": false}, {\"check\": \"scaled scores\", \"actual\": [\"a\", \"b\"], \"expected\": [\"a\", \"b\", \"c\"], \"passed\": false}, {\"check\": \"zero factor\", \"actual\": [], \"expected\": [\"a\"], \"passed\": false}, {\"check\": \"singleton\", \"actual\": [], \"expected\": [\"x\"], \"passed\": false}, {\"check\": \"empty\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"lexical best tie\", \"actual\": [], \"expected\": [\"a\", \"z\"], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":26.498,"exit_code":1,"observations":[{"actual":["a","b","c"],"check":"relative gap","expected":["a","b","c"],"passed":true},{"actual":["a"],"check":"scaled scores","expected":["a","b","c"],"passed":false},{"actual":["a"],"check":"zero factor","expected":["a"],"passed":true},{"actual":["x"],"check":"singleton","expected":["x"],"passed":true},{"actual":[],"check":"empty","expected":[],"passed":true},{"actual":["a","z"],"check":"lexical best tie","expected":["a","z"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"relative gap\", \"actual\": [\"a\", \"b\", \"c\"], \"expected\": [\"a\", \"b\", \"c\"], \"passed\": true}, {\"check\": \"scaled scores\", \"actual\": [\"a\"], \"expected\": [\"a\", \"b\", \"c\"], \"passed\": false}, {\"check\": \"zero factor\", \"actual\": [\"a\"], \"expected\": [\"a\"], \"passed\": true}, {\"check\": \"singleton\", \"actual\": [\"x\"], \"expected\": [\"x\"], \"passed\": true}, {\"check\": \"empty\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"lexical best tie\", \"actual\": [\"a\", \"z\"], \"expected\": [\"a\", \"z\"], \"passed\": true}], \"passed\": false}\n"}},"member_only":{"stages":["fixed"],"fields":["implementations.fixed","verification.fixed","harness","repair"],"note":"The verified repair, its recorded checks, the repair description, and the scoring harness are available to members."}}