3.1.11 · D5Neural Network Fundamentals
Question bank — Vanishing and exploding gradients
This is a rapid-fire set of conceptual traps for the parent topic. No heavy arithmetic here — that lives in the computation decks. Each item is a one-line reveal: read the prompt, commit to an answer out loud, then check. If your reasoning differs from the answer's reasoning (not just the verdict), that's the misconception to fix.
Before the traps, four definitions so every symbol below is earned.
True or false — justify
Sigmoid networks vanish only because the weights are initialized too small.
False — even with ideally scaled weights (spectral norm exactly , so the weight factor neither shrinks nor grows the gradient), the sigmoid derivative is still capped at , so ; the activation-slope factor alone drives toward zero regardless of init.
A vanishing gradient means the network has converged to a good minimum.
False — a frozen early layer can coexist with high loss; later layers still receive a healthy backward gradient while early ones simply stop updating. Convergence needs low loss, not small gradients.
Exploding gradients and vanishing gradients cannot happen in the same network.
False — the bound is a single worst case, but the actual per-link factors vary block by block; some layers can have spectral-norm-times-slope (locally amplifying the backward gradient) while others have it (locally shrinking it), so the same net can both explode in some sub-paths and vanish in others.
Using ReLU everywhere completely removes the vanishing/exploding problem.
False — ReLU's slope is (good) but its slope is for negative inputs, so "dead neurons" still zero the backward gradient, and large weights still push and explode.
Making the network shallower reduces the exponent, so it always improves stability.
False — fewer layers shrinks the exponent , but if itself is far from the net still vanishes or explodes catastrophically (e.g. over even 10 links gives ); fewer layers only reduces how fast the deviation compounds, it does not fix a bad .
Gradient clipping fixes vanishing gradients.
False — clipping only caps large gradients (exploding). It does nothing when the backward gradient is already near zero; a tiny gradient stays tiny after clipping.
Batch Normalization helps by keeping forward activations in a range where is healthy.
True — by re-centering and rescaling , it keeps pre-activations away from the flat saturated tails where , indirectly nudging the factor of toward (this is built-in normalization — see the "modern alternatives" edge cases below).
If the loss becomes NaN, the gradients almost certainly vanished.
False — NaN comes from numbers blowing up to infinity, i.e. exploding backward gradients ( compounded over depth), not shrinking ones.
Residual connections work by making each layer's function smaller.
False — they work by adding an identity path so the layer Jacobian becomes , guaranteeing a gain- route for the backward gradient even if itself is small.
SELU / self-normalizing nets and Leaky-ReLU are irrelevant to this problem.
False — Leaky-ReLU gives negatives a small nonzero slope so they never fully die; SELU is engineered so activations self-normalize (mean/variance drift back toward a fixed point), pinning near without an explicit BatchNorm layer.
Spot the error
"Since backprop adds the error contributions from each layer, deep nets accumulate large gradients — that's why they explode."
The backward gradient is passed by multiplication of Jacobians, not addition; the product of factors is what compounds exponentially, which is why depth is dangerous. Recall backprop is the chain rule, and the chain rule multiplies derivatives — see Backpropagation.
"He initialization uses because ReLU doubles the signal."
Wrong reason — the factor of compensates for ReLU zeroing roughly half the forward activations (halving their variance); the restores it, keeping . He is for ReLU, Xavier for tanh/sigmoid — see Weight Initialization.
"Sigmoid's derivative reaches its maximum of at ."
The maximum is , not , occurring at where ; the cap at is precisely why sigmoid promotes vanishing.
"To fix vanishing gradients, just crank up the learning rate so the tiny gradients take bigger steps."
Gradient magnitude differs by many orders across layers ( vs ); one global learning rate cannot balance both — a rate big enough for early layers would destabilize later ones. The learning rate multiplies the gradient in the update step; it cannot un-vanish a gradient — see Gradient Descent.
"The gradient for an -layer net has multiplicative factors."
It has factors — propagating from layer down to layer crosses layer-to-layer links, so the bound scales like (exactly the count in the unrolled product above).
"tanh is immune to vanishing because its derivative can equal ."
Its derivative reaches only at ; away from zero it drops fast, and in the saturated tails , so tanh still vanishes for large-magnitude pre-activations.
Why questions
Why does the exponent being rather than exactly barely matter in practice?
Because the dependence on depth is exponential — whether it's or , if the value still races toward or ; the base is what you must control, not the off-by-one exponent.
Why does the same property (depth ) that makes networks powerful also make them unstable?
Depth stacks many multiplicative factors: more layers means richer representations and a longer product that amplifies any deviation of from .
Why do we check per-layer gradient norms instead of just the total loss?
Total loss can be high while the early layers' backward gradients are near zero; only per-layer norms reveal that the early layers are frozen while later ones still learn.
Why is the design target rather than as large as possible?
vanishes and explodes; only keeps the backward gradient's magnitude roughly preserved across all layers, which is the whole point of every fix.
Why do LSTM/GRU gates help specifically in recurrent nets?
An RNN reuses the same recurrence over many time steps, so its effective depth is the sequence length; the additive cell state gives a near- recurrence, avoiding compounded shrinkage over long sequences — see LSTM and GRU.
Why does ReLU "dominate deep nets" despite having no upper bound on its output?
Its derivative is exactly for positive inputs, so it neither shrinks nor amplifies the backward gradient per layer — the factor stays at , keeping from collapsing the way sigmoid's does.
Edge cases
What happens to when is exactly ?
It stays at for any depth — the backward gradient is perfectly preserved, the idealized stability regime every trick tries to approximate.
If a ReLU neuron receives only negative pre-activations for all training data, what is its gradient contribution?
Zero — its slope is on negatives, so it is a "dead neuron"; its factor is , killing the backward gradient through that path. Leaky-ReLU avoids exactly this by giving negatives a small nonzero slope.
What does the gain look like at the very first training step versus deep into training?
Init controls at step 0 (keeping it ), but as weights grow during training the spectral norm can drift, pushing away — which is why normalization (BatchNorm or a self-normalizing SELU net) matters throughout, not just at start.
Consider a network with a single hidden layer (). How severe is the vanishing/exploding problem?
Barely present — the product has just factor, so there is almost no compounding; the instability is fundamentally a deep-network phenomenon.
For sigmoid at the extreme input , what happens to and thus the gradient?
in both tails, so the backward gradient through that neuron vanishes entirely — this saturation is exactly what normalization prevents by keeping near .
If every weight matrix has spectral norm slightly below (say ) with ReLU, is the net safe?
No — with , still decays exponentially for large (e.g. ), so deep enough nets still vanish; "slightly below " is not "".
Can the per-link factor effectively flip the gradient's sign, and does that change the vanish/explode verdict?
The bound uses (a spectral norm, always non-negative), which controls only magnitude; the actual factor is a matrix that can rotate or reflect the gradient vector, so individual coordinates may change sign link to link — but the magnitude bound still governs vanish/explode, so sign flips affect direction, never the verdict.
Does a self-normalizing activation (SELU) remove the need for careful init entirely?
No — SELU's fixed-point behavior only holds under its matching "LeCun-normal" init and when layers stay dense; break those assumptions and the activation drifts, so init still matters.
Recall One-line summary of every trap
Every item reduces to: is the per-layer gain (worst-case spectral norm times ) close to , and did depth multiply it times? Backward gradient vanishes if , explodes if , stable only near .