Vanishing/exploding gradients are the core obstacle to training deep nets and RNNs, rooted in the chain product of Jacobians along depth:
∂h0∂L=∏t=1T∂ht−1∂ht, whose norm is bounded by
∏t∥Jt∥≤γT — if each layer's spectral norm
γ<1 the product decays exponentially to 0 (vanishing); if
γ>1 it explodes. Numeric intuition: scaling by
0.9 per step gives
0.950≈0.005 after 50 steps (gradient shrinks to ~1/200); scaling by
1.1 gives
1.150≈117 (overflow). Sigmoid's peak derivative 0.25 (<1) is a classic “vanishing amplifier”. Fixes: ① weight initialization — Xavier preserves forward/backward variance with
nin+nout2, Kaiming corrects to
nin2 for ReLU; ② residual connections
y=F(x)+x give an identity shortcut for gradients; ③ normalization (BN/LN/RMSNorm) stabilizes activation scales; ④ the ReLU family keeps a constant gradient of 1; ⑤ gradient clipping handles explosion, LSTM's additive cell state eases long-term dependencies.