A thorough reproduction and evaluation of $\mu$P

Georgios Vlassis, David Belius, Volodymyr FomichovTMLR 2024

TL;DR

This paper rigorously reproduces and scales up experiments on the $\mu$P (Maximal Update Parametrization) for neural networks, a technique claimed to stabilize hyperparameters across different network widths. While $\mu$P largely delivers on its promise of stable learning rates and better feature learning, it doesn't consistently lead to improved generalization compared to the standard parametrization (SP).

What Problem Does This Paper Address?

Neural network training is notoriously sensitive to hyperparameter choices, especially learning rates, which often need re-tuning as network size (width) changes. The standard initialization and update scheme (SP) leads to width-dependent activation and gradient scales during training. To combat this, $\mu$P was proposed, aiming to make optimal hyperparameters independent of network width. Despite its theoretical appeal, $\mu$P hasn't seen widespread adoption, possibly due to a lack of extensive, independent validation against SP. This paper aims to fill that gap by conducting a large-scale, independent reproduction and evaluation of $\mu$P's claimed benefits.

Methods

The core of the paper is a direct comparison between the Standard Parametrization (SP) and the Maximal Update Parametrization ($\mu$P). The authors meticulously reproduce the initialization and update rules as described in prior work. They then scale up the experiments significantly, training thousands of neural networks across various architectures and datasets. Key aspects investigated include:

  • Initialization and Scaling: SP initializes weights from a Gaussian distribution with variance inversely proportional to "fan-in," leading to width-dependent scales during training. $\mu$P modifies this scaling to keep these scales width-independent.
  • Hyperparameter Stability: The primary focus is on how the optimal learning rate (and other hyperparameters) changes with network width under both SP and $\mu$P.
  • Empirical Evaluation: The authors track network outputs, gradient updates, weight norms, training loss, and validation loss across a wide range of network widths.

Datasets

The paper utilizes a variety of standard datasets to test the robustness of $\mu$P across different domains:

  • California Housing: A tabular regression dataset.
  • MNIST: A handwritten digit image classification dataset.
  • CIFAR-10: An image classification dataset.
  • Tiny Shakespeare: A text dataset for language modeling.
  • WikiText-103: A larger text dataset for language modeling.

No new benchmarks were introduced; the focus was on evaluating existing methods on established datasets.

Key Insights and Ideas

  • Hyperparameter Stability is Real: $\mu$P demonstrably stabilizes the optimal learning rate across varying network widths, a key theoretical promise that holds up empirically. This is a significant advantage for hyperparameter optimization.
  • Wider is (Usually) Better with $\mu$P: Under $\mu$P, wider networks consistently tend to achieve lower training loss, a trend that is less pronounced or inconsistent under SP.
  • Divergence Mitigation: SP networks are observed to diverge more frequently, especially at larger widths, while $\mu$P networks are significantly more stable in this regard. This is a crucial finding for training very large models.
  • Generalization Gap: Despite stabilizing learning rates and improving training loss trends, $\mu$P does not consistently lead to better validation (generalization) performance. In several cases, the best SP network achieved better generalization.
  • Transformers Benefit Most: The benefits of $\mu$P, particularly in terms of stability and wider networks outperforming narrower ones, appear to be more pronounced for transformer architectures.

Key Results

The paper trained a total of 15,760 neural networks, ranging from 500 to 1 billion parameters.

  • MLP on California Housing: $\mu$P stabilized output norms and gradient updates with width, as predicted. The best $\mu$P network had comparable validation loss to the best SP network, but SP achieved a slightly better minimum training loss.
  • MLP on MNIST: $\mu$P showed a stronger trend of wider networks outperforming narrower ones in training and validation loss. However, SP achieved a better best training and validation loss.
  • VGG11 on CIFAR-10: SP networks diverged significantly more often (74 networks) than $\mu$P networks (0). SP also slightly outperformed $\mu$P in terms of best training and validation loss.
  • ViT on CIFAR-10: $\mu$P stabilized the best learning rate and led to wider networks consistently outperforming narrower ones. However, the best SP network achieved better training and validation loss.
  • Transformer on Tiny Shakespeare: SP networks diverged frequently (74 networks) compared to $\mu$P (0). While $\mu$P offered better stability and wider network advantage, the best SP network achieved slightly better training loss.
  • Transformer on WikiText-103: This was the only setting where $\mu$P significantly outperformed SP in terms of training loss. Both SP and $\mu$P showed good stability and wider network advantage.

Limitations and Future Work

  • Generalization Discrepancy: The most significant limitation is that $\mu$P's benefits in hyperparameter stability and training loss trends do not consistently translate to improved generalization. The paper highlights that future work should investigate why and when $\mu$P networks generalize better than SP counterparts.
  • Hyperparameter Tuning Protocol: The paper suggests comparing the $\mu$Transfer protocol (narrow-to-wide hyperparameter transfer) with training the largest network for fewer iterations, especially for SP, within a fixed compute budget.
  • Theoretical vs. Empirical: While $\mu$P is theoretically well-founded, its empirical advantages in generalization remain an open question. Further research is needed to understand the conditions under which $\mu$P consistently outperforms SP.
  • Specific Architectures: The observed benefits might vary across different architectures not tested in this study.

Summary updated

BibTeX
@article{vlassis2024thorough,
  author = {Georgios Vlassis and David Belius and Volodymyr Fomichov},
  title = {{A thorough reproduction and evaluation of $\textbackslash\{\}mu$P}},
  journal = {Accepted by TMLR},
  year = {2024},
  url = {https://openreview.net/forum?id=AFxEdJwQcp},
}
Figure