TL;DR
Weight decay is widely used to stabilize LLM pre-training, but standard evaluation metrics hide a major trade-off: as weight decay increases, the model's ability to predict low-frequency tokens degrades dramatically while high-frequency tokens remain unaffected. Because aggregate batch loss is dominated by common words, this performance collapse on rare tokens happens entirely silently.
What Problem Does This Paper Address?
Language modeling is framed as next-token prediction, which is essentially an extreme multi-class classification problem over vocabularies often spanning 32,000 to over 250,000 tokens. Natural language is intrinsically heavy-tailed (Zipfian): in the IMDB corpus, for instance, just 0.01% of vocabulary tokens account for roughly 95% of all token occurrences.
In computer vision, heavy weight decay is known to cause "minority collapse," where classifiers disproportionately sacrifice rare classes to minimize regularized loss. The authors ask: Does standard weight decay introduce the same unfairness in LLMs, silently degrading performance on rare tokens while global training loss looks healthy?
Methods
To evaluate per-token dynamics beyond aggregate loss, the authors track fine-grained metrics across training steps:
- Token-Balanced Training Loss ($L_{\text{tok-bal}}$): Rather than averaging cross-entropy across all tokens in a batch (which biases optimization toward ubiquitous words like "the" or punctuation), this metric computes the cross-entropy loss separately for each token ID and averages equally across unique token types.
- Per-Token Learning Speed ($S$): Measures how rapidly the model learns an individual token by computing the normalized Area Under the Loss Curve ($\text{AUC}$) over training steps $T$, defined as $S = 1 - \frac{\text{AUC}(\mathcal{L})}{T}$.
- Architectures and Scales: Trained Apple OpenELM (270M, 3B parameters) and Qwen2 (0.5B, 1.5B parameters) using AdamW with cosine learning rate schedules across varying weight decay coefficients $\lambda \in [0.0, 2.0]$.
- Theoretical Framing: Leveraged the Unconstrained Features Model (UFM) with non-negative feature activations to mathematically analyze the global minima of regularized cross-entropy under class imbalance.
Datasets
- IMDB: 25,000 text samples (labels discarded) tokenized via Byte Pair Encoding (BPE) with a 32,005 vocabulary size.
- IMDB-xl: An extended dataset adding unsupervised samples, totaling 75,000 text samples.
- CIFAR-10 (Imbalanced benchmark): Used in the appendix to validate analogous minority degradation in vision using a ResNet-9.
Key Insights and Ideas
- The Silent Failure Trap: Monitoring average training loss gives a false sense of security. When increasing weight decay, aggregate loss barely shifts, masking a massive spike in cross-entropy loss on low-frequency tokens.
- Widening Learning Gap: Frequent tokens are learned much faster than rare tokens across all seeds. As weight decay increases, this gap widens: optimization prioritizes steep loss reductions on frequent tokens to balance the parameter-norm penalty.
-
Theoretical Proof of Token Neglect: Analysis under the UFM reveals that a token $k$ is completely neglected (its representation norm collapses to zero, $\mu_k = 0$) whenever its occurrence count satisfies: $$n_k \le \lambda^2 N^2 \frac{V - 1}{V}$$ Furthermore, the derivative $\frac{\partial \ell}{\partial \lambda}$ is strictly larger for tokens with smaller counts $n_k$, proving that higher weight decay structurally penalizes rare tokens faster.
-
Vocabulary Scaling Amplifies the Problem: As modern tokenizers grow from 32k (LLaMA-1/2) to 128k (LLaMA-3) and 256k (Gemma-2), the fraction of low-frequency tokens in the long tail increases dramatically (converging to $\approx 85\%$ of the vocabulary below the 95th frequency percentile).
Key Results
- Aggregate vs. Token-Balanced Loss Divergence: In OpenELM 270M experiments, as weight decay $\lambda$ increased from $0.0$ to $1.0$:
- Standard training loss only slightly drifted from 0.051 to 0.068.
- Token-balanced loss surged from 0.066 to 0.163 (nearly a 2.5× increase).
- Per-token perplexity degraded from 1.069 to 1.177.
- Loss Invariance on Head Tokens: Tokens in the highest frequency bin ($3^9$ to $3^{10}$ occurrences) maintained near-identical low cross-entropy across all values of $\lambda \in [0.0, 2.0]$. In contrast, tokens in the rarest bin ($3^0$ to $3^1$ occurrences) experienced sharp performance loss as $\lambda$ exceeded $0.4$.
Limitations and Future Work
- Model and Corpus Scale: Experiments were restricted to models up to 3B parameters and relatively small datasets (IMDB/IMDB-xl) due to compute constraints of running multi-seed sweeps across multiple $\lambda$ values. Verifying this at 70B+ scales on multi-trillion token pretraining datasets remains open.
- Diagnostic Focus: The authors rigorously expose and formalize this "fairness paradox" but do not propose an alternative regularization algorithm.
- Future Directions: Developing frequency-adaptive weight decay schedules or loss-reweighting schemes that stabilize training without sacrificing rare or specialized domain vocabulary.
Summary updated