Warmstarting for Scaling Language Models

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

TL;DR

Tuning hyperparameters for massive language models is prohibitively expensive, which is why practitioners rely on methods like $\mu$Transfer ($\mu$P) to transfer optimal hyperparameters zero-shot from small proxy models. This paper introduces Warmed-$\mu$P, a simple technique that combines zero-padded weight transfer with a "shrink-and-perturb" operation using $\mu$P initialization. This approach successfully warmstarts wider target models from tuned smaller checkpoints, accelerating early convergence while preserving the training stability and hyperparameter transfer guarantees of $\mu$P.

What Problem Does This Paper Address?

Training large language models (LLMs) requires careful hyperparameter tuning, but tuning directly at scale is too computationally expensive. The Maximal Update Parameterization ($\mu$P) addresses this by scaling initialization and learning rates such that optimal hyperparameters discovered on a cheap, small base model transfer directly to a larger target model.

However, standard $\mu$P trains the large target model from scratch, discarding the trained weights of the smaller proxy model used during the hyperparameter search. While warmstarting (initializing larger models with smaller pre-trained weights) is widely used to speed up training, standard warmstarting techniques typically assume fixed architectures, use ad-hoc heuristics, or fail to preserve theoretical hyperparameter optimality across scales. The authors investigate whether a target model can be warmstarted directly from the smaller $\mu$P base model without breaking $\mu$P's stability guarantees.

Methods

The authors propose Warmed-$\mu$P, combining zero-padding with the shrink-and-perturb principle adapted for width scaling:

$$\theta^l_{\text{target}} = \lambda_{\text{shrink}} \cdot \text{Pad}_0(\theta^l_{\text{base}}, p, q) + \mathcal{N}\left(0, (\sigma^l_{\mu\text{P}})^2\right)$$

  • Zero-Padding ($\text{Pad}_0$): Weights from a smaller layer of dimension $m \times n$ are expanded to the target layer dimension $p \times q$ by padding new connections with zeros.
  • Shrinking ($\lambda_{\text{shrink}}$): The padded base weights are scaled by a shrinkage factor $\lambda_{\text{shrink}} \in [0, 1]$ (set to $0.4$ based on continual learning literature). Setting $\lambda_{\text{shrink}} = 0$ recovers vanilla-$\mu$P.
  • Perturbation ($\mu$P Initialization): The scaled, padded weights are perturbed by adding noise sampled from a Gaussian distribution with standard deviation $\sigma^l_{\mu\text{P}}$, the standard per-layer initialization recommended by $\mu$P.
  • Training Protocol: When transitioning from the base model to the warmstarted target model, the optimizer state is reinitialized (fresh Adam state), learning rate warmup is disabled, weight decay is set to 0, and training continues on fresh data tokens (no data repetition).

Datasets

  • SlimPajama (6B subset): Used to train decoder-only GPT-2 models (via LitGPT’s GPT-NeoX implementation).
  • All experiments follow compute-optimal allocations (20–30 tokens per parameter) under sub-epoch training so no micro-batch is repeated. Evaluation is measured on a fixed, held-out validation split.

Key Insights and Ideas

  • Shrinking is mandatory for stability: Coordinate checks reveal that keeping base weights unscaled ($\lambda_{\text{shrink}} = 1.0$) or lightly scaled ($\lambda_{\text{shrink}} > 0.6$) causes the $L_1$-norm of layer activations to blow up over training steps across widths. A shrinkage factor around $\lambda_{\text{shrink}} = 0.4$ keeps activation dynamics and weight norms well-behaved, matching the stability of vanilla-$\mu$P.
  • Warmstarting does not eliminate the transition spike: Even though warmstarting drastically improves initial validation loss compared to random initialization, the target model does not immediately inherit the base model's lower validation loss. A loss spike occurs at the transition, but the warmstarted model rapidly drops in loss, overtaking or matching vanilla-$\mu$P under equivalent compute.
  • $\mu$P noise acts as structured regularization: The $\mu$P initialization term acts as a scale-aware perturbation matrix, preventing the expanded model from being stuck in representations optimized strictly for the smaller width.

Key Results

  • Accelerated Convergence: Across width-scaling experiments (e.g., warmstarting 5M, 10M, and 22M base models into target models up to 70M and 120M parameters), Warmed-$\mu$P consistently improved early training convergence compared to vanilla-$\mu$P trained from scratch.
  • Matching or Improving Final Loss: Under compute-matched budgets (20 tokens/parameter, following Hoffmann et al., 2022), Warmed-$\mu$P achieves equal or superior final validation loss across all model scale pairings (e.g., 5M $\rightarrow$ 10M, 22M, 35M, and 70M).
  • Staged / Successive Warmstarting: Progressively scaling a model through intermediate checkpoints (e.g., 5M $\rightarrow$ 22M $\rightarrow$ 70M) achieves comparable final loss to standard training while exposing the lineage to more total tokens at earlier, cheaper compute stages.

Limitations and Future Work

  • Explored Dimensions: The study focuses exclusively on width scaling; scaling along depth, attention head count, or context length was not investigated.
  • Experimental Scale: Experiments were conducted on relatively small transformer models (up to 120M parameters) on a single GPU without weight decay or LR warmup schedules.
  • Loss Recovery Overhead: While convergence is faster, the target model spends non-trivial compute recovering from the initial loss spike post-expansion, meaning the extra tokens consumed by the base model do not yet translate into strictly lower asymptotic loss.
  • Future Directions: Future work includes integrating layer-wise shrinking within the broader $abc$-parameterization framework, testing learned or low-rank matrix growth instead of naive zero-padding, and scaling to multi-billion parameter foundation models.

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