Visual walkthrough — Vanishing and exploding gradients
Everything below assumes you can multiply numbers. That's it. Every symbol is earned before it's used.
Step 1 — One number, passed backward
WHAT. Imagine a signal — just a length of arrow — being handed from one room to the next. Each room does one thing: it multiplies the arrow's length by a fixed number. Call that number (for gain). If the arrow leaves half as long; if it leaves twice as long.
WHY. In a neural network, "passing the signal backward" during Backpropagation is exactly this: the error at one layer becomes the error at the previous layer after being multiplied by some factor. Before we drown in matrices, we look at the simplest possible version — a single number multiplied over and over.
PICTURE. Look at figure below: one arrow enters on the right, passes through three rooms, and each room shrinks it by the same gain .

Step 2 — Many rooms: the signal is a product of gains
WHAT. If the arrow goes through rooms, and each room has gain , the arrow's final length is the starting length times multiplied by itself times:
Term by term:
- — the gain raised to the power , i.e. multiplied by itself times. The little raised counts the rooms.
- — the signal's original length, before any room touched it.
WHY. We use a power () and not, say, , because each room multiplies — it does not add. Multiplying repeatedly is what turns a gentle per-room effect into a violent overall effect. That distinction is the entire lesson: repeated multiplication is explosive or crushing, never gentle.
PICTURE. The figure plots against the number of rooms for three gains. Watch how the curves fan apart.

