Impact of Zero Initialization on Neural Networks and Linear Models
Machine LearningModel answerLast updated
Analyze why setting all weights to zero causes hidden unit symmetry in deep networks while remaining functional for single-layer models.
Describe what occurs during optimization if every weight parameter in a neural network is set to zero prior to training.
In your response:
- Explain the mechanism of symmetry breaking (or the lack thereof) in multi-layer architectures with hidden units. Specify what assumptions you make about bias initialization.
- Address whether all weight gradients are strictly guaranteed to evaluate to zero at step zero across every possible architecture, activation function, and loss combination.
- Compare this behavior to single-layer models (such as standard linear regression or logistic regression) initialized with all zero weights.
- Briefly summarize standard weight initialization techniques used to avoid these failure modes.
Hints
Hint 1
Consider how hidden units compute their pre-activations when all incoming weights are identical.
Hint 2
Distinguish between a gradient being equal across multiple neurons versus a gradient evaluating to exactly zero.
Hint 3
Think about why models without hidden layers (like logistic regression) do not suffer from representation symmetry.
Model answer
Medium Try it yourself first — then compare your approach, complexity and edge cases.
1. Multi-Layer Neural Networks and the Symmetry Problem
When all initial weights in a multi-layer feedforward network are set to zero, the network suffers from a structural failure known as symmetry failure (or inability to break symmetry).
The Symmetry Mechanism
Consider a hidden layer $h$ with $K$ hidden units, receiving input $x \in \mathbb{R}^D$:
- Forward Pass: The pre-activation for hidden unit $j$ is $z_j = \sum_{i} W_{ji}^{(1)} x_i + b_j^{(1)}$. If all weights $W_{ji}^{(1)} = 0$ and biases $b_j^{(1)} = 0$, then $z_j = 0$ for every hidden unit $j$.
- Activations: Every hidden unit computes the same activation $a_j = \sigma(z_j) = \sigma(0)$, producing identical outputs across all $K$ units.
- Backward Pass: During backpropagation, the gradient of the loss $L$ with respect to weight $W_{ji}^{(1)}$ is: $$\frac{\partial L}{\partial W_{ji}^{(1)}} = \frac{\partial L}{\partial z_j^{(1)}} \cdot x_i$$ Because all downstream weights $W^{(2)}$ in the next layer were also initialized to zero (or to identical values), the error signals $\delta_j = \frac{\partial L}{\partial z_j^{(1)}}$ propagated back to each hidden unit $j$ are identical.
Consequences
- Identical Updates: Every weight connected to unit $j$ receives the exact same gradient update as the corresponding weight connected to unit $k$.
- Loss of Capacity: Because every hidden unit updates identically at every step of gradient descent, all hidden units compute the exact same feature function throughout training. The network effectively collapses to the capacity of a model with just one single hidden unit, rendering additional width useless regardless of how many training iterations take place.
2. Are Gradients Always Zero at Step Zero?
No, gradients are not necessarily zero. It is crucial to distinguish between identical gradients across neurons and gradients that evaluate to zero.
- Non-zero identical gradients: In many configurations, the initial gradients are non-zero numbers. For example, if we initialize weights to zero but biases to zero, and use a Sigmoid activation $\sigma(0) = 0.5$ with a non-zero loss derivative from the output layer, the backpropagated gradients to hidden units will be identical non-zero values. Weights will change on step 1, but they will all change by the exact same amount.
- Zero gradients: Gradients evaluate to exactly zero if the activation derivative at zero is zero (e.g., ReLU if pre-activation is strictly negative, though $\text{ReLU}(0) = 0$ with subgradient usually 0), or if the downstream linear combination yields zero backpropagated error due to zero output weights multiplying a zero loss output.
In summary, zero initialization guarantees symmetry, but whether the initial step gradient is literally zero depends on the choice of activation function, bias initialization, and loss function.
3. Comparison with Single-Layer Models
For models without hidden units—such as linear regression, logistic regression, or single-layer perceptrons—zero weight initialization is completely fine and routinely works.
Why Single-Layer Models Differ:
- No Hidden Units: There are no internal parallel representations that need to specialize in different features.
- Inputs Break Symmetry: The weight update for input feature $i$ is driven by the feature value itself: $$\frac{\partial L}{\partial w_i} = (\hat{y} - y) \cdot x_i$$ Since distinct input features $x_i$ take on different numeric values across training samples, each weight $w_i$ receives a distinct gradient update on the very first step.
For convex objectives (like mean squared error in linear regression or binary cross-entropy in logistic regression), zero initialization is simply starting at a specific point in the loss landscape, and gradient descent will successfully converge to the global minimum.
4. Correct Initialization Strategies
To prevent symmetry failure in deep networks, weights must be initialized randomly to break symmetry.
-
Xavier / Glorot Initialization (for symmetric activations like $\tanh$ or Sigmoid): $$W \sim \mathcal{N}\left(0,, \frac{2}{d_{\text{in}} + d_{\text{out}}}\right)$$ Keeps variance of activations and gradients constant across layers.
-
He / Kaiming Initialization (for asymmetric activations like ReLU): $$W \sim \mathcal{N}\left(0,, \frac{2}{d_{\text{in}}}\right)$$ Accounts for the fact that ReLU deactivates roughly half the neurons, doubling activation variance.
-
Bias Initialization: Biases do not suffer from symmetry constraints because random weight initialization already breaks input symmetry across units. Consequently, biases are typically initialized to constant zeros ($b = 0$).
Key Takeaways Summary
| Model Type | Zero-Init Behavior | Cause |
|---|---|---|
| Linear / Logistic Regression | Works correctly | Feature inputs $x_i$ naturally break symmetry across weights. |
| Multi-Layer Neural Net | Fails (Capacity Collapses) | Hidden units compute identical functions and receive identical updates. |