KatInterview

Why Identical Starting Weights Stall Neural Network Training

Machine LearningModel answer
MediumModel answerMachine Learningweight-initializationbackpropagationsymmetry-breaking

Last updated

Analyze what happens when a feed-forward network starts with every weight and bias at zero, how symmetry persists, and why random scaled initialization resolves it.

Scenario

A refactor of your training code accidentally changes the parameter initializer so that every weight in a feed-forward network is set to exactly 0. Biases are also zero. The network has one or more hidden layers using ReLU, Tanh, Sigmoid, or a linear activation, and is trained with plain gradient descent, w ← w − η · ∂L/∂w.

For concreteness, use a two-layer network:

  • z1 = W1 x + b1, h = f(z1)
  • z2 = W2 h + b2, ŷ = g(z2)
  • loss L(ŷ, y)

What to answer

  1. Work through the forward pass and the backward pass with all parameters at zero. Show precisely which gradients vanish and which do not, and explain what the update rule does over repeated steps.
  2. Define symmetry breaking and explain why optimization needs it.
  3. Describe how the failure differs across activations: linear, Tanh, ReLU, and Sigmoid.
  4. Propose a better initialization (for example Xavier/Glorot or He/Kaiming) and explain why it fixes the problem. Mention how the choice depends on the activation.

Expectations

  • Do the math with explicit gradient expressions rather than just asserting "gradients are zero".
  • Be careful: the failure mode is not identical for every activation.
  • Briefly say what happens if every weight is set to a nonzero constant such as 0.5, and why plain logistic regression is unaffected by zero init.

Hints

Hint 1

Write out the backprop formulas: the gradient for W2 depends on the hidden activation h, and the gradient for W1 depends on W2 transposed. Evaluate each at zero weights, using f(0) and f'(0) for each activation.

Hint 2

Check whether f(0) equals zero. If it does not (Sigmoid), some gradients are nonzero. Then ask whether the hidden units can ever become different from each other, and try an induction argument over update steps.

Hint 3

For the fix, think about what randomness provides versus what the variance provides. Derive Var(z) = n_in * Var(w) * E[h^2] and pick Var(w) so that the signal scale stays constant across layers for the given activation.