Step 3 — What is really being multiplied in a network
WHAT. In a real layer the signal isn't multiplied by a bare number . It's multiplied by two things:
- the layer's weight (how strongly neurons connect), and
- the slope of the activation function, written (how much the neuron's output changes when its input nudges).
So the per-layer gain is
Term by term:
- (Greek letter "gamma") — our real gain, the honest version of from Steps 1–2.
- — the spectral (operator) norm of the weight matrix. See the definition box below: it is the largest factor by which can stretch any input vector. We use this norm — not "average size" — for a precise reason revealed in Step 6.
- — the derivative (slope) of the activation function . We need the slope because backprop asks "if the input wiggles a little, how much does the output wiggle?" — that ratio is exactly a derivative.
- — the largest slope the activation ever has, our worst-case factor.
WHY the slope? The chain rule of Backpropagation multiplies the incoming error by "output-wiggle per input-wiggle." That's the definition of a derivative. We choose the derivative — not the function value itself — because we're tracking sensitivity, not the signal's raw value.
PICTURE. The figure shows a neuron's activation curve (violet) and its slope (orange). Where the curve is flat, the slope is near zero — a tiny gain. Where the curve is steep, the slope is large.

Step 4 — The chain rule stacks these gains
WHAT. Backprop connects the error at layer to the error at the next layer :
Term by term:
- — the error signal at layer (our arrow, now written properly). The superscript just labels which layer.
- — the next layer's weights, transposed (flipped) so they push the signal backward instead of forward. (Transposing does not change the spectral norm: .)
- — the error one layer closer to the output; it arrives first and we pull it back.
- — element-wise multiply: multiply matching entries, one for each neuron.
- — the activation slope at this layer, our per-neuron gain from Step 3.
WHY. Layer can only affect the loss through layer (its output is the next layer's input). So to find its blame, we take 's blame and route it back — pulling through the weights, then scaling by the local slope. Each backward hop = one multiplication by (weight × slope) = one factor of .
PICTURE. Each arrow-hop between layers is one multiplication. Count the hops.

Step 5 — Unroll all the way: factors
WHAT. Apply Step 4 repeatedly, from the last layer down to the first layer :
Term by term:
- — the error at the first layer (the one that learns basic features; the one we fear will freeze).
- — the product symbol: multiply everything inside for .
- — the slopes arranged on a diagonal so they multiply cleanly; think "one gain per neuron."
- — the error at the last layer, where backprop starts.
Going from layer to layer crosses links, so the product has factors. Each factor is roughly .
WHY. This is Step 2 in disguise: many rooms, one gain each. The network's depth is the number of rooms.
PICTURE. The full backward chain, with each of the links labelled by a factor.

Step 6 — Take the size: appears
WHAT. Measure the size of both sides using the spectral norm from Step 3. The key tool is submultiplicativity: for the spectral norm, the size of a product is at most the product of the sizes, This holds by the very definition of as the worst-case stretch: can never stretch by more than its worst-case factor . Applying it to all factors, and using to bound each block:
Term by term:
- — how large the first layer's error signal is.
- — the gain raised to the number of links: exactly the power curve from Step 2.
- — the last layer's error size, our starting length.
WHY. Submultiplicativity is what lets us collapse a messy matrix product into a single power of one number. All the structure boils down to one power of — precisely because the spectral norm never lets a product amplify more than the factors would separately.
PICTURE. The three fates return — now on the axis of network depth .

Step 7 — Edge and degenerate cases
WHAT & WHY. We must show every scenario, or the reader hits one we skipped.
- (dead neuron). If a neuron's slope is (e.g. ReLU on a negative input), its factor is . One zero factor kills the whole product — that neuron's gradient path is frozen. This is the "dead ReLU" problem: ReLU avoids shrinking but can zero out entirely.
- exactly . The flat line: signal passes untouched no matter how deep. This is the design target, achieved by He/Xavier init and skip connections.
- Sigmoid ceiling . Sigmoid's slope never exceeds , so even with the gain caps at — guaranteed vanishing in deep nets. That single number doomed pre-2010 deep networks.
- Negative per-layer gain (). A weight can be negative, so a real per-layer factor can be negative. For the magnitude bounds above nothing changes — we took via norms, and always. But the sign flips: an odd number of negative factors flips the sign of the propagated error, so a neuron may receive a gradient pointing the "wrong way" relative to a naive expectation. This does not cause vanishing or exploding by itself, but it makes the sign of the update oscillate across layers and can slow or destabilise Gradient Descent. Takeaway: size is governed by ; sign is governed by the parity of the negative factors.
- Mixed gains (why the geometric mean decides it). Real layers have different gains . The product is . Define the geometric mean — the single equal factor that would give the same product. By construction , so the product behaves exactly like a uniform gain of . Hence vanish, explode, preserved. The geometric (not arithmetic) mean is the right average precisely because the factors multiply: taking turns the product into a sum, and the average of the logs is the log of the geometric mean.
PICTURE. Four mini-panels: dead (), sigmoid ceiling (), preserved (), exploding ().

The one-picture summary

The whole story is one arrow, multiplied times by a gain . Below (in size) it dies; above it explodes; at it survives; and if any factor is negative, its sign flips. Everything else is engineering to hit that .
Recall Feynman retelling — say it back in plain words
Picture handing a note down a long corridor of rooms. Each room photocopies the note at some zoom setting . If every room zooms out to 50%, after ten rooms the note is a speck you can't read — that's a vanishing gradient, and the first room (the early layer) never learns what to fix. If every room zooms to 150%, after twenty rooms the note is a wall-sized blur — that's an exploding gradient, and training blows up (NaN). The only safe zoom is 100% (), where the note arrives readable no matter how long the corridor. Now: the zoom setting is really the weight's worst-case stretch (its spectral norm) times the activation's slope . The reason many rooms multiply cleanly into one power is submultiplicativity — no matrix can amplify more than its worst-case stretch, so the whole chain is bounded by the product of stretches. When rooms have different zooms, the outcome is set by the geometric mean of the zooms, because multiplying-then-averaging is the same as averaging-the-logs. A negative zoom is like a photocopier that also flips the note upside-down: it doesn't change the size but flips the sign, and an odd number of flips confuses the update direction. Sigmoid's slope caps at , forcing a permanent zoom-out — that's why sigmoid vanishes. ReLU keeps slope , and Weight Initialization tunes so the product stays near . Skip connections literally add a "photocopy at 100%" side-path so the note always has one clean copy. That's the entire theory of vanishing and exploding gradients — one number, raised to the depth.
Recall Quick self-check
Why a power and not a product ? ::: Because layers multiply the signal, not add to it; repeated multiplication is a power. What two ingredients make up ? ::: The spectral norm (worst-case stretch of ) and the activation slope . Which norm property lets us bound a matrix product by a power? ::: Submultiplicativity: . What extra factor sits between and the actual weight gradient? ::: The input-activation size , kept roughly constant by normalization so it drops out of the depth scaling. For unequal per-layer gains, which average decides vanish vs explode? ::: The geometric mean ; vanish, explode. What does a negative per-layer gain do? ::: Leaves the magnitude bound unchanged but flips the sign of the propagated error (parity of negative factors). What does a single factor do to the product? ::: Kills it entirely — that path's gradient is zero (dead neuron). What is the one safe value of ? ::: : the signal is preserved at any depth.