In a deep MLP with sigmoid activations, the error signal reaching the first layer's weights has passed through ten sigmoid derivatives. Ignoring the weight matrices (assume unit scale), what is the best-case factor by which those derivatives scale the gradient?
Show the answer and explanation
Correct answer: B, It is scaled by at most about 9.5 × 10⁻⁷ (0.25¹⁰), because each sigmoid derivative is at most 0.25 and the chain rule multiplies all ten local factors together.
Explanation Backpropagation
Backpropagation applies the chain rule layer by layer: δₗ = σ′(zₗ) ⊙ (Wₗ₊₁ᵀ δₗ₊₁). Unrolled over ten sigmoid layers, the error signal reaching the first layer's weights is a product of ten σ′ factors and the weight matrices between them.
The sigmoid derivative σ′(z) = σ(z)(1 − σ(z)) is at most 0.25 (at z = 0). With ten such factors the best case is 0.25¹⁰ ≈ 9.5 × 10⁻⁷: the first layer gets about a millionth of the signal, and that is before any saturation, which makes σ′ much smaller than 0.25. This is the classic vanishing gradient problem that made deep sigmoid networks so hard to train before ~2010.
Why the distractors are wrong:
- Along one path the chain rule multiplies local derivatives. Sums only appear where several paths merge, e.g. at a skip connection, which is exactly why residual connections help.
- 0.5 is σ(0), the output of the sigmoid at zero, not its slope.
- Slope 1 at zero is true for tanh (tanh′(0) = 1), not for the sigmoid.
| Activation | Max derivative | 10 layers, best case |
|---|---|---|
| Sigmoid | 0.25 | ≈ 10⁻⁶ |
| Tanh | 1 (only at z = 0) | ≤ 1 |
| ReLU | 1 for z > 0 | 1 |
Fixes: ReLU-family activations, Xavier/He initialization, normalization layers, residual connections, and gated cells (LSTM/GRU) for recurrent nets.
Interview tip: describe vanishing gradients as "a product of many factors below one" and exploding gradients as the same product with factors above one, then list the fixes.