Key Moments
µP & Muon: Scaling Optimizers to Infinite Width | Stanford CS312 Lecture 4 with Tatsunori Hashimoto
Key Moments
Infinite-width neural networks can be stable yet fail to learn features, and a new optimization approach called "Muon" offers a way to achieve both stability and feature learning by manipulating singular values.
Key Insights
The Neural Tangent Kernel (NTK) limit, while stable, results in models that do not learn features, performing at chance levels on tasks like word embeddings.
The 'muP' (width mu parameterization) framework allows optimal learning rates to transfer across different model widths by adjusting scaling parameters A, B, and C.
The proposed ABC parameterization involves three knobs: scaling output per layer (A), scaling initialization (B), and scaling learning rate per layer (C), aiming for stable and non-trivial limits.
The Muon optimizer is derived from the idea of optimizing within a spectral norm ball, which effectively removes small singular values and promotes feature learning.
The Newton-Schulz method is used in Muon to efficiently approximate the singular value decomposition (SVD) needed for updates, making it computationally viable.
Empirical studies show that Muon, particularly in large language model training (e.g., Kimi K2), offers significant speedups and improved performance compared to standard optimizers like Adam.
The challenge of scaling neural networks and the limitations of the NTK regime
The lecture begins by addressing the critical importance of scaling in deep learning, particularly focusing on how optimizers should behave as models approach infinite width. A key question is whether existing optimization algorithms remain effective in these extreme limits. The discussion highlights that while simple scaling laws (like FLOPs vs. optimal learning rate) exist, a first-principles understanding of optimizer behavior is desired. A simplified model, akin to NQMs, is proposed to analyze this. The infinite-width limit is explored, leading to the Neural Tangent Kernel (NTK) regime. While the NTK limit ensures stability, it critically fails to learn any meaningful features, performing at chance levels and not capturing semantic structures in data, rendering neural networks useless for tasks like learning word embeddings.
Introducing muP: Parameterization for stable scaling
To address the shortcomings of the NTK regime, the lecture introduces the concept of 'muP' (width mu parameterization). The goal is to find parameterizations that allow for stable scaling without sacrificing feature learning. Instead of scaling all hyperparameters arbitrarily, muP focuses on understanding how specific parameterization choices affect optimization dynamics as width increases. The core idea is to scale the model's width to infinity while keeping other dimensions (like depth, steps, input size) fixed. This requires carefully chosen scaling rules for activations, initializations, and learning rates. The ABC parameterization is introduced as a formalization, with three 'knobs' (A, B, C) controlling the scaling of per-layer output, initialization variance, and per-layer learning rate, respectively. Finding the right values for A, B, and C is key to achieving stable and non-trivial (feature-learning) limits.
Deriving stability conditions using dimensional analysis and induction
The lecture then delves into the mathematical derivation of stability conditions. Using dimensional analysis and an inductive approach, the speaker analyzes the scaling of activations and gradients layer by layer. The base case (first layer) involves understanding the scaling of inputs, weights, and the output activation's norm. For subsequent layers, an inductive hypothesis is made about the incoming activation's norm, and the analysis extends to the output activation's norm, considering that intermediate layers involve square matrices (n x n) as width (n) goes to infinity. This process reveals constraints on the parameters A, B, and C for stable activations and gradients. For instance, for intermediate layers, the sum of exponents related to scaling parameters (AL + BL) needs to be approximately 1/2 for activation stability, while gradient stability imposes related but slightly different constraints. The analysis initially ignores non-linearities for simplicity, focusing on the 'big O' behavior.
The transition to non-trivial learning and the emergence of Muon
While stability is crucial, it's insufficient for learning. The concept of 'non-triviality' – meaning the model's outputs change over time rather than remaining static – is introduced. The failure of the NTK regime highlights the need for optimizers that enable feature learning. This leads to the development of a new optimization approach called 'Muon'. Muon is motivated by the idea of optimizing not just the standard gradient descent steps but by considering the spectral norm of the parameter updates. The core idea is to transform the update step to effectively 'whiten' or remove small singular values from the gradients, ensuring that updates are more robust and contribute to meaningful feature learning. This is achieved by performing an update within a ball defined by the operator norm, rather than the L2 norm used in standard gradient descent.
Muon's mechanics: Spectral norm optimization and Newton-Schulz
Muon's update rule involves decomposing the parameter updates using singular value decomposition (SVD) and then manipulating these singular values. Specifically, it aims to remove small singular values, effectively forcing the updates to be full-rank and promoting feature learning. However, performing SVD at each step is computationally prohibitive. To overcome this, Muon uses the Newton-Schulz method, an iterative fixed-point method that efficiently approximates the required matrix inverse square root, which is equivalent to the desired spectral manipulation without explicit SVD. This allows Muon to operate efficiently, making it practical for large-scale training.
Empirical evidence and practical considerations for Muon
Empirical studies, notably from researchers like Jordan Keller and papers from Kimi (K2), demonstrate Muon's effectiveness. Muon has been shown to significantly speed up training and improve performance on large language models. Practical implementations, like in Kimi's work, involve modifications such as using AdamW for scalar parameters, incorporating momentum, and carefully tuning learning rates to match the update sizes derived from Muon's spectral optimization. The alignment variables (alpha, omega, U) that govern the update structure are crucial, and while theoretical values exist, empirical measurement suggests they evolve during training. The core principle remains: by controlling the spectral properties of the updates, Muon achieves stable and effective feature learning, even at extreme scales.
The underlying theory and the art of optimization
The lecture concludes by emphasizing that while the mathematical derivations provide a framework, there's an element of 'alchemy' and empirical insight in deep learning optimization. The effectiveness of techniques like Muon suggests that simply ensuring stability isn't enough; the way updates interact with the network's spectrum is critical. The use of a quintic (fifth-order) fixed-point iteration in Muon, rather than a cubic or precise fixed point, highlights this empirical aspect, where deviations from perfect spectral whitening can sometimes yield better practical results. This points to a balance between rigorous mathematical theory and empirical discovery in advancing optimization techniques.
Mentioned in This Episode
●Products
●Software & Apps
●Companies
●Studies Cited
●Concepts
●People Referenced
Key Takeaways for Stable and Non-Trivial Neural Network Training
Practical takeaways from this episode
Do This
Avoid This
Common Questions
The primary challenge is ensuring that optimizers remain effective and that the training process is stable and efficient. Without proper scaling, activations and outputs can explode, making the model unusable.
Topics
Mentioned in this video
The lecturer and researcher presenting the concepts of scaling optimizers in deep learning.
Co-author of a paper on muP (width muP) that influenced the lecture's content, particularly regarding tensor programs.
Associated with initialization techniques (e.g., Kaiming initialization) that aim for activation stability, discussed in the context of deep learning theory.
A researcher whose blog and work are cited for explanations and pseudocode related to Muon and its practical implementation.
A simplified model used as a basis for analyzing neural network training dynamics and scaling properties.
Another course taught by the lecturer where similar topics related to muP were previously covered.
Multi-Layer Perceptrons, used as a simplified model structure to abstract the complexities of transformers for analysis.
An optimization algorithm discussed in simplified terms, noting its similarity to sign SGD and its update size being O(1).
Stochastic Gradient Descent, a simplified optimizer discussed for its straightforward update mechanism.
A language model implementation used in speed run tests that demonstrated Muon's efficiency in wall-clock time.
A research entity or company that published a paper on Muon's scalability for LM training and uses Muon in models like Kimi K2.
A theoretical framework for analyzing how neural network optimizers behave as model width scales to infinity, often referred to as 'width muP'.
An initialization strategy that contributes to activation stability in neural networks.
A discussed initialization method that, when paired with specific scaling rules, helps maintain Gaussian-like activation shapes across layers.
A theoretical concept describing a limit of neural networks where weights change minimally, often resulting in behavior closer to linear regression than complex neural learning.
A framework involving three parameters (A, B, C) to control output scale, initialization scale, and learning rate scale, used to analyze stable and non-trivial scaling in neural networks.
An initialization method that ensures activation stability, shown to be a form of stable initialization in the context of muP analysis.
More from Stanford Online
View all 199 summaries
71 minAndrew Ng on Building AI Agents | Stanford CS329Z Fireside Chat with Andrew Ng & Diyi Yang
82 minHow to Evaluate AI Agents: Benchmark Design | Stanford CS329Z Lecture 12 with John Yang
79 minNoisy Quadratic Model, Momentum & Weight Decay | Stanford CS312 Lecture 3 with Tatsunori Hashimoto
31 minPredicting Seed Variance, Warmup & LR Decay | Stanford CS312 Quiz Review with Suhas Kotha
Ask anything from this episode.
Save it, chat with it, and connect it to Claude or ChatGPT. Get cited answers from the actual content — and build your own knowledge base of every podcast and video you care about.
Get Started Free