Before you move a control in the demo, say what you expect to change.
Foundation reference
Weight Initialization: Xavier, He & µP
Weight initialization sets the parameters before training, including the scale of the random starting weights. A poor choice can make activations or gradients vanish or explode across layers, preventing the network from training.
Study guide
Where to start
Why does scaling the weight standard deviation as 1/√n keep the variance of each layer's output roughly equal to that of its input?
How to study this pagePredict · Check · Generalize · Continue
Compare what the demo shows with the key equation and with the papers cited below.
Identify the part of the idea that survives a change of notation or model, so you can recognize it in another paper or system.
Use the prerequisites and related concepts at the end of the page to fill the next gap.
Why It Matters for Modern Models
- Weight initialization sets the parameters before training, including the scale of the random starting weights. A poor choice can make activations or gradients vanish or explode across layers, preventing the network from training.
- µP makes hyperparameters transferable across model widths: Yang et al. (2021) tuned a 40-million-parameter model and, with the transferred settings, outperformed the published results of the 6.7-billion-parameter GPT-3.
- Initialization scale decides how very wide networks train: under the standard and NTK parametrizations they behave like kernel methods and stop learning features, while µP keeps feature learning at every width (Yang & Hu, 2021).
Questions to Think About
- ReLU sets about half of its inputs to zero; why does He initialization double the variance to compensate?
- Why must the learning rate of a hidden layer shrink as the layer gets wider for its updates to stay the same size, as µP prescribes for Adam?
Interactive Demo
Core Math
If you prefer intuition first, try the demo above, then come back for the math.
Initialization sets the scale of the random starting weights so that signals neither shrink nor blow up as they pass through many layers.
Xavier/Glorot (for tanh and similar activations) balances the variance of signals in the forward and backward passes (Glorot & Bengio, 2010):
He/Kaiming (for ReLU) doubles the variance to make up for the half of the inputs that ReLU sets to zero (He et al., 2015):
µP (maximal update parametrization) also scales the learning rate with width, so that each layer's updates stay the same size as the model grows. For hidden weight matrices trained with Adam:
up to constant factors, with separate rules for the input and output layers (Yang et al., 2021). Under µP, the best hyperparameters found on a narrow model carry over to a wide one.