Why Identical Starting Weights Stall Neural Network Training
Machine LearningModel answerLast 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
- 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.
- Define symmetry breaking and explain why optimization needs it.
- Describe how the failure differs across activations: linear, Tanh, ReLU, and Sigmoid.
- 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.
Model answer
Medium Try it yourself first — then compare your approach, complexity and edge cases.
Setup
Using the two-layer network, let δ2 = ∂L/∂z2. Backpropagation gives:
∂L/∂W2 = δ2 hᵀ,∂L/∂b2 = δ2δ1 = (W2ᵀ δ2) ⊙ f'(z1)∂L/∂W1 = δ1 xᵀ,∂L/∂b1 = δ1
1. All parameters at zero
Forward pass. z1 = 0·x + 0 = 0 for every hidden unit and every input, so h = f(0) for all units. Then z2 = 0·h + 0 = 0, so the network emits the same constant for every input.
Backward pass.
δ1 = (W2ᵀ δ2) ⊙ f'(0) = 0becauseW2 = 0. SoW1andb1get no gradient on the first step, whatever the activation.∂L/∂W2 = δ2 · f(0) · 1ᵀ. What happens depends on whetherf(0)is zero.
Case A: f(0) = 0 (ReLU, Tanh, linear). Then h = 0 and ∂L/∂W2 = 0. Only b2 is updated. Since W1 and W2 remain zero, the next step is identical to the first. The network converges to a constant predictor (for MSE, the mean of the targets) and stays at a stationary point of the loss, a saddle, forever.
Case B: f(0) ≠ 0 (Sigmoid, f(0) = 0.5). Now ∂L/∂W2 = 0.5 δ2 1ᵀ, which is nonzero, but every column has the same value. Every hidden unit receives the same outgoing update. On the next step (W2ᵀ δ2)_j = Σ_k W2[k,j] δ2_k is the same for every j, and f'(z1) is also identical, so δ1 is identical across units and every row of ∂L/∂W1 = δ1 xᵀ is the same. Gradients are nonzero but the units never differentiate.
Induction argument. Suppose hidden units i and j have identical incoming and outgoing weights at step t. They produce identical activations, receive identical backpropagated signals, and get identical gradients. After w ← w − η g they are still identical at step t+1. Equivalently, the loss is invariant under permuting hidden units, so the gradient at a permutation-symmetric point is itself symmetric, and gradient descent never leaves the symmetric subspace.
The consequence is that a layer of width m behaves like a layer of width 1. In deeper networks, gradients only reach layers adjacent to a nonzero matrix, so most layers receive nothing.
2. Symmetry breaking
Symmetry breaking means starting units at different points in parameter space so they compute different functions and receive different gradients. Only then can units specialize into distinct features. Without it, additional width adds no capacity. Any random perturbation breaks the tie in principle, but the scale of the randomness matters (Section 4). Biases may stay at zero once weights are random, since the weights already differentiate units.
3. Behavior by activation
| Activation | f(0) | f'(0) | Zero-init outcome |
|---|---|---|---|
| Linear | 0 | 1 | h = 0, all weight gradients zero, only output bias learns |
| Tanh | 0 | 1 | Same as linear: stuck |
| ReLU | 0 | 0 (convention) | Stuck, and doubly dead because f'(0) = 0 too |
| Sigmoid | 0.5 | 0.25 | Gradients flow, but units stay clones, effective width 1 |
Note that even with a good initialization, a deep purely linear network collapses to one linear map, so nonlinearity is what makes extra width useful.
Contrast with logistic/linear regression. With no hidden layer there are no interchangeable units, and the loss is convex. Zero init is fine there. The problem is specific to hidden units.
4. The fix: random, variance-scaled initialization
Draw weights i.i.d. with mean 0 and a chosen variance. Randomness breaks symmetry, and the variance keeps signals at a healthy scale. For a layer with n_in inputs:
Var(z_l) = n_in · Var(w) · E[h_{l-1}²]
- Xavier/Glorot (Tanh, Sigmoid, roughly linear regimes):
Var(w) = 2 / (n_in + n_out). Near zero these activations are close to linear, soE[h²] ≈ Var(z), and this choice balances forward activation variance with backward gradient variance. - He/Kaiming (ReLU family):
Var(w) = 2 / n_in. ReLU zeros about half the inputs, soE[h²] = Var(z)/2. Settingn_in · Var(w) / 2 = 1preserves variance layer to layer.
Both give each unit different weights, which breaks symmetry, and both keep pre-activations out of saturation and gradients at order-1 magnitude.
Follow-ups
All weights set to 0.5. Every hidden unit computes 0.5 Σ x_i, so units are identical and the induction argument applies. Gradients are nonzero but identical, so effective width stays 1. The scale is also wrong: z grows with fan-in, saturating Sigmoid/Tanh (tiny f') or causing exploding activations with ReLU.
Mismatched init and activation. Xavier with ReLU loses about half the variance per layer, so signals shrink with depth. He with Tanh pushes units toward saturation.
Very deep networks. The backward signal is a product of many layer Jacobians. If each shrinks or grows the signal slightly, it vanishes or explodes exponentially, which is why variance-preserving init (plus normalization layers and residual connections) matters.
Common mistakes
- Saying "all gradients are zero for every activation". That is false for Sigmoid, where the real issue is permanent symmetry.
- Blaming zero biases. They are harmless when weights are random.
- Believing any constant fixes it. Constants preserve symmetry.
- Using tiny random weights and assuming they are always fine. Wrong scale causes vanishing or exploding signals.
- Forgetting that ReLU's derivative at 0 is a framework convention (usually 0).