| Width parametrization | |
|---|---|
| width, the fan-in of a hidden layer | |
| reference width, where the parametrization coincides with the baseline model (512 for d8) | |
| width multiplier | |
| exponents of the output multiplier , initialization scale , learning rate | |
| width-independent initialization scale, in | |
| width-independent base learning rate; a layer's learning rate is | |
| a layer's output for input | |
| fixed fan-in of an input layer, such as an embedding's one-hot vocabulary | |
| a matrix's actual fan-in | |
| root mean square of the entries, | |
| exact order one as : bounded and bounded away from zero | |
| bounded as | |
| a layer's weight matrix and its value at initialization | |
| a layer's input feature vector | |
| a layer's output at initialization | |
| Alignment | |
| change of the weights since initialization, | |
| change of a layer's input features since initialization | |
| alignment ratio | |
| alignment exponent, ; none, 1 full | |
| initial readout weights, which meet the feature change | |
| loss gradient at a layer's output; one SGD step on one example is | |
| Adam | |
| running means of the gradient and of its square | |
| Adam's normalized direction ; the course writes | |
| Adam's additive constant in the denominator | |
| shared truncated-Gaussian matrix for d8's embedding and readout initialization; the course writes | |
| Depth | |
| number of blocks | |
| reference depth, against which depth is measured by | |
| relative depth (2 in the five-step stress test) | |
| block , whose output is added to the residual stream: | |
| branch multiplier on each block's output, ; counting branch outputs puts it between (aligned branches) and (independent ones) | |
| Muon | |
| a gradient matrix and its singular value decomposition | |
| spectral norm, the largest singular value | |
| radius of the spectral ball on which the idealized Muon step lies | |
Context. As models get wider, a learning rate tuned on a narrow run usually fails on a wide one. On the course's d8 transformer under AdamW (8 layers, about 35M parameters at width 512, 153.6M tokens), the best peak learning rate shrinks almost like 1/width from width 128 to 1,024. Lecture 4 of Hashimoto and Kotha's Stanford course CS 312 (Deep Learning Alchemy) asks how to scale each layer's initialization, output multiplier, and learning rate with width so one base learning rate stays optimal. It also asks what the same scaling logic implies for the update direction itself. The lecture builds on Tensor Programs V (Yang et al., 2021), which turned the maximal-update parametrization (P)a rule for scaling initializations, multipliers and learning rates with width so that every layer keeps changing by order one during training at every width; for Adam the hidden-layer learning rate shrinks like 1/fan-in and the readout is multiplied by 1/width, and hyperparameters tuned at a small width then transfer to large ones (Yang et al., 2021). Reading note: Maximal update parametrization into a proxy-tuning recipe. Its other two readings are Everett et al. (2024), who tested P's assumptions across parametrizations and optimizers up to 26.8B parameters, and Jordan's post on Muonan optimizer that replaces each weight matrix's momentum by the nearest matrix with all singular values equal to 1, for momentum (Jordan et al., 2024). Reading note: Muon.
The scaling exponents come from counting orders of magnitude in width . A layer's output change is the product of its output multiplier, its weight update's size, and an alignment factor. That factor runs from for updates unrelated to the input to for updates aligned with it. Keeping activations of order one at initialization and their changes of order one during training fixes how each layer type scales with width. Under Adam with full alignment, hidden learning rates and the readoutthe output layer, which maps the last hidden features to the logits's output multiplier both scale like . In practice, measured alignment sits between the two extremes and shifts during training. With per-layer exponents and a few constants tuned on a small model, every common parametrization transfers its learning rate. Applying the same count across residual blocks places branch multipliers between and . Constraining the update matrix to be an isometry drops the alignment assumption altogether and yields Muon.
Setting. Following Everett et al., consider a linear layer of fan-in acting on an input , parameterized by three exponents the powers of the width in the layer's output multiplier , initialization scale and learning rate . Reading note: Maximal update parametrization:Here and the base learning rate do not depend on width. Sizes are measured by RMS norms for , the typical size of one coordinate; for a matrix, the root mean square of its entries. Width goes to infinity at a fixed training step , with bounded and bounded away from zero as the width grows; means bounded only denoting exact order one. A parametrization is stable when initial hidden features have and feature changes satisfy , and it learns features when that change is . Nontriviality asks the same of the logits, ruling out degenerate stable choices such as a zero learning rate. Practical implementations express these scalings relative to a reference width the width at which the parametrization coincides with the baseline model, 512 for d8; is the width multiplier, using the width multiplier .
What it changes in practice. Under Adam, scale hidden-matrix learning rates as , give the readout a multiplier with a width-independent initialization, and tune the base learning rate once on a narrow model. Tune per-layer constant multipliers for the embedding, hidden, and readout layers on that same small model. In Everett et al., those constants transferred to 26.8B parameters and improved every Adam parametrization except mean fieldthe parametrization of the mean-field limit of wide networks, with the network's output scaled by 1/width so that the output is an average over neurons; in that limit the features keep learning, unlike in the NTK limit (Mei et al., 2018). Reading note: Mean-field limits of two-layer networks above 2B parameters, where Adam's interferes. With those constants, the standard parametrizationthe usual setup: weights initialized with variance and one global learning rate. Reading note: Maximal update parametrization plus per-layer exponents outperformed P. Scale Adam's with each layer's gradient scale, or remove it, so wide layers do not stall. Across depth, scale residual branches by with matching learning rate and (Depth-P), or by (CompleteP) when blocks add coherently. Weight decay sits outside the recipe. Tensor Programs V lists regularization among the hyperparameters that do not transfer. Norm equilibrium explains why weight decay still matters: a weight's norm forgets its initialization and settles where the learning rate and weight decay put it.
Stability at initialization gives , which is Kaiming initialization. To keep activations from exploding or vanishing before training starts, the initial output must have order-one RMS. Because is independent of , cross terms drop out in expectation:Since , the output RMS scales as times the input RMS, so order-one activations require . Kaiming initialization for ReLU picks , , and . Input layers have a fixed fan-in (an embedding reads a one-hot vector over a fixed vocabulary), so they need . Readouts only need initial logits of order at most one, giving . Initialization alone does not separate training regimes: the standard parametrization, the NTK parametrizationunit-variance weights with each layer's output scaled by , so that an infinitely wide network trains like a fixed kernel, the neural tangent kernel (Jacot et al., 2018). Reading note: The neural tangent kernel, and P all satisfy on hidden layers.
An update moves a layer's output by its size times an alignment factor between and . Once training starts, the weight change shifts the output by . How big that product gets depends on whether lines up with . Define the alignment ratio, how much more the product grows than the sizes of its factors so thatIf has independent centered entries unrelated to , each output coordinate sums random-sign terms and , the central-limit scaling. By contrast, one SGD step on a single example gives , where is the loss gradient at the layer's output. This rank-one matrix has as its right singular vector, so every coordinate sums same-sign terms and , the law-of-large-numbers scaling and Cauchy-Schwarz maximum. Writing puts the alignment exponent the alignment exponent in : for an update unrelated to the input (random signs, the central-limit size) and 1 for an update built from it (same signs, the law-of-large-numbers size) between and 1. At finite fan-in , Everett et al. estimate directly with the log alignment ratio measured at a finite width (the fan-in), an estimate of . The same factor between and governs how the initial readout interacts with the hidden feature change .
Under Adam, full alignment gives and sets distinct exponents for each layer type. Adam updates weights by . Because Adam behaves like sign descent with momentum, its normalized direction , Adam's normalized direction, the running mean of the gradient divided entrywise by the root of the running mean of its square has RMS regardless of gradient scale. With , the update shifts the output byUnder full alignment (), an order-one feature change requires . For a hidden matrix with , this gives , so the learning rate falls like . The other contribution to the output change is , the initial weights acting on the input shift. For a hidden matrix, the Gaussian operator-norm bound already makes that term , so keeps it bounded. At the readout, the output dimension is fixed while fan-in grows, so full alignment between and makes of order . Keeping it order one forces , leaving initial logits small at .
Putting the layer conditions together gives the P recipe for Adam. Let denote a matrix's actual fan-in and , matching the baseline at reference width . One solution sets input layers to , with multiplier 1, initialization variance , and learning rate . Hidden matrices take , with multiplier 1, variance , and learning rate , while the readout takes , with multiplier , variance , and learning rate . Under SGD, the update keeps the gradient's own scale rather than normalizing it away, so the backward pass's exponents enter alongside . Throughout, this count tracks only leading orders and assumes terms do not cancel. Because need not stay , as in , the derivation assumes the update, the initialization, and their interaction do not cancel.
Measured alignment sits between and 1, and per-layer exponents make every parametrization transfer. Everett et al. (2024) test these assumptions on decoder-only transformers across fourteen widths from 128 to 16,384, spanning 9.9M to 26.8B parameters. Each model has 8 blocks and head dimension 128, trained at batch 256 and context 512 for 50,000 steps with no weight decay and warmup followed by cosine decay. They compare SGD, Adam, and Adam with Adafactor's parameter scalingeach update is multiplied by the RMS of the weight it changes, so steps are relative to the weight's size (Shazeer and Stern, 2018) under four parametrizations: standard, NTK, P, and mean fieldthe parametrization of the mean-field limit of wide networks, with the network's output scaled by 1/width so that the output is an average over neurons; in that limit the features keep learning, unlike in the NTK limit (Mei et al., 2018). Reading note: Mean-field limits of two-layer networks. Alignment starts at , since initialization is independent of the data, and rises during training. In Adam's MLP layers it stays at or below 0.8. At the readout, it peaks above 0.9 under P and mean field and between 0.7 and 0.8 under standard and NTK, staying much lower for most of training. Even with partial alignment, full-alignment per-layer exponents paired with tuned per-layer constants keep the swept optimal base learning rate nearly flat across width. The fitted scaling exponents are for standard, for NTK, and for P.
With per-layer exponents and tuned constants, the standard parametrization beats P at scale. Tuning constant learning-rate multipliers for the embedding, hidden, and readout layers at width 1,024 and reusing them at every width improved every Adam parametrization except mean field above 2B parameters. Under this treatment, the best Adam model was the standard parametrization with an order-one embedding learning rate and hidden and readout learning rates. It reached loss 2.572 at 26.8B parameters against 2.599 for P, and its 15.3B model beat the 26.8B P model. Everett et al. trace Tensor Programs V's win for P to comparing per-layer P with tuned constants against a standard parametrization restricted to one global learning rate.
No-alignment exponents fail to absorb width scaling, while parameter scaling changes the winner. No-alignment exponents give larger learning rates than full-alignment ones. When swept at each width, they reached slightly lower loss for NTK, P, and mean field, but the optimal base learning rate fell like to across standard, NTK, and P. Because the base rate had to absorb the width dependence that the exponents omitted, full-alignment exponents give the cleaner transfer law. Under Adam with Adafactor's parameter scaling, which multiplies each update by the existing weight's RMS, global and no-alignment learning rates coincide. That setup performed best and produced the study's overall best model, NTK with no-alignment exponents.
Wide layers stall unless Adam's scales down or disappears. Adam adds to in its denominator, while gradient entries shrink with width; under P, hidden-matrix gradients scale like . With a fixed , set to in Everett et al., wide layers eventually see approach . Their updates then shrink until they stop learning. Mean field has the smallest gradients and hits this wall first, which is why its tuned constants stopped transferring above 2B parameters. Three fixes worked: a smaller constant , a per-layer scaled with that layer's gradient scale, and Adam-atan2Adam with replaced by , which equals the ratio when it is small, is bounded by , and is unchanged when all gradients are multiplied by a constant (Everett et al., 2024), which removes altogether. Depth-scaling prescriptions scale with the branch multiplier for the same reason.
On d8, P keeps the optimal learning rate flat in width. The course builds P from d8's baseline at by changing four settings, with a shared matrix one shared matrix of standard Gaussian draws truncated at , used for both the embedding and the readout initialization in every prescription of truncated Gaussians for embedding and readout initialization. Embedding initialization moves from to , and readout initialization moves from to . The readout multiplier changes from 1 to , and the hidden-matrix peak learning rate moves from to . Across widths 128 to 1,024 at 153.6M tokens, the baseline's optimal base learning rate falls almost like , with fitted exponent about , whereas P keeps it flat. A five-step check at width 640 also measures alignment directly. Over the first five updates, hidden-matrix update alignment lies between about 0.6 and 0.95 (read off a plot), with 0.75 typical.
Fixing the relative step size changes width scaling under Hyperball. Hyperball holds each weight matrix at its initial Frobenius norm and moves it by a Frobenius step of length relative to that norm. Under AdamW, an hidden matrix has initial entries of order , giving Frobenius norm about . Its update entries are of order , giving Frobenius norm about , so its relative step is . Because Hyperball fixes the relative step at regardless of width, its optimal learning rate scales differently with width under d8's baseline parametrization.
Counting over residual branches places the depth multiplier between and . In a residual stack of blocks with branch multiplier the factor on each block's output before it is added to the residual stream, , a function of the depth : 1 in standard P, in Depth-P and in CompleteP, for a reference depth , the branch outputs accumulate. If they add like independent terms, branches sum to size , calling for . If they align coherently, they sum to size , calling for . Combining the depth relative to a reference depth , 2 in the five-step stress test with P's width rules gives three prescriptions for hidden matrices and within-block norms, leaving embeddings, readout, and the final norm unchanged. Standard P keeps , block learning rate , and block . Depth-P takes the no-alignment scaling: , learning rate , and . CompleteP takes the full-alignment scaling: , learning rate , and .
Five-step depth stress tests favor Depth-P for independent blocks. The course runs a five-step stress test at width 64, training for just five updates at depths 2, 100, and 1,000. Standard P's residual stream grows with depth, reaching an initial RMS of about 33 at depth 1,000. Depth-P holds it near 1.3, and CompleteP holds it at 1.0. After five updates at large depth, Depth-P reached the lowest loss, with an optimal learning rate that moved little. CompleteP overcorrected, ending with the highest loss and an optimum that drifted downward. Independently initialized blocks add closer to independent terms than to aligned ones.
Constraining the update to be an isometry removes the alignment assumption and gives Muon. Instead of assuming how updates align with inputs as P does, an optimizer can constrain the update matrix itself. If a square is an isometry, then for every input , regardless of alignment. Minimizing the linearized loss over a ball in the spectral norm, the largest singular value, the most the matrix stretches any vector, , yields for a gradient with SVD , by spectral-nuclear norm duality. In this idealized Muon, matrices step on a spectral ball and scalar parameters step on a Euclidean one. Practical Muon orthogonalizes momentum instead of the raw gradient, replaces the SVD with five Newton-Schulz iterationsa polynomial iteration, in Jordan's version, that pushes a matrix's singular values toward 1 using only matrix products (Jordan et al., 2024). Reading note: Muon, and leaves embeddings, readout, gains, and scalars to AdamW. (The speedrun section's Muon note gives the full derivation.) Moonshot AI's large-scale version (Liu et al., 2025) adds weight decay and rescales each update to AdamW's typical RMS of 0.2.
Two qualifications temper the isometry picture. First, Jordan's quintic Newton-Schulz coefficients do not have 1 as an exact fixed point. The update's singular values land in a band around 1, which the lecture judges harmless. Second, recent experiments find that updates with unequalized singular values, including some with random or inverted spectra, train about as well. Equalizing all singular values is therefore not the entire reason Muon works.
Caveats. The exponent analysis is asymptotic in width at a fixed step count, assumes no cancellation across terms, and treats alignment as constant even though it varies by layer and across training. Choosing between full- and no-alignment exponents therefore remains empirical. Everett et al.'s main comparisons fix 50,000 steps without weight decay, and their appendix notes that compute-optimal horizons may call for steeper learning-rate exponents. P transfers optimization hyperparameters rather than regularizers such as weight decay. The course's own evidence rests on a 35M-parameter model and five-step stress tests, single-seed in places. Hyperball's width drift also differs across setups. The Hyperball paper reports about 1.4 times drift across widths 128 to 2,048 in a hybrid-normalization model trained on 10B tokens per run, with Hyperball on attention and MLP matrices. On d8 (153.6M tokens, with Hyperball also on the readout), the course's runs give fitted exponents of at seed 42 and about at seeds 43 and 44. That is a 2 to 3 times drift from width 128 to 1,024, matching the relative-step calculation above. Because architecture, token budget, parametrization, and readout treatment all differ, neither experiment isolates the cause.
Terms
- abc-parametrization
- , , learning rate
- Stability at initialization
- for hidden layers (Kaiming), for input layers
- Alignment ratio
- : unrelated, rank one built from
- Adam, full alignment
- : hidden learning rate ; readout multiplier with learning rate
- P for Adam (one solution)
- input ; hidden ; readout
- Measured alignment
- starts at , moves during training; MLP at most 0.8, readout peaks above 0.9 under P (Everett et al.)
- Per-layer constants
- embedding, hidden and readout learning-rate factors tuned at small width and reused; improve every Adam parametrization except mean field above 2B
- Epsilon underflow
- gradients shrink with width until ; fix by scaling per layer or with Adam-atan2
- Depth-P, CompleteP
- branch multipliers and : no and full alignment across blocks
- Idealized Muon
Sources
Lecture 4, “Optimization 1: Scaling limits and feature learning, µP, Muon” (Oct 6, 2026), of Stanford CS 312 Deep Learning Alchemy, Fall 2026. Taught by Tatsunori Hashimoto and Suhas Kotha; course staff Kaiyue Wen and Tristan Thrush (CAs).
Course site Lecture slides Online quiz Quiz answers Assignment Assignment code
The lessons, experiments, figures and quiz problems in this note are the course's, shown here with the instructors' permission.
- Tatsunori Hashimoto and Suhas Kotha. CS 312 Deep Learning Alchemy, Lecture 4: Optimization 1, scaling limits and feature learning, µP, Muon. Stanford, Fall 2026.
- Katie Everett, Lechao Xiao, Mitchell Wortsman, Alexander A. Alemi, Roman Novak, Peter J. Liu, Izzeddin Gur, Jascha Sohl-Dickstein, Leslie Pack Kaelbling, Jaehoon Lee, and Jeffrey Pennington. Scaling Exponents Across Parameterizations and Optimizers. ICML, 2024.
- Greg Yang, Edward J. Hu, Igor Babuschkin, Szymon Sidor, Xiaodong Liu, David Farhi, Nick Ryder, Jakub Pachocki, Weizhu Chen, and Jianfeng Gao. Tensor Programs V: Tuning Large Neural Networks via Zero-Shot Hyperparameter Transfer. NeurIPS, 2021.
- Keller Jordan, Yuchen Jin, Vlado Boza, Jiacheng You, Franz Cesista, Laker Newhouse, and Jeremy Bernstein. Muon: An optimizer for hidden layers in neural networks. Blog post, 2024.
- Tatsunori Hashimoto and Suhas Kotha. CS 312 Deep Learning Alchemy, Assignment 2: Hyperparameter Scaling, and Quiz 2 answer slides. Stanford, Fall 2026.
- Song Mei, Andrea Montanari, and Phan-Minh Nguyen. A Mean Field View of the Landscape of Two-Layers Neural Networks. Proceedings of the National Academy of Sciences, 2018.
- Noam Shazeer and Mitchell Stern. Adafactor: Adaptive Learning Rates with Sublinear Memory Cost. ICML, 2018.
- Arthur Jacot, Franck Gabriel, and Clément Hongler. Neural Tangent Kernel: Convergence and Generalization in Neural Networks. NeurIPS, 2018.
Connected notes
- The neural tangent kernelLazy training and feature learning · Scale decides whether features move
Any model becomes lazy, its tangent kernel effectively frozen, when its output scale grows and its initial output is cancelled; for a width- network a output normalization is lazy in the limit and the mean-field is not.
- Transformers Learn In-Context by Gradient DescentIn-context learning · Hyperparameters set what the loss leaves free
In one-layer linear self-attention, the loss depends only on the product and leaves the scale split between the label-value scalar and the key-query matrix free; gradient flow conserves , which pins the limit on the hyperbola of equivalent global minima.
- Softmax attention as a sum of RNNsEfficient sequence models · Additive paths carry signal through depth and time
Linear attention's state is a running sum of key-value products that never forgets. Of Mamba-2's components added one at a time to a 300M model, a data-dependent decay of that sum and a short convolution carry nearly all the gain. Test loss goes from 3.13 to 2.88 with the decay alone, 2.93 with the convolution alone and 2.77 with both, while the other components move it by 0.07 or less.
- Chinchilla scalingScaling laws · Predicting large runs from small ones
Kaplan et al. trained every model on one fixed-length schedule and read compute-optimal points off intermediate steps, and many of their runs are under 100M parameters while the frontier bends, so slopes fitted on small models overpredict model size at large budgets. At FLOPs the 2.80B model chosen by Chinchilla's fit beats the 4.74B model chosen by Kaplan's law.