↑↓ move Enter open ⌘K find from any page 256 of 256 tabs
Loading the recording…

Tuning at one width

Training a large model once is expensive; tuning its learning rate by training it many times is out of the question. The hope is to tune a small model and copy the settings over. Under the usual standard parametrization (SP), every weight matrix is drawn with the same std (0.02, GPT-2's) and all weights share one learning rate. Under SP that does not work: the best learning rate shrinks as the model widens, so a value tuned small is too high large. The maximal update parametrization, μP (Yang et al.), rescales the initialisation, the learning rates and two multipliers in the forward pass with the width, so that the best learning rate stays put. Yang et al. called this μTransfer: tune a small proxy, train the large model once.

The page tests it on the shared small GPT at widths 64, 128, 256 and 512, with 4 layers and 4 heads at every width, so the heads widen too. Each width is trained for 500 steps at seven learning rates, 2.5e-4 to 1.6e-2 in factors of 2, under SP and under μP. The Validation loss against learning rate panel draws one curve per width under each.

Why the best learning rate moves

Take one hidden matrix of a layer that sums over inputs. Adam's update has about the same size, the learning rate , in every entry, whatever the gradient's scale. Once training has lined the update up with the layer's input (it is built from those inputs), each output coordinate changes by a sum of aligned terms:

So the same learning rate moves a wider layer's outputs further, and the largest stable learning rate falls like . The initial weights do not have this problem: they are random, their terms add like a random walk, and an std of keeps the outputs the same size. SP gets the update wrong, and with a fixed std of 0.02 it gets the initialisation wrong too.

The μP rules

μP fixes each kind of weight separately. With the width multiplier and base width 256, the shared setup's width:

  • Hidden matrices (q, k, v, attention out, MLP in and out): initial std and learning rate
  • Embeddings (token and position): std and learning rate unchanged, since each output coordinate reads a single row whatever the width
  • Output logits: the tied head's product multiplied by , since the last hidden state's coordinates each move by and their sum would grow like
  • Attention scores: divided by instead of , written as so that it equals SP's scale at the base width; trained queries and keys are correlated, so their dot product grows like

LayerNorm gains and biases keep the base learning rate. At every multiplier is 1 and μP is SP: the page checks that the two models at width 256 have the same initial weights and logits bit for bit and take the same first step. The Per-layer multipliers panel lists every rule at the chosen width.

What the sweep shows

Under SP the best learning rate falls steadily with width: 8e-3 at width 64, 4e-3 at 128 and 256, 2e-3 at 512. The Best learning rate against width panel refines each with the vertex of a parabola through the best grid point and its neighbours: 9.8e-3 at width 64 down to 1.5e-3 at 512, a factor of 6.6. Under μP it stays at 4e-3 from width 64 to 256, with vertices of 3.1e-3, 3.1e-3 and 2.9e-3: the transfer μP promises.

At width 512 μP's best halves as well, to 2e-3 (vertex 1.6e-3). There 4e-3 lands past the cliff where the loss jumps, 3.593 against 2.605 at 2e-3, a cliff the narrower widths reach only at 8e-3. SP falls off at the same place at width 512 (3.537). Over the four widths μP's best moves by a factor of 1.9, SP's by 6.6.

Below the cliff μP's curves never cross: at every learning rate up to 2e-3 the wider model ends lower, as μP predicts. Narrow models gain most from μP: at width 64 its best is 2.865, SP's 3.294. At width 512 the order flips: SP, tuned separately at that width, reaches 2.376 against μP's 2.605. For scale, the same model trained twice on this GPU ends 0.009 apart, because the GPU does not add a gradient up in the same order every run.

The coordinate check

Yang et al. proposed a cheaper test than a sweep: train a few steps at one learning rate and measure the typical size (the RMS entry) of each layer's output at each width. A parametrization whose updates are right keeps every curve flat as the width grows. The Coordinate check panel shows these sizes on 8 validation windows for the embedding output, every attention and MLP output and the logits, at 10 points of each run.

At 2e-3 μP's first MLP output starts at an RMS of 0.039 at every width, while SP's doubles with every doubling of width, from 0.009 at width 64 to 0.082 at 512. μP's logits start smaller the wider the model, 0.64 at width 64 and 0.23 at 512: the readout keeps a wide model's first predictions close to uniform, as μP intends.

At 4e-3 the check shows the cliff. The width-512 model's first attention output grows from 0.012 after step 10 to 1.29 after step 100 under μP, and to 1.55 under SP, while the narrower widths stay below 0.017. μP's rules do not prevent this at width 512, and a sweep of 500-step runs with one seed cannot say why.

Where it came from

Yang and Hu (2021) worked out which parametrizations let every layer keep learning features as the width goes to infinity, and named the one that does the maximal update parametrization. Tensor Programs V (Yang et al., 2021) turned it into μTransfer and showed hyperparameters tuned on a small proxy transferring to a 6.7-billion-parameter GPT-3. Cerebras-GPT (Dey et al., 2023) trained a family of models with μP. Lingle (2024) tested how well μP's learning rate transfers, and Everett et al. (2024) found that other parametrizations transfer too once each layer's learning rate is set and Adam's ε is handled. The Chinchilla tab uses μP for its smaller widths so that one learning rate serves the whole grid.

Papers

  1. Tensor Programs V: Tuning Large Neural Networks via Zero-Shot Hyperparameter Transfer Greg Yang et al. · NeurIPS 2021 Introduces μTransfer: tune a small model under μP and reuse its learning rate at every width, with the coordinate check this tab records.
  2. Feature Learning in Infinite-Width Neural Networks Greg Yang et al. · ICML 2021 Derives the maximal update parametrization, the scaling of initialisation and learning rate under which every layer keeps learning features as the width grows.
  3. Scaling Exponents Across Parameterizations and Optimizers Katie Everett et al. · ICML 2024 Measures how the best learning rate moves with width under standard, μP and other parametrizations with Adam, at scale.
  4. An Empirical Study of μP Learning Rate Transfer Lucas Lingle · arXiv 2024 Tests learning-rate transfer under μP on language models up to 10B parameters, and which changes to the model break it.
  5. Cerebras-GPT: Open Compute-Optimal Language Models Trained on the Cerebras Wafer-Scale Cluster Nolan Dey et al. · arXiv 2023 A family of language models trained with μP, its hyperparameters tuned on a 40M-parameter proxy.

See also