Warmstarting for Scaling Language Models

Neeratyoy Mallik, Maciej Janowski, Johannes Hog, Herilalaina Rakotoarison, Aaron Klein, Josif Grabocka, Frank Hutter · DOI

Abstract

Training large language models (LLMs) is computationally expensive, particularly when performing hyperparameter tuning at scale. While $\mu$Transfer ($\mu$P) provides a framework for zero-shot hyperparameter scaling, training large models from scratch remains a significant bottleneck. This paper proposes a simple yet effective "warmstarting" method that initializes larger target models using the weights of smaller, pre-trained base models. By employing a "shrink-and-perturb" strategy, the authors demonstrate that warmstarting can be seamlessly integrated with $\mu$P, leading to faster convergence and stable training dynamics without sacrificing final model performance.

Introduction

The current paradigm for advancing LLMs involves the simultaneous scaling of model parameters, dataset size, and total compute. However, the cost of finding optimal hyperparameters, such as learning rates, for massive models is often prohibitive. $\mu$Transfer ($\mu$P) addresses this by allowing researchers to tune hyperparameters on small proxy models and transfer them to larger architectures.

Despite the benefits of $\mu$P, the requirement to train large models from scratch persists. Warmstarting, or model growth, offers a potential solution by leveraging existing pre-trained weights. However, traditional warmstarting techniques often rely on complex heuristics that may disrupt the mathematical stability guarantees of $\mu$P. This research investigates a modular warmstarting operation designed to preserve $\mu$P's stability and hyperparameter optimality.

Methodology: The Shrink-and-Perturb Approach

The authors introduce a modular initialization strategy for target models. Instead of complex knowledge distillation, they utilize a three-step process to initialize each layer:

  1. Zero-Padding: The weights from the smaller base model are padded with zeros to match the dimensions of the larger target model.
  2. Shrinking: These padded weights are multiplied by a shrinking factor ($\lambda_{\text{shrink}}$). Empirical testing suggests that $\lambda_{\text{shrink}} = 0.4$ is optimal for maintaining stability.
  3. Perturbation: A noise matrix, initialized according to standard $\mu$P rules, is added to the result.

The resulting formula, $\theta_{\text{target}} = \lambda_{\text{shrink}} \cdot \text{Pad}_0(\theta_{\text{base}}) + \mathcal{N}(0, \sigma_{\mu\text{P}}^2)$, ensures the target model benefits from previously learned features while maintaining the activation scales necessary for $\mu$P stability.

Coordinate checks showing the stability of L1 norms across model widths for different shrinking factors. At $\lambda_{\text{shrink}} = 0.4$, the norms remain stable across widths, whereas higher values lead to instability.

Empirical Results

Faster Convergence and Efficiency

The primary benefit of warmstarting is the significant reduction in initial loss. Across various scale jumps (e.g., 5M to 70M parameters), warmstarted models consistently achieved lower initial validation loss and converged faster than vanilla $\mu$P models trained from scratch. Under a fixed compute budget (FLOPs), warmstarted models matched or slightly outperformed their scratch-trained counterparts.

Train and validation loss curves comparing vanilla $\mu$P and warmstarted (WS) models across various scaling jumps. Warmstarted models show a clear head start in performance.

Stability Across Scales

A critical finding is that the "shrink" factor is essential for stability. Without it (i.e., $\lambda_{\text{shrink}} = 1.0$), activation norms tend to explode as the model width increases. By keeping $\lambda_{\text{shrink}} \le 0.6$, the authors verified that the L1 norm of layer activations remains stable across model widths up to 120M parameters, preserving the core benefits of the $\mu$P framework.

Discussion and Future Work

This study demonstrates that simple zero-padding, when properly scaled and perturbed, is a highly effective method for warmstarting $\mu$P runs. The results suggest that "successive warmstarting"—growing a model in multiple stages—is a viable paradigm for compute-efficient pre-training pipelines.

Limitations: The current study focused on width scaling for models up to 120M parameters using a simplified training setup. Future research will explore scaling in other dimensions (such as depth), testing on much larger models, and incorporating standard training features like weight decay and complex learning rate schedules. Additionally, optimizing the token-compute efficiency of multi-stage growth remains an open area for investigation.

Summary updated

BibTeX
@inproceedings{mallik2024warmstarting,
  author = {Neeratyoy Mallik and Maciej Janowski and Johannes Hog and Herilalaina Rakotoarison and Aaron Klein and Josif Grabocka and Frank Hutter},
  title = {{Warmstarting for Scaling Language Models}},
  booktitle = {AFM @ NeurIPS},
  year = {2024},
  url = {https://openreview.net/forum?id=2SilklW9NA},
}
Figure