# µP & Muon: Scaling Optimizers to Infinite Width | Stanford CS312 Lecture 4 with Tatsunori Hashimoto

## Executive summary

This lecture explores the theoretical limits of scaling neural networks, moving beyond the limitations of the Neural Tangent Kernel (NTK) to derive the µP framework. µP establishes constraints (stability and non-triviality) on parameterization (ABC parameterization) to ensure that models remain stable and continue feature learning as width approaches infinity. This theoretical work leads to the development of Muon, a spectral optimizer that uses Newton-Schulz iteration to achieve updates in the operator norm, providing a method for robust, large-scale training.

## Key takeaways

- NTK Limitations: The Neural Tangent Kernel (NTK) limit is unstable for deep learning because, with O(1) learning rates and 1/sqrt(M) output scaling, weights change minimally as width grows, leading to a regression on fixed gradient features with no feature learning (0% performance on word analogy tests).
- The µP Framework: µP (maximal update parameterization) seeks to achieve both stability (activations remain at O(1) scale) and non-triviality (logits continue to change) by manipulating three variables: output scale (A), initialization scale (B), and learning rate scale (C).
- Muon's Mechanism: Muon is an idealized spectral optimizer that replaces the gradient's singular values with ones (UV transpose), effectively performing steepest descent inside an operator-norm ball. This is implemented using the Newton-Schulz iteration to avoid the computational cost of Singular Value Decomposition (SVD).
- Alignment and Constraints: The stability of activations and gradients requires satisfying a series of constraints (e.g., $A_i + B_i = 1/2$ for intermediate layers). The alignment variables ($ ext{alpha}, ext{omega}, U$) measure the correlation between weights and activations, which must be controlled to ensure updates are non-vanishing.

## Technical details

- ABC Parameterization: This technique involves introducing three exponents (A, B, C) to control the scaling of per-layer output, initialization, and learning rates, respectively, allowing the optimal learning rate to remain constant as width scales.
- Activation Stability: Stability requires that activations remain at a controlled scale (e.g., $O(1)$) as width increases. The lecture demonstrates that Kaiming initialization satisfies this stability property at initialization.
- Muon Implementation: Muon uses the Newton-Schulz iteration to approximate the operation $G G^T G^{-1/2}$, which effectively transforms the gradient into $UV^T$ (dropping singular values) for matrix parameters, while scalar parameters are updated using AdamW.

## Practical implications

- Muon provides a method for training large-scale models more reliably than standard parameterizations, as the optimal learning rate is stable across different widths.
- The use of spectral optimizers (Muon) allows for significant gains in optimizing language modeling workloads, even when compared to sophisticated methods like AdamW.
- The framework encourages a shift from inscrutable scaling law fitting to leading-order magnitude calculations to derive practical scaling constraints for model design.

## Topics

Deep Learning, Optimization Algorithms, Scaling Laws, Spectral Theory, Neural Networks, Everett et al. paper, Greg Yang and others paper, Keller Jordan's blog

Source: https://www.youtube.com/watch?v=bZCbIoeY1fQ
