Chapter 8 asked whether the forward pass survives depth. Backprop has to travel the exact same distance in reverse — does the gradient survive the trip?
This is a chain of sigmoid layers, same weight repeated at every layer. Drag depth up and watch the gradient reaching the input drop — not by a little each layer, but by roughly one more order of magnitude every single time.
Going backward one layer multiplies the gradient by — Chapter 5's chain rule, once per layer. Sigmoid's derivative peaks at exactly and is smaller everywhere else:
- — the loss.
- and — the hidden layer outputs at layer and the layer just before it.
- — layer 's raw weighted sum, before its activation.
- — sigmoid's derivative at that point, capped at .
- — the weight, repeated at every layer in this example.
- Repeated shrinking compounds to nothing
Multiply a number smaller than by itself ten times and it's gone.
- No weight scale rescues sigmoid
Unlike Chapter 8's forward pass, there's no weight scale that fixes this — a bigger pushes further from , which makes even smaller, not larger. Sigmoid's derivative is capped at , so this particular chain can only ever shrink going backward.
- Exploding gradients are the mirror image
The mirror-image failure — exploding gradients — shows up instead in linear or ReLU layers with large weights, where nothing caps that per-layer factor above ; it's the exact same backward multiplication as Chapter 8's forward one, just run in reverse.
Slide from a shallow to a deep chain. Five layers in, the gradient is already down around ; by ten layers it's down to about — utterly unusable for updating a weight that far back. This is the vanishing gradient problem, and it's exactly why sigmoid fell out of favor as networks got deep.
With weight :
- Check a single layer
is at most , so even the very first backward step shrinks the gradient.
- Follow it to depth 6
Each backward step multiplies by that layer's own — and pushes the forward pass toward saturation fast (the signal climbs from toward within a couple of layers, where is tiny), so the six per-layer factors, computed layer by layer from the output backward, are all well under the depth-1 bound of :
Multiplying the output gradient () by all six: — already roughly four orders of magnitude smaller than the loss gradient at the output.
- One layer further
It drops under entirely: for practical purposes, that weight has stopped learning.
Drag depth until the gradient reaching the input drops below 0.000001.
A gradient that vanishes on the way back means the earliest layers of a deep network barely update at all — they're effectively frozen at their initial (random) values while only the last few layers learn anything. ReLU (short for Rectified Linear Unit)'s derivative doesn't have this ceiling (it's exactly wherever the neuron is active), which is a large part of why it replaced sigmoid as the default choice once networks got deep.