[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-detail-85718-en":3,"doc-seo-85718-105":28,"detail-sidebar-cat-0-en-105":90},{"code":4,"msg":5,"data":6},0,"success",{"doc_id":7,"user_id":8,"nickname":9,"user_avatar":10,"doc_module":4,"category_id":11,"category_name":12,"doc_title":13,"doc_description":14,"doc_content":15,"file_id":16,"file_url":17,"file_type":18,"file_size":19,"view_count":20,"is_deleted":4,"is_public":20,"is_downloadable":20,"audit_status":20,"page_count":11,"language":21,"language_code":22,"site_id":23,"html_lang":22,"table_of_contents":24,"faqs":25,"seo_title":13,"seo_description":14,"update_tm":26,"read_time":27},85718,4398048950312,"Violet","https://ap-avatar.wpscdn.com/avatar/400002538284de19e3c?_k=1778320343897328908",8,"Research & Report","Gauge Dependence and Structured-Output Corruption in Sign-Branched Repetition Penalties: Measurements Across Models","Multiplicative repetition penalties used in major LLM inference engines branch on the sign of each raw logit, even though softmax is invariant to adding a constant to all logits. Because the logit zero-point (a “gauge”) is unconstrained by the training objective, the same repetition_penalty acts differently across checkpoints. Measurements show that at θ=1.3 greedy tokens flip dramatically (58–96%) and structured JSON outputs collapse (valid schema-conformant rate from 97% to 23%). Applying LogitNormalization before the penalty removes both effects.","arXiv :2607 .0979 1v 1 [ cs .LG] 9 Jul 2026  \nGauge dependence and structured-output corruption in sign-branched repetition penalties  \nMeasurements across models, inference stacks, and alternative repetition controls  \nPeter Hollows  \nAbstract  \nThe multiplicative repetition penalty shipped across the LLM inference ecosystem (HuggingFace, vLLM, llama.cpp, and a dozen further engines) branches on the sign of each raw logit (divide positives by θ, multiply negatives) . But the softmax is unchanged by adding a constant to every logit, so a model’s logit zero-point is arbitrary, and the sign-branch reads that arbitrary point. The sign-branch is itself the accepted fix for an earlier bug, so the accepted fix branches on a quantity the training objective leaves unconstrained. Two measurable consequences follow. (1) The penalty is not well-defined: re-centring a model’s logits by a constant is a provable no-op at θ = 1, yet at a routine θ = 1 .3 it changes 58–96% of greedy tokens, where subtractive and normalized penalties change none; real checkpoints sit at widely different zero-points, so a fixed repetition_penalty is a different operation on every model. (2) It corrupts structured output: on 200 real-world JSON schemas, θ = 1 .3 drops the rate of valid, schema-conformant output from 97% to 23% . In our measurements, applying the penalty to normalized log-probabilities instead of raw logits removes both effects. HuggingFace already ships that operator (LogitNormalization); today it is off by default and applied after the penalty. This note gives the mechanism, the measurements (five models up to 7B, base and RLHF, on WikiText-103 prefixes; two code models on HumanEval and JSONSchemaBench; both effects replicated inside vLLM and llama.cpp through their own samplers on the same inputs), and the normalized variant.  \n1 The penalty branches on an unconstrained coordinate  \nA repetition penalty is supposed to be a clean scalar knob: set repetition_penalty ≈ 1.1–1.3, get less repetition, and expect it to mean roughly the same thing on any model. The multiplicative form used almost everywhere (HuggingFace’s RepetitionPenaltyLogitsProcessor, vLLM’s repetition_penalty, llama.cpp’s repeat_penalty, all inherited from CTRL [4]) does not have that property; Section 4 surveys how widely the operator ships. It transforms an already-seen token’slogit zi by  \nz′i = (zizi/θθ zizi  00 ((divimuliep)l,y), (1)  \n[i.e. it](i.e. it) branches on the sign of the raw logit. The verbatim implementation is three lines:  \nscore = torch.gather(scores, 1, input_ids)  \nscore = torch.where(score \u003C 0, score * penalty, score / penalty) \\# sign-branch scores_processed = scores.scatter(1, input_ids, score)  \nThe sign-branch is itself a fix: the naive version divided every seen logit by θ, but dividing a negative logit by θ > 1 moves it toward zero and raises the token’s probability, which is backwards; this was  \nz ′  \nidentity (θ = 1)  \npenalty (θ = 1 .3)  \n−5  \nsmaller decrease  \nkink at z = 0 (arbitrary) 5  \nlarger decrease  \nadding c slides the same token across the kink  \ndivide:  \nz/θ  \nmultiply:  \nz  \n· θ  \nraw logit z of a seen token  \nFigure 1: The penalty maps a seen token’s logit z to z ′ : positive logits are divided by θ (shallow slope), negative logits multiplied (steep slope), meeting at a kink at z = 0 . Open marks show each token’s unpenalized value on the identity line; the arrows show the penalty’s decrease, smaller on the divide branch and larger on the multiply branch. Because the softmax does not change when a constant is added to every logit, the model can slide every seen token left or right across this kink without changing any output probability, so the same token can be divided under one gauge and multiplied under another and receive a different penalty.  \nreported to HuggingFace in 2019 [8], and the sign-branch is the accepted remedy. The problem isone level up. The softmax obeys softmax(z+c) = softmax(z) for any scalar c ∈ R, where z+c ad","cbCain7f1SocLSSw","https://ap.wps.com/l/cbCain7f1SocLSSw","pdf",565274,1,"English","en",105,"# The penalty branches on an unconstrained coordinate\n## Gauge invariance and the “kink” at logit zero\n# Consequence 1: the penalty is not well-defined\n## Checkpoint-dependent divide vs multiply behavior\n## Controlled gauge-shift experiments\n# Consequence 2: structured-output corruption\n## JSON-schema validity degradation\n# Normalized variant and results","[{\"question\":\"Why does the sign-branched repetition penalty behave inconsistently across LLM checkpoints?\",\"answer\":\"It branches on whether each raw logit is positive or negative, but the location of the logit zero-point is a gauge that softmax leaves arbitrary. Since training constrains the softmax distribution but not this zero-point, different checkpoints place tokens differently relative to zero, making the same repetition_penalty operate differently.\"},{\"question\":\"What measurable effect does the inconsistency produce on token generation?\",\"answer\":\"At θ=1.3, greedy decoding changes for 58–96% of positions when comparing equivalent gauge-shifted runs, while subtractive and normalized repetition controls show no such changes.\"},{\"question\":\"How does the penalty affect structured outputs like JSON schema conformity, and what fixes it?\",\"answer\":\"On 200 real-world JSON schemas, θ=1.3 reduces valid, schema-conformant output from 97% to 23%. Applying the penalty to normalized log-probabilities (LogitNormalization) instead of raw logits removes both the well-definedness issue and the structured-output corruption.\"}]",1784205774,20,{"code":4,"msg":29,"data":30},"ok",{"site_id":23,"language":22,"slug":31,"title":13,"keywords":32,"description":14,"schema_data":33,"social_meta":85,"head_meta":87,"extra_data":89,"updated_unix":26},"gauge-dependence-and-structured-output-corruption-in-sign-branched-repetition-penalties-measurements-across-models","",{"@graph":34,"@context":84},[35,52,67],{"@type":36,"itemListElement":37},"BreadcrumbList",[38,42,46,49],{"item":39,"name":40,"@type":41,"position":20},"https://docshare.wps.com","Home","ListItem",{"item":43,"name":44,"@type":41,"position":45},"https://docshare.wps.com/document/","Document",2,{"item":47,"name":12,"@type":41,"position":48},"https://docshare.wps.com/document/research-report/",3,{"item":50,"name":13,"@type":41,"position":51},"https://docshare.wps.com/document/gauge-dependence-and-structured-output-corruption-in-sign-branched-repetition-penalties-measurements-across-models/85718/",4,{"url":50,"name":13,"@type":53,"author":54,"headline":13,"publisher":56,"fileFormat":59,"inLanguage":22,"description":14,"dateModified":60,"datePublished":61,"encodingFormat":59,"isAccessibleForFree":62,"interactionStatistic":63},"DigitalDocument",{"name":9,"@type":55},"Person",{"url":39,"name":57,"@type":58},"DocShare","Organization","application/pdf","2026-07-17","2026-07-16",true,{"@type":64,"interactionType":65,"userInteractionCount":20},"InteractionCounter",{"@type":66},"ViewAction",{"@type":68,"mainEntity":69},"FAQPage",[70,76,80],{"name":71,"@type":72,"acceptedAnswer":73},"Why does the sign-branched repetition penalty behave inconsistently across LLM checkpoints?","Question",{"text":74,"@type":75},"It branches on whether each raw logit is positive or negative, but the location of the logit zero-point is a gauge that softmax leaves arbitrary. Since training constrains the softmax distribution but not this zero-point, different checkpoints place tokens differently relative to zero, making the same repetition_penalty operate differently.","Answer",{"name":77,"@type":72,"acceptedAnswer":78},"What measurable effect does the inconsistency produce on token generation?",{"text":79,"@type":75},"At θ=1.3, greedy decoding changes for 58–96% of positions when comparing equivalent gauge-shifted runs, while subtractive and normalized repetition controls show no such changes.",{"name":81,"@type":72,"acceptedAnswer":82},"How does the penalty affect structured outputs like JSON schema conformity, and what fixes it?",{"text":83,"@type":75},"On 200 real-world JSON schemas, θ=1.3 reduces valid, schema-conformant output from 97% to 23%. Applying the penalty to normalized log-probabilities (LogitNormalization) instead of raw logits removes both the well-definedness issue and the structured-output corruption.","https://schema.org",{"og:url":50,"og:type":86,"og:title":13,"og:site_name":57,"og:description":14},"article",{"robots":88,"canonical":50},"index,follow",{"doc_id":7,"site_id":23},{"code":4,"msg":5,"data":91},[92,96,100,104,109,114,119,122,126,129,133],{"id":20,"doc_module":4,"doc_module_name":44,"category_name":93,"show_sort_weight":94,"slug":95},"Story & Novel",90,"story-novel",{"id":45,"doc_module":4,"doc_module_name":44,"category_name":97,"show_sort_weight":98,"slug":99},"Literature",80,"literature",{"id":51,"doc_module":4,"doc_module_name":44,"category_name":101,"show_sort_weight":102,"slug":103},"Exam",70,"exam",{"id":105,"doc_module":4,"doc_module_name":44,"category_name":106,"show_sort_weight":107,"slug":108},5,"Comic",60,"comic",{"id":110,"doc_module":4,"doc_module_name":44,"category_name":111,"show_sort_weight":112,"slug":113},6,"Technology",50,"technology",{"id":115,"doc_module":4,"doc_module_name":44,"category_name":116,"show_sort_weight":117,"slug":118},7,"Healthcare",40,"healthcare",{"id":11,"doc_module":4,"doc_module_name":44,"category_name":12,"show_sort_weight":120,"slug":121},30,"research-report",{"id":123,"doc_module":4,"doc_module_name":44,"category_name":124,"show_sort_weight":27,"slug":125},9,"Religion & Spirituality","religion-spirituality",{"id":27,"doc_module":4,"doc_module_name":44,"category_name":127,"show_sort_weight":27,"slug":128},"World Cup","world-cup",{"id":130,"doc_module":4,"doc_module_name":44,"category_name":131,"show_sort_weight":130,"slug":132},10,"Lifestyle","lifestyle",{"id":134,"doc_module":4,"doc_module_name":44,"category_name":135,"show_sort_weight":105,"slug":136},19,"General","general"]