AI State of the Art
SOTA/Training: Modern Training Techniques/33 min
Section 96

μP and μTransfer: Tuning Hyperparameters on a Small Model

Listen as a podcast →

A Story: Cooking for 500

You have to cook for 500 people. Obviously you're not going to run ten full-scale trials to find the right amount of salt, each trial would cost a fortune in ingredients. So you do what any sensible cook does: you test in a small pot, find the right dose, and multiply.

Except everyone has had the unpleasant surprise: the recipe that works for four doesn't work for five hundred. Salt doesn't scale linearly, cooking time isn't the same, the spices turn overpowering. The optimal setting moved when you changed scale.

That is exactly the problem with training large language models. And μP (say "mu-P") is the answer: a way of rewriting the recipe so the optimal dose stops moving when you change scale.

In One Sentence

Tune the hyperparameters on a tiny model, then carry them straight over to the large one without searching again. The saving isn't marginal: dozens of full training runs are replaced by dozens of toy runs plus a single full run.

The Problem: The Optimal Learning Rate Drifts

The learning rate (LR) is the size of the step the model takes at each weight update. It's the single most sensitive knob in the whole training run: twice too large and the loss explodes and never comes back; twice too small and you burn half your compute budget for nothing.

A hyperparameter is a setting you choose yourself before launching training, as opposed to the parameters (the weights), which the model learns on its own.

How do people find the right LR? Historically: by hand, by trying. You launch ten training runs with ten values, look at which one gives the best loss, and keep that one. That's a sweep, or a grid search when you try every combination of several knobs systematically.

On a 100-million-parameter model that's fine: ten runs of a few hours. On a 70-billion-parameter model it's absurd, and the absurdity can be put in numbers. Meta reports that training Llama 2 70B consumed 1,720,320 GPU-hours, close to two million hours for one run. Nobody is going to do ten of those just to compare learning rates.

Llama 2: Open Foundation and Fine-Tuned Chat Models

Why You Can't Just Reuse the Small Model's Setting

Because under the usual parametrization, the optimum drifts downward as the model grows. You can see it from a single source, which avoids comparing different recipes: the GPT-3 paper's hyperparameter table gives the learning rate chosen for each of the eight sizes trained, with the rest of the recipe held identical.

GPT-3 modelParametersLearning rate
Small125M6.0 × 10⁻⁴
Medium350M3.0 × 10⁻⁴
Large760M2.5 × 10⁻⁴
XL1.3B2.0 × 10⁻⁴
2.7B2.7B1.6 × 10⁻⁴
6.7B6.7B1.2 × 10⁻⁴
13B13B1.0 × 10⁻⁴
175B175B0.6 × 10⁻⁴
Language Models are Few-Shot Learners (GPT-3)

The reading is clean: the model grows by a factor of 1,400 and the learning rate is divided by 10. Llama 2 tells the same story over a shorter range: 3.0 × 10⁻⁴ for the 7B and 13B models, 1.5 × 10⁻⁴ for the 34B and 70B.

So the setting found in the small pot is plainly wrong in the big one. And because the drift isn't exactly predictable (these are engineering choices, not the measured minima of a curve fitted at every size) you end up guessing.

The real cost of guessing

The true cost of hyperparameter tuning isn't the compute spent sweeping. It's the risk of botching the one run you can afford. A 70B run that diverges after three days is machine time you never get back, on a cluster whose every day was booked weeks in advance.

The Idea Behind μP: Make the Optimum Scale-Insensitive

The Maximal Update Parametrization (μP) starts from a theoretical question: what happens inside a network as its width goes to infinity?

Width here means the dimension of the internal layers, a transformer's dmodeld_{\text{model}}. It's the main lever when you make a model bigger.

Why the Optimum Drifts, in One Picture

Before the theory, the intuition, and it's simple. A neuron in an internal layer performs a sum: it adds up the contributions of every neuron in the previous layer. Double the width and it adds twice as many terms. The sum is therefore larger, mechanically, with nothing else having changed.

Consequence: at the same learning rate, a weight update has a bigger effect in a wide network than in a narrow one. The step that is "the right size" for a small model is too long for a large one, which is exactly the drift visible in the GPT-3 table.

μP amounts to cancelling that width effect where it arises, layer by layer, so the magnitude of the updates stays the same at any width. If the updates keep the same size, the ideal step length no longer changes, and the optimum stops moving.

The Three Possible Regimes

Greg Yang and Edward Hu showed that, depending on how you set initializations and per-layer learning rates, you land in radically different regimes in the limit:

  • either activations explode as width grows: unstable training;
  • or they collapse, and the internal layers barely move: the network behaves like a frozen linear model and stops learning real representations (the so-called "lazy", or tangent-kernel, regime);
  • or (the balance point) every layer keeps learning at a rate that doesn't depend on width.

That third regime is μP. "Maximal update" means exactly that: you pick the parametrization that produces the largest possible learning in each layer without letting the activations diverge, at any width.

The Tensor Programs series

The theoretical foundation is the Tensor Programs series by Greg Yang and co-authors. The infinite-width feature-learning regime is established in Tensor Programs IV, and the practical application to hyperparameter tuning in Tensor Programs V, which introduces both μP and μTransfer.

Feature Learning in Infinite-Width Neural Networks (Tensor Programs IV, Yang & Hu) Tensor Programs V: Tuning Large Neural Networks via Zero-Shot Hyperparameter Transfer (Yang et al., 2022)

The Practical Consequence

If the scale of the updates no longer depends on width, then the "loss versus learning rate" curve overlays from one width to the next. The trough of the curve stays where it is. And if the trough doesn't move, you can go looking for it where looking is cheap.

That is the only statement worth carrying out of this section. Everything else is the detail of the compensations needed to get it.

The Mechanism, Step by Step

Concretely, μP doesn't change the architecture. It changes three things, layer by layer, as a function of width:

  1. the initialization variance of the weights;
  2. a multiplier applied to the layer's output;
  3. the learning rate specific to that layer.

You first fix a base width n0n_0 (the toy model's, say 256), then a scaling factor:

m=nn0m = \frac{n}{n_0}

where nn is the target model's width and n0n_0 the toy's. The formula says: mm is how many times wider the target model is than the toy. Toy width 256, target width 4,096, and m=16m = 16.

You then split the weights into three families that don't behave alike:

Weight familyWhat changes with width
Input (embeddings, biases)initialization and learning rate stay constant
Hidden layers (the internal matrices)initialization as 1/fan_in1/\text{fan\_in} as usual; Adam learning rate divided by mm
Output (the head that produces vocabulary scores)multiplier of 1/m1/m; learning rate divided by mm

The term fan_in\text{fan\_in} means the number of inputs a given neuron receives, that is, the width of the layer feeding it.

Why the output layer gets its own rule

Hidden layers receive a very large number of inputs whose individual errors average out and partly cancel: the sum grows like the square root of the width. The output layer instead compresses the whole width into a small number of scores, and its contributions add up coherently rather than cancelling: the sum grows like the width itself.

That's why it is damped by 1/n1/n (proportional to width) and not by 1/n1/\sqrt{n} (proportional to the root) like the rest of the network. This is μP's technical core: each type of layer gets its own scaling law, because each type of layer accumulates differently.

Conventions vary

The exact constants depend on the implementation: Microsoft's mup library, the versions built into training frameworks, and u-μP (below) don't adopt the same normalization conventions. What matters isn't memorizing the table above, it's the idea: layers don't share one scaling law, and they have to be handled separately.

There's also a detail in attention: μP recommends normalizing attention scores by dividing by dd rather than by the standard transformer's d\sqrt{d}, where dd is the dimension of each attention head. Same logic as above, the standard version assumes partial cancellation between terms, μP corrects for the actual accumulation.

μTransfer: The Procedure

Once the network is written in μP, the procedure becomes mundane, and that's the whole point:

  1. Fix a small base width (typically a few hundred dimensions), keeping everything else identical to the target model: same architecture, same tokenizer, same data, same shape of learning rate schedule.
  2. Sweep the hyperparameters on that toy model: learning rate, initialization scale, multipliers, attention temperature. Dozens of short runs, for a negligible slice of the total budget.
  3. Transpose: apply the μP scaling rules to convert the values found to the target width.
  4. Launch the large run once, with those values, no sweep.

This is zero-shot transfer: nothing gets re-tested at the large scale. Hence the name μTransfer.

Cerebras-GPT: the whole procedure, published

Cerebras documented the procedure in public. Hyperparameters were tuned on a 40-million-parameter toy model, then carried along the μP scaling rules up to a 2.7-billion-parameter model, roughly 70 times bigger.

The most telling detail sits in their configuration table: the five models of the μP family, from 111 million to 2.7 billion parameters, share the same learning rate, 6.0 × 10⁻³. Compare with the GPT-3 table at the top of this page, where that same column varies by a factor of 10. It's precisely what μP promises, made visible in one table row.

Cerebras-GPT: Open Compute-Optimal Language Models Trained on the Cerebras Wafer-Scale Cluster

What Transfers, and What Doesn't

This is where honesty is required, because the promise is often told more broadly than what has actually been demonstrated.

Width: Where the Theory Holds

Transfer along width is the demonstrated case. It's what μP was built to solve, and it's what works best in practice.

Depth: Considerably Trickier

Plenty of people assume "μP transfers along depth too". That's too optimistic. μP is a theory of width. Depth took separate work:

  • Tensor Programs VI introduces Depth-μP, a depthwise parametrization of residual networks, and the same paper shows fundamental limitations as soon as blocks contain several layers, which is precisely the case for modern transformer blocks.
  • Bordelon and co-authors independently reach a neighbouring prescription (scaling the residual branch by 1/L1/\sqrt{L}, where LL is the number of layers) and verify transfer along width and depth on ResNets and vision transformers.

So: not impossible, but not free, and not what plain μP hands you.

Tensor Programs VI: Feature Learning in Infinite-Depth Neural Networks (Depth-μP) Depthwise Hyperparameter Transfer in Residual Networks: Dynamics and Scaling Limit (Bordelon et al.)

The Other Axes: Empirical, With Caveats

The original paper also reports usable transfer along batch size, sequence length and training duration, but presents it explicitly as empirical, with warnings, not as a theoretical guarantee. Treat it as a useful observation, not a theorem.

What Plainly Doesn't Transfer

The regularization hyperparameters, dropout, weight decay. The reason is intuitive: the right dose of regularization depends on the ratio of model size to amount of data. And that ratio is exactly what you change when you scale up. There's no reason for the optimum to stay put, and it doesn't.

HyperparameterTransfers along width
Learning rateYes, the central case
Initialization scaleYes
Layer multipliers, attention temperatureYes
Batch size, duration, sequence lengthEmpirical, with caveats
DepthNeeds Depth-μP; known limits on transformers
Weight decay, dropoutNo

What Is Known About Real Use

μP shows up in several public training pipelines, but its practical record is more nuanced than the promotional message.

An independent empirical study by Lucas Lingle tested learning rate transfer up to 10 billion parameters and 190 billion tokens, with ablations up to 1.2 billion parameters. The verdict is broadly positive, with documented edge cases: some common architectural or optimization tricks can break the transfer. The practical lesson: μP transfers well provided the toy model and the large model really are the same recipe, not merely the same family.

An Empirical Study of μP Learning Rate Transfer (Lingle, 2024)

More recent work goes further and argues that, under modern training conditions, tuning weight decay matters at least as much as μP in keeping the optimal learning rate stable. The debate is unsettled; the thing to take away is that crediting all of that stability to μP alone is probably a simplification.

Weight Decay may matter more than muP for Learning Rate Transfer in Practice

Finally, μP has engineering-minded descendants. u-μP combines μP with unit scaling: the aim is for activations, weights and gradients all to start at a scale of 1, which yields near-optimal defaults and makes reduced-precision training far more workable. It's a typical example of μP's second life: less "tune the hyperparameters", more "make low-precision training numerically sound".

u-μP: The Unit-Scaled Maximal Update Parametrization

What μP Doesn't Solve

  • It isn't magic. μP removes the width-driven drift of the optimum. It says nothing about the right data mixture, the right architecture, or the right number of tokens, for that last one, see the Chinchilla scaling laws.
  • It says nothing about regularization. This is the most concrete limitation: weight decay and dropout still have to be set at the large scale, therefore by judgement.
  • The implementation is a trap. A convention error on a single weight family silently destroys the transfer: nothing crashes, you simply get a bad learning rate. It has to be verified, for instance by showing the loss-versus-rate curves genuinely overlay across three different widths before trusting the transfer.
  • The theory is asymptotic. It describes the infinite-width limit. At real widths you're in an approximation, generally good, not exact.
  • It isn't the only approach. Some teams prefer to fit a scaling law empirically for learning rate and batch size: measure the optimum at several small sizes, fit a curve, extrapolate. More artisanal, but it doesn't require rewriting the model.
Time Transfer: On Optimal Learning Rate and Batch Size In The Infinite Data Limit

Why It Matters

Because it changes the nature of the problem. Without μP, picking the learning rate of a very large model is a bet: you extrapolate an intuition, cross your fingers, and find out three weeks of compute later. With μP it becomes a measurement: you look for the optimum where it's cheap, and you carry it over.

It's also what makes training "wind tunnels" credible, the practice of running dozens of small models to settle the configuration of one big one. Without a parametrization that preserves the optimum, those small experiments tell you nothing reliable about the large one.

And for anyone looking at this from an industrial angle: μP is a clear case of a theoretical result translating directly into compute savings, which explains how quickly it was picked up in production training pipelines.

Key Points

  1. The problem: under the usual parametrization the optimal learning rate moves as the model grows (divided by 10 between the smallest and largest members of the GPT-3 family) so you can't tune small and reuse large.
  2. The cause, without algebra: widening a layer increases the number of terms each neuron adds up, hence the size of the updates, hence the right step length.
  3. μP (Maximal Update Parametrization) reparametrizes initializations, multipliers and learning rates layer by layer as a function of width, to cancel that effect exactly.
  4. The consequence: the loss-versus-learning-rate curve overlays from one width to the next, so the optimum stays put, and that's what makes transfer possible.
  5. μTransfer: sweep the hyperparameters on a toy model, apply the scaling rules, launch the large run once with no re-testing. Cerebras did it from 40 million to 2.7 billion parameters, with an identical learning rate across the whole family.
  6. What transfers: width (demonstrated), with the learning rate, initialization and multipliers. What doesn't: regularization. What's delicate: depth, which needs Depth-μP and hits known limits on transformer blocks.
  7. Caveats: large-scale empirical studies are broadly favourable but document cases where transfer breaks, and recent work suggests weight decay matters at least as much as μP in the stability observed.
Check your understanding0 / 5

1. What is the central promise of muTransfer?

2. Under the usual parametrization, why does the optimal learning rate drop as the model gets wider?

3. Which hyperparameters plainly do not transfer with muP, even along width?

4. A team has just implemented muP and wants to launch the big run right away. What is the danger, and how do you keep it in check?

5. According to the page, what is the real cost of hyperparameter tuning for a 70-billion-parameter model?