{"abstract":"Repetition penalty pushes positive and negative scores alike.","category":"Token sampling filters","checks":6,"contract":"For seen tokens and positive penalty, divide nonnegative logits by penalty and multiply negative logits by penalty; unseen logits stay unchanged.","contract_signature":"scores, seen, penalty","evaluation_group":"w3-tsf-repetition-sign-aware","failed_approach":"Multiplying every seen score also pushes positive logits upward.","family":"w3-token-sampling-filters-repetition-sign-aware","id":"FA-98371","implementations":{"attempt":{"sha256":"826bfd54dae3b0befcd8a3a5a8e5ad406fbd77f3c42791f74369eff927d36f49","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(scores, seen, penalty):\n    return {t:(v*penalty if t in seen else v) for t,v in scores.items()}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('both signs',solve({'a':4.0,'b':-2.0,'c':3.0},['a','b'],2),{'a':2.0,'b':-4.0,'c':3.0})\ncheck('penalty one',solve({'a':-3.0},['a'],1),{'a':-3.0})\ncheck('empty history',solve({'a':N},[],3),{'a':N})\ncheck('zero logit',solve({'a':0.0},['a'],2),{'a':0.0})\ncheck('absent token',solve({'x':-N},['z'],2),{'x':-N})\ncheck('multiple seen',solve({'a':6.0,'b':-1.0},['a','b'],3),{'a':2.0,'b':-3.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":"b0321cb4834bda2cf1dbd0ebc2f9eabe6ba094bbed076614f4d9ca95c618a54c","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(scores, seen, penalty):\n    return {t:(v/penalty if t in seen else v) for t,v in scores.items()}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('both signs',solve({'a':4.0,'b':-2.0,'c':3.0},['a','b'],2),{'a':2.0,'b':-4.0,'c':3.0})\ncheck('penalty one',solve({'a':-3.0},['a'],1),{'a':-3.0})\ncheck('empty history',solve({'a':N},[],3),{'a':N})\ncheck('zero logit',solve({'a':0.0},['a'],2),{'a':0.0})\ncheck('absent token',solve({'x':-N},['z'],2),{'x':-N})\ncheck('multiple seen',solve({'a':6.0,'b':-1.0},['a','b'],3),{'a':2.0,'b':-3.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-repetition-sign-aware","generated_at":"2026-09-30T16:48:12.372598+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":"All seen logits are divided, reversing the intended penalty effect for negative logits.","sha256":"c2c1e6f640d053cfe6470299f397afd21d4c285b7a49f96471ecaa4effecd1d7","title":"Token sampling: Repetition penalty pushes positive and negative scores alike · 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":27.55,"exit_code":1,"observations":[{"actual":{"a":8.0,"b":-4.0,"c":3.0},"check":"both signs","expected":{"a":2.0,"b":-4.0,"c":3.0},"passed":false},{"actual":{"a":-3.0},"check":"penalty one","expected":{"a":-3.0},"passed":true},{"actual":{"a":1},"check":"empty history","expected":{"a":1},"passed":true},{"actual":{"a":0.0},"check":"zero logit","expected":{"a":0.0},"passed":true},{"actual":{"x":-1},"check":"absent token","expected":{"x":-1},"passed":true},{"actual":{"a":18.0,"b":-3.0},"check":"multiple seen","expected":{"a":2.0,"b":-3.0},"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"both signs\", \"actual\": {\"a\": 8.0, \"b\": -4.0, \"c\": 3.0}, \"expected\": {\"a\": 2.0, \"b\": -4.0, \"c\": 3.0}, \"passed\": false}, {\"check\": \"penalty one\", \"actual\": {\"a\": -3.0}, \"expected\": {\"a\": -3.0}, \"passed\": true}, {\"check\": \"empty history\", \"actual\": {\"a\": 1}, \"expected\": {\"a\": 1}, \"passed\": true}, {\"check\": \"zero logit\", \"actual\": {\"a\": 0.0}, \"expected\": {\"a\": 0.0}, \"passed\": true}, {\"check\": \"absent token\", \"actual\": {\"x\": -1}, \"expected\": {\"x\": -1}, \"passed\": true}, {\"check\": \"multiple seen\", \"actual\": {\"a\": 18.0, \"b\": -3.0}, \"expected\": {\"a\": 2.0, \"b\": -3.0}, \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":28.647,"exit_code":1,"observations":[{"actual":{"a":2.0,"b":-1.0,"c":3.0},"check":"both signs","expected":{"a":2.0,"b":-4.0,"c":3.0},"passed":false},{"actual":{"a":-3.0},"check":"penalty one","expected":{"a":-3.0},"passed":true},{"actual":{"a":1},"check":"empty history","expected":{"a":1},"passed":true},{"actual":{"a":0.0},"check":"zero logit","expected":{"a":0.0},"passed":true},{"actual":{"x":-1},"check":"absent token","expected":{"x":-1},"passed":true},{"actual":{"a":2.0,"b":-0.3333333333333333},"check":"multiple seen","expected":{"a":2.0,"b":-3.0},"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"both signs\", \"actual\": {\"a\": 2.0, \"b\": -1.0, \"c\": 3.0}, \"expected\": {\"a\": 2.0, \"b\": -4.0, \"c\": 3.0}, \"passed\": false}, {\"check\": \"penalty one\", \"actual\": {\"a\": -3.0}, \"expected\": {\"a\": -3.0}, \"passed\": true}, {\"check\": \"empty history\", \"actual\": {\"a\": 1}, \"expected\": {\"a\": 1}, \"passed\": true}, {\"check\": \"zero logit\", \"actual\": {\"a\": 0.0}, \"expected\": {\"a\": 0.0}, \"passed\": true}, {\"check\": \"absent token\", \"actual\": {\"x\": -1}, \"expected\": {\"x\": -1}, \"passed\": true}, {\"check\": \"multiple seen\", \"actual\": {\"a\": 2.0, \"b\": -0.3333333333333333}, \"expected\": {\"a\": 2.0, \"b\": -3.0}, \"passed\": false}], \"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."}}