Abstract
Hyperparameter (HP) tuning in deep learning is an expensive process, prohibitively so for neural networks (NNs) with billions of parameters. We show that, in the recently discovered Maximal Update Parametrization (muP), many optimal HPs remain stable even as model size changes. This leads to a new HP tuning paradigm we call muTransfer: parametrize the target model in muP, tune the HP indirectly on a smaller model, and zero-shot transfer them to the full-sized model, i.e., without directly tuning the latter at all. We verify muTransfer on Transformer and ResNet. For example, 1) by transferring pretraining HPs from a model of 13M parameters, we outperform published numbers of BERT-large (350M parameters), with a total tuning cost equivalent to pretraining BERT-large once; 2) by transferring from 40M parameters, we outperform published numbers of the 6.7B GPT-3 model, with tuning cost only 7% of total pretraining cost.
Introduction
Hyperparameter (HP) tuning—choosing the right learning rate, initialization scale, and schedule—is often considered the "dark art" of deep learning. While small models can be optimized via grid search or Bayesian methods, massive models like GPT-3 are prohibitively expensive to tune directly. Currently, practitioners often rely on heuristics to guess HPs for large models based on smaller versions. However, in Standard Parametrization (SP)—the default in frameworks like PyTorch—the optimal learning rate shifts as the model width increases. This mismatch often leads to training instability or subpar performance unless massive compute is spent on direct tuning.
The $\mu$Transfer Methodology
The core innovation of this work is Maximal Update Parametrization ($\mu$P). Drawing from the "Tensor Programs" framework, $\mu$P is the unique parametrization that ensures every layer in a network learns at the same rate, even as width goes to infinity. Unlike standard setups where training dynamics can "blow up" as models scale, $\mu$P carefully scales initializations and learning rates to maintain stability.
This stability enables a new pipeline called $\mu$Transfer:
- Parametrize the large target model using $\mu$P.
- Create a "proxy" model that is much narrower and/or shallower.
- Tune HPs on the proxy model using standard optimization techniques.
- Transfer those HPs directly to the large model without further adjustment.
Key Insights: Stability Across Scales
In $\mu$P, the loss landscape remains remarkably consistent across different model widths. As shown in the comparison below, while standard practice requires re-tuning for every increase in width, $\mu$P allows a single set of hyperparameters to remain optimal regardless of scale.
Beyond learning rates, the authors identified critical scaling rules for components like attention. They found that standard Transformer attention ($1/\sqrt{d}$) causes logits to explode as models grow; $\mu$P instead utilizes $1/d$ attention to keep scores stable. This ensures that "wider is better" is a guarantee: increasing width consistently improves training loss for any fixed HP set in $\mu$P.
Empirical Results
The researchers validated $\mu$Transfer across architectures including Transformers and ResNets:
- BERT-Large: By tuning on a tiny 13M parameter proxy, the authors achieved a BERT-large (350M) that outperformed original published results. The total compute spent (tuning + final run) was roughly equal to just one standard pretraining run.
- GPT-3: Applying $\mu$Transfer to a 6.7B parameter GPT-3 model using a proxy 168x smaller (40M params) allowed the model to outperform the original 6.7B version and rival the 13B parameter version. The tuning cost was a mere 7% of the total pretraining budget.
Limitations and Future Work
While $\mu$P provides a robust framework for width transfer, some challenges remain. HPs controlling regularization (like dropout or weight decay) do not transfer as cleanly because they depend on the ratio of model size to data size. Additionally, while width transfer is theoretically grounded, transferring across depth is more fragile and currently works best for specific architectures like Pre-LayerNorm Transformers. Future research aims to incorporate data-dependent regularization and more principled depth scaling into the $\mu$P framework.
Summary updated