Tuning hyperparameters for massive neural networks is notoriously expensive. Typically, the optimal learning rate changes drastically as you scale up a model's width and depth. If you find the perfect learning rate for a small prototype, applying it to a massive, scaled-up version will almost certainly cause the model to diverge or learn too slowly.
To fix this, the field has developed a patchwork of learning rate scaling rules (most notably Tensor Programs / $\mu$P). However, these rules can be difficult to implement, rely on complex infinite-width asymptotic theories, and are specific to individual optimizers. Switching from Adam to SGD means recalculating all scaling factors.
This paper introduces the modular norm, a mathematically rigorous way to normalize weight updates based on the network's architecture. By wrapping standard optimizers with this norm, the optimal learning rate becomes invariant to the network's width and depth, allowing practitioners to tune on a tiny model and scale up for free.
Rethinking Distance: The Modular Norm
Instead of using standard Euclidean distance to measure weight updates, the authors define a modular norm built directly from the network's structure.
- The Module Abstraction: Neural networks are treated as trees of "modules." Every module has a forward function, a "mass" (which controls how much it is allowed to learn), a "sensitivity" (how it reacts to input changes), and a specific norm (e.g., the spectral norm for a linear layer).
- Recursive Construction: The modular norm of an entire network is built recursively. When layers are composed or concatenated, the framework combines their individual norms using a scaled max ($L^\infty$) combination.
- Normed Optimization: In practice, you don't need to change your base optimizer. You simply take the weight update proposed by Adam or SGD, normalize it so that it has a length of 1 in the modular norm, and then multiply it by your learning rate.
The authors provide a PyTorch package called Modula that automatically infers the architecture's tree structure and computes these norms on the fly using fast online power iteration.
Key Insights and Empirical Triumphs
The authors evaluated their framework on both vision (CIFAR-10 with ResMLP/ResNet) and language tasks (Shakespeare, TinyStories, and OpenWebText with GPT-style Transformers).
- Flawless Hyperparameter Transfer: For a GPT model trained on OpenWebText, a learning rate tuned on a tiny model (width 128, 3 blocks) transferred perfectly to a massive model (width 1024, 64 blocks). This zero-shot transfer worked consistently across different architectures and even transferred seamlessly across context lengths (from 32 up to 1024 tokens).
- SGD's Comeback: Because the modular norm perfectly conditions the updates across layers, "Normed SGD" performs remarkably well, often matching the performance of Adam. This is a massive win for systems engineers, as SGD requires significantly less memory than Adam, which must track second moments.
- Theoretical Elegance: By using the modular norm, the gradient of the neural network becomes rigorously Lipschitz-continuous. This bridges a massive gap between deep learning practice and textbook convex optimization theory, which usually assumes a smoothness that standard neural networks lack.
- Finite over Asymptotic: Unlike $\mu$P, which relies on what happens to a network as its width approaches infinity, the modular norm relies on exact mathematical bounds for the actual, finite network being trained.
Limitations and Future Work
While the results are highly promising, the approach does introduce some overhead. Computing the spectral norms via online power iteration adds a modest ~23% overhead to the training step time. Future work could explore computationally lighter norms, such as the $L^\infty-L^\infty$ operator norm.
Additionally, the theoretical guarantees assume the network's modules remain "well-normed" (well-conditioned) throughout training. While the network is initialized to guarantee this, it isn't actively enforced during training, suggesting a potential role for new regularization techniques. Finally, while learning rate tuning is eliminated at scale, practitioners must still tune the new "mass" parameter for hidden layers on their small proxy model before scaling up.
Summary updated