Why can't you initialize all weights to zero? What do Xavier and He initialization actually do?
Type it the way you would explain it to an interviewer. A few sentences is enough; you can't break anything.
Model answer: the part to lead with
Zero (or any constant) init fails from symmetry: every neuron in a layer computes the identical function, receives the identical gradient, and takes the identical update - they never differentiate, so your wide layer is effectively one neuron. Randomness breaks the symmetry. (Biases can start at zero; the weights' randomness breaks symmetry for them.)
Full worked answer
Zero (or any constant) init fails from symmetry: every neuron in a layer computes the identical function, receives the identical gradient, and takes the identical update - they never differentiate, so your wide layer is effectively one neuron. Randomness breaks the symmetry. (Biases can start at zero; the weights' randomness breaks symmetry for them.)
But random isn't enough - the scale must be right, or activations and gradients shrink/blow up geometrically with depth (the vanishing/exploding problem, baked in at step 0). The principled goal: preserve variance layer to layer.
- Xavier/Glorot init: variance 2/(fan_in + fan_out) - derived for symmetric activations like tanh, balancing forward activation variance and backward gradient variance.
- He/Kaiming init: variance 2/fan_in - accounts for ReLU zeroing half its inputs (halving variance), so it doubles the scale. Standard for ReLU-family networks.
Transformer practice goes further: GPT-2-style recipes use small normal init (std ≈ 0.02) and additionally scale down the residual-branch output projections by 1/√(2·n_layers) - because N residual branches add their variance into the stream, and without this the residual-stream magnitude grows with depth. Embeddings are often tied with the output head, which constrains their scale too. The research-flavoured extension is μP (μTransfer): parameterize init and per-layer LRs so optimal hyperparameters transfer from small to large models - tune on a 40M model, train the 10B with the same settings.
Good candidates connect init to everything else: init, normalization, residuals, and warmup are four coordinated solutions to the same problem - keeping signal propagation well-conditioned in deep networks.
What a good answer covers
- Zero (or any constant) init fails from symmetry
- (Biases can start at zero; the weights' randomness breaks symmetry for them.)
- But random isn't enough - the scale must be right, or activations and gradients shrink/blow up…
- The principled goal: preserve variance layer to layer
- Xavier/Glorot init: variance 2/(fan_in + fan_out) - derived for symmetric activations like tanh,…
Key terms: symmetry · scale · Xavier/Glorot init · He/Kaiming init · μP (μTransfer)
In the glossary: Warmup
Interviewer follow-ups to expect
Derive why fan_in appears in the variance formula for a linear layer. Why do residual networks need the extra 1/√N scaling?
What breaks if you init a transformer with std 0.2 instead of 0.02?
Worked answer from AI-Engineer-Interview-Questions by Om (MIT), reformatted for LLM Prep · answer text last updated 6 November 2026 · scoring and review schedule by LLM Prep