Gauge dependence and structured-output corruption in sign-branched repetition penalties: measurements across models, inference stacks, and alternative repetition controls
cs.LG, cs.CL
Submitted: 2026-07-09
Updated: 2026-09-02
Comments: 10 pages, 2 figures, 6 tables. v2: adds matched-suppression comparison, per-model calibration map, and mechanism test. Code, data, per-stack survey and git genealogy: https://github.com/captainpete/repetition-penalty-gauge
Code: https://github.com/captainpete/repetition-penalty-gauge
License: http://creativecommons.org/licenses/by/4.0/
The gist: The multiplicative repetition penalty shipped across the LLM inference ecosystem (HuggingFace, vLLM, llama.
Terminology
Abstract
The 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 theta, multiply negatives). But the softmax is unchanged by adding a constant to every logit, so a model's logit zero-point is arbitrary (a gauge choice), and the sign-branch reads it. Two measurable consequences follow. (1) The penalty is not well-defined: re-centering a model's logits by a constant is a provable no-op at theta=1, yet at a routine theta=1.3 it changes 58-96% of greedy tokens, while 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, theta=1.3 drops the rate of valid, schema-conformant output from 97% to 23%. Applying the penalty to normalized log-probabilities instead of raw logits removes the gauge dependence by construction; HuggingFace's beam search has applied its processor chain, penalty included, to log-probabilities since at least v4.0.0, so repetition penalty already names two different operators depending on decoding strategy. Because equal theta is not equal strength across the two operators, we also compare them at matched suppression, calibrated per model by search: there the normalized operator is statistically no worse on any quality metric measured, but on four of seven models it cannot match the raw operator's suppression at theta >= 1.15, and on six of seven at theta=1.3, the setting where the corruption was measured. This note gives the mechanism, the measurements (five models up to 7B; two code models; both effects replicated inside vLLM and llama. cpp through their own samplers), the per-model calibration map, and the normalized variant.
Sources
- Evaluating Large Language Models Trained on Code
- JSONSchemaBench: A Rigorous Benchmark of Structured Outputs for Language Models
- LZ Penalty: An information-theoretic repetition penalty for autoregressive language models
- CTRL: A Conditional Transformer Language Model for Controllable Generation
- Pointer Sentinel Mixture Models
Related papers
- Polynomial-Augmented Neural Networks (PANNs) with Weak Orthogonality Constraints for Enhanced Function and PDE Approximation
- AIRL-S: Unifying Reinforcement Learning and Search-Based Test-Time Scaling via Adversarial Inverse Reinforcement Learning
- Transformers as Bayesian In-Context Experimenters: Smoothness-Adaptive Efficient ATE Estimation
- Convergence issues in Relational Concept Analysis based on AOC-posets
- Beliefs Beyond Posteriors: Local-Consistency Optimisation for Bayesian Neural Networks
- Understanding Diffusion Models via Ratio-Based Function Approximation with SignReLU Networks