Which Fix Fails to Cure Vanishing Gradients in Deep Nets?
Machine LearningModel answerLast updated
Pick the option that does not reliably address vanishing gradients in a deep network and justify it, while assessing how the other three techniques work and where they fall short.
You are training a deep feed-forward network and notice that the early layers barely update, while the layers near the output learn normally. Training loss plateaus well above where it should be.
Four changes are proposed:
- Add skip (residual) connections between layers.
- Switch to an activation function such as ReLU.
- Increase the learning rate.
- Insert batch normalization between layers.
Tasks
- Identify which one is not a reliable remedy for vanishing gradients.
- Explain the mechanism behind your choice, using how gradients flow backward through the network.
- For each of the other three, explain how it helps and what its limitations are (it may help without being a guaranteed cure).
Hints
Hint 1
Write the gradient reaching an early layer as a product of per-layer Jacobians and activation derivatives. What happens to this product when each factor is smaller than 1 in magnitude?
Hint 2
The learning rate multiplies the gradient. Ask whether scaling a quantity can fix the fact that its magnitude differs by orders of magnitude between layers, and what else a larger step size might break.
Hint 3
For the other three options, ask what each does to the per-layer factor in that product: give it a path with derivative near 1, avoid saturation, or keep pre-activations in a well-scaled range.
Model answer
Medium Try it yourself first — then compare your approach, complexity and edge cases.
Answer
Raising the learning rate is the option that is not a reliable fix.
Why gradients vanish
By the chain rule, the gradient of the loss with respect to the weights of an early layer is a product of many terms:
dL/dW_1 = dL/dh_L * (prod over l=2..L of diag(f'(z_l)) * W_l ) * ...
If the typical magnitude of each factor is below 1, the product shrinks roughly like c^L for c < 1. With a sigmoid, f'(z) <= 0.25, so across 20 layers the signal can shrink by something like 0.25^20 ≈ 1e-12. Poor weight initialization and saturated units make it worse. The result is that early layers receive tiny, noisy updates while late layers receive reasonable ones.
Why a larger learning rate does not fix it
The update is W <- W - lr * grad. Increasing lr scales every layer's gradient by the same constant. That has several consequences:
- The imbalance remains. If early-layer gradients are 1e-10 times those of late layers, multiplying everything by 10 or 100 preserves the ratio. To make early layers move meaningfully, you would need a step size so large that the late layers diverge.
- It destabilizes training. The layers that already have healthy gradients overshoot, the loss oscillates or blows up, and you may get NaNs.
- It does not change the cause. The problem is the structure of the backward product, not the size of the step.
- Numerical floor. In low precision (fp16), gradients that small can underflow to zero, and no learning rate recovers a value that is already zero.
A learning rate adjustment can help a little when training is simply too slow, and per-parameter adaptive optimizers (Adam, RMSprop) partly rescale gradients per weight. But even this is a mitigation, not a fix to the signal path, and plain "raise the learning rate" is not a remedy.
How the other three help, and their limits
Skip (residual) connections
- Mechanism: a block computes
h_{l+1} = h_l + F(h_l). The Jacobian isI + dF/dh, so there is an identity path along which the gradient flows back with factor 1 regardless of depth. The product no longer decays exponentially by default. - Limits: the residual branch can still have vanishing or exploding behavior. Very deep stacks may still need careful initialization (for example, scaling the last layer of each block) and normalization. Skip connections can also let the network ignore deep layers rather than use them well.
ReLU (and relatives)
- Mechanism:
f'(z) = 1forz > 0, so active units do not shrink the gradient, unlike sigmoid or tanh, which saturate. - Limits: for
z < 0the derivative is 0, so "dead ReLUs" can stop learning entirely. ReLU does not control the scale of the weight matrices, so gradients can still vanish or explode with bad initialization. Leaky ReLU, ELU, GELU, and proper initialization (He initialization) address some of this.
Batch normalization
- Mechanism: it normalizes pre-activations to roughly zero mean and unit variance, keeping them out of saturating regions and keeping layer scales comparable. This makes gradient magnitudes more uniform across depth and allows higher learning rates.
- Limits: it depends on batch statistics, so it behaves poorly with very small batches or in some recurrent settings (layer norm is often preferred). It adds train/inference discrepancies and does not guarantee gradient preservation in extremely deep plain networks. In practice it works best combined with residual connections and good initialization.
Other remedies worth mentioning
- Careful initialization (Xavier/Glorot for tanh, He for ReLU).
- Gating architectures such as LSTM/GRU for sequence models.
- Gradient monitoring (per-layer gradient norms) to diagnose the problem.
- Layer normalization, and auxiliary losses at intermediate layers.
Common mistakes
- Saying a higher learning rate "compensates" for small gradients. It scales all layers equally and risks divergence.
- Confusing vanishing gradients with exploding gradients. Gradient clipping addresses explosion, not vanishing.
- Claiming ReLU or batch norm "solves" the problem. They reduce it; they do not remove every failure mode.
- Forgetting that skip connections work by creating an identity gradient path, not by changing the activation.
Summary
Skip connections, ReLU, and batch normalization each change the per-layer factors in the backward product. A larger learning rate only scales the final update and leaves the vanishing structure intact, so it is the answer.