Initialization of Large Language Models via Reparameterization to Mitigate Loss Spikes

Kosuke Nishida, Kyosuke Nishida, Kuniko Saito

Introduction

Loss spikes—sudden, catastrophic jumps in training loss—are a major hurdle in large language model (LLM) pre-training. These instabilities often force researchers to restart training from a previous checkpoint, wasting significant computational resources. This paper introduces Weight Scaling as Reparameterization (WeSaR), a simple yet effective technique that ensures all model parameters have uniform update sensitivities, effectively mitigating loss spikes and enabling faster, more stable training.

The Problem: Non-Uniform Update Ratios

The authors identify a hidden culprit behind training instability: non-uniform parameter norms. To prevent gradients from vanishing or exploding in deep Transformer architectures, standard initialization methods (like He or Xavier) set different scales for different parameter matrices. For instance, weights in the "down-projection" layers of a feed-forward network are often initialized with much smaller norms than others to account for residual connections.

These small-norm weights are "fragile." Because they are tiny, even a standard-sized update represents a massive percentage change to the weight itself. The authors define this as the update ratio ($\|\Delta W\|/\|W\|$). When certain layers have significantly higher update ratios than others, the model becomes prone to the instabilities that trigger loss spikes.

Figure 1: Training loss (top) and update ratios (bottom) for the proposed WeSaR method versus a baseline. The baseline exhibits a massive loss spike corresponding to a surge in the update ratio, while WeSaR remains stable.

Methods: Weight Scaling as Reparameterization (WeSaR)

WeSaR decouples the mathematical requirements of gradient flow from the physical scale of the parameters through a reparameterization strategy:

  1. Reparameterization: Instead of using a weight matrix $W$ directly, the model introduces a trainable scalar "gate" parameter $\alpha$ for each matrix. The internal "virtual" parameter used by the model is $\bar{W} = \alpha W$.
  2. Uniform Initialization: All "actual" parameters ($W$) are initialized with a common, small standard deviation ($\sigma$) across the entire model. This ensures every parameter starts with the same scale and sensitivity.
  3. Backbone Alignment: The gate parameter $\alpha$ is initialized such that the virtual parameter $\bar{W}$ satisfies standard initialization criteria (like He initialization) required for stable gradient propagation.
  4. Optimizer Compatibility: When used with the Adam optimizer, the scale of $\alpha$ effectively cancels out during the update step. This ensures the update ratio remains stable and uniform across all layers, regardless of the specific architectural constraints.
Figure 4: Comparison of initialization schemes. WeSaR uses a uniform weight initialization (sigma) and shifts the architectural scaling requirements to the gate parameter.

Key Results and Insights

The authors tested WeSaR on Transformer decoders ranging from 130 million to 13 billion parameters, pre-trained on 30 billion tokens from the RefinedWeb dataset.

  • Eliminating Spikes: In 13B parameter models, WeSaR successfully prevented the massive loss spikes observed in standard "Small Initialization" baselines.
  • Superior Performance: WeSaR consistently achieved lower perplexity on WikiText and LAMBADA. For the 1.3B model, it achieved a WikiText score of 14.51 compared to 16.55 for the baseline.
  • Downstream Accuracy: On the SuperGLUE benchmark, the 1.3B model trained with WeSaR outperformed the baseline on almost every task, raising the average score from 51.73 to 57.73.
  • Aggressive Training: WeSaR proved robust enough to handle higher learning rates ($1e-3$) and smaller batch sizes (1M tokens) that typically cause standard initialization methods to crash.

Conclusion

By focusing on the update ratio as a primary indicator of instability, WeSaR provides a computationally efficient way to stabilize LLM training. By decoupling gradient flow requirements from parameter initialization scales, it allows for more aggressive training configurations and improved final model performance without adding significant overhead.

Summary updated

BibTeX
@inproceedings{nishida2024initialization,
  author = {Kosuke Nishida and Kyosuke Nishida and Kuniko Saito},
  title = {{Initialization of Large Language Models via Reparameterization to Mitigate Loss Spikes}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2024},
  doi = {10.18653/v1/2024.emnlp-main.1264},
}
Figure