{"abstract":"Temperature scales normalized probabilities.","category":"Token sampling filters","checks":6,"contract":"For positive temperature, return softmax(logit/temperature) over all tokens; empty input returns empty.","contract_signature":"logits, temperature","evaluation_group":"w3-tsf-temperature-logit-scaling","failed_approach":"Silently returning empty for invalid temperature conceals the contract error and does not implement positive-temperature softmax.","family":"w3-token-sampling-filters-temperature-logit-scaling","id":"FA-98396","implementations":{"attempt":{"sha256":"a84fc2edf9f84be253ba4ff1d1a1ba777efd7c066cb5c57acd221fb25eef069c","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(logits, temperature):\n    import math\n    if temperature<=0: return {}\n    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())\n    return {t:v/z for t,v in ex.items()}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('softens gap',solve({'a':2.0,'b':0.0},2.0)['a'],1/(1+math.exp(-1)))\ncheck('sharpens gap',solve({'a':2.0,'b':0.0},.5)['a'],1/(1+math.exp(-4)))\ncheck('equal logits',solve({'a':N,'b':N},3.0),{'a':.5,'b':.5})\ncheck('empty',solve({},1.0),{})\ncheck('shift invariant',solve({'a':1002.0,'b':1000.0},2.0)['a'],1/(1+math.exp(-1)))\ncheck('single',solve({'x':-9.0},.3),{'x':1.0})\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":"c41c7d89be0fbc8e90a2b904b4faa669edbf4083365409c09a707f144c12eafc","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(logits, temperature):\n    import math\n    m=max(logits.values(),default=0); ex={t:math.exp(v-m)/temperature for t,v in logits.items()}; z=sum(ex.values())\n    return {t:v/z for t,v in ex.items()}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('softens gap',solve({'a':2.0,'b':0.0},2.0)['a'],1/(1+math.exp(-1)))\ncheck('sharpens gap',solve({'a':2.0,'b':0.0},.5)['a'],1/(1+math.exp(-4)))\ncheck('equal logits',solve({'a':N,'b':N},3.0),{'a':.5,'b':.5})\ncheck('empty',solve({},1.0),{})\ncheck('shift invariant',solve({'a':1002.0,'b':1000.0},2.0)['a'],1/(1+math.exp(-1)))\ncheck('single',solve({'x':-9.0},.3),{'x':1.0})\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-temperature-logit-scaling","generated_at":"2026-09-30T16:48:12.372464+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":"Temperature is applied after exponentiation, changing normalization rather than logit sharpness.","sha256":"7d3ae79926c85aaf2eee24c211697ee47be7a75a3cd2a040381466556b5aa0c8","title":"Token sampling: Temperature scales normalized probabilities · 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.579,"exit_code":1,"observations":[{"actual":0.9820137900379085,"check":"softens gap","expected":0.7310585786300049,"passed":false},{"actual":0.7310585786300049,"check":"sharpens gap","expected":0.9820137900379085,"passed":false},{"actual":{"a":0.5,"b":0.5},"check":"equal logits","expected":{"a":0.5,"b":0.5},"passed":true},{"actual":{},"check":"empty","expected":{},"passed":true},{"actual":0.9820137900379085,"check":"shift invariant","expected":0.7310585786300049,"passed":false},{"actual":{"x":1.0},"check":"single","expected":{"x":1.0},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"softens gap\", \"actual\": 0.9820137900379085, \"expected\": 0.7310585786300049, \"passed\": false}, {\"check\": \"sharpens gap\", \"actual\": 0.7310585786300049, \"expected\": 0.9820137900379085, \"passed\": false}, {\"check\": \"equal logits\", \"actual\": {\"a\": 0.5, \"b\": 0.5}, \"expected\": {\"a\": 0.5, \"b\": 0.5}, \"passed\": true}, {\"check\": \"empty\", \"actual\": {}, \"expected\": {}, \"passed\": true}, {\"check\": \"shift invariant\", \"actual\": 0.9820137900379085, \"expected\": 0.7310585786300049, \"passed\": false}, {\"check\": \"single\", \"actual\": {\"x\": 1.0}, \"expected\": {\"x\": 1.0}, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":27.609,"exit_code":1,"observations":[{"actual":0.8807970779778823,"check":"softens gap","expected":0.7310585786300049,"passed":false},{"actual":0.8807970779778823,"check":"sharpens gap","expected":0.9820137900379085,"passed":false},{"actual":{"a":0.5,"b":0.5},"check":"equal logits","expected":{"a":0.5,"b":0.5},"passed":true},{"actual":{},"check":"empty","expected":{},"passed":true},{"actual":0.8807970779778823,"check":"shift invariant","expected":0.7310585786300049,"passed":false},{"actual":{"x":1.0},"check":"single","expected":{"x":1.0},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"softens gap\", \"actual\": 0.8807970779778823, \"expected\": 0.7310585786300049, \"passed\": false}, {\"check\": \"sharpens gap\", \"actual\": 0.8807970779778823, \"expected\": 0.9820137900379085, \"passed\": false}, {\"check\": \"equal logits\", \"actual\": {\"a\": 0.5, \"b\": 0.5}, \"expected\": {\"a\": 0.5, \"b\": 0.5}, \"passed\": true}, {\"check\": \"empty\", \"actual\": {}, \"expected\": {}, \"passed\": true}, {\"check\": \"shift invariant\", \"actual\": 0.8807970779778823, \"expected\": 0.7310585786300049, \"passed\": false}, {\"check\": \"single\", \"actual\": {\"x\": 1.0}, \"expected\": {\"x\": 1.0}, \"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."}}