← Back to Deep Learning Mind Map
中文·English
🧠 Deep LearningID: vanishing-exploding

Vanishing/Exploding Gradients

梯度消失/爆炸
🎯Core Definition
Vanishing/exploding gradients are the core obstacle to training deep nets and RNNs, rooted in the chain product of Jacobians along depth: ∂L∂h0=∏t=1T∂ht∂ht−1\frac{\partial L}{\partial h_0}=\prod_{t=1}^{T}\frac{\partial h_t}{\partial h_{t-1}}, whose norm is bounded by ∏t∥Jt∥≤γT\prod_{t}\Vert J_t\Vert\le\gamma^T — if each layer's spectral norm γ<1\gamma<1 the product decays exponentially to 0 (vanishing); if γ>1\gamma>1 it explodes. Numeric intuition: scaling by 0.90.9 per step gives 0.950≈0.0050.9^{50}\approx0.005 after 50 steps (gradient shrinks to ~1/200); scaling by 1.11.1 gives 1.150≈1171.1^{50}\approx117 (overflow). Sigmoid's peak derivative 0.25 (<1) is a classic “vanishing amplifier”. Fixes: ① weight initialization — Xavier preserves forward/backward variance with 2nin+nout\frac{2}{n_{in}+n_{out}}, Kaiming corrects to 2nin\frac{2}{n_{in}} for ReLU; ② residual connections y=F(x)+xy=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.
💡Use Cases
interview staples — “why won't my deep net train?”, “why do RNNs struggle with long dependencies?”, “what does 0.950≈0.0050.9^{50}\approx0.005 imply?”; you are expected to chain together ResNet residuals, Xavier/Kaiming init and BatchNorm and explain why each alone is insufficient.
⚡Key Problems Solved
makes hundreds-layer nets (ResNet-152, LLMs) actually trainable — residuals let gradients flow losslessly through the identity shortcut (shallower effective depth, deeper trainable depth); initialization anchors each layer's output variance to the input scale so the product norm stays near γ≈1\gamma\approx1; normalization stabilizes activation scales and Jacobians. Together they break the degradation that appears at ~20 plain layers (training error stops decreasing) and scale nets to 1000+ layers; RNN long-term dependency windows grow from a few steps to dozens.
🎯Core Interview Exam Points
Fundamentals · Production Scenarios · Deep Dive
Core Def
Explain the core definition, underlying mechanism/math, and key principles of Vanishing/Exploding Gradients.
Use Cases
In production engineering, what are the primary use cases for Vanishing/Exploding Gradients and what core pain points does it solve?
🔥 High-Frequency Deep-Dive Questions
1
Explain vanishing/exploding gradients via ∏t∥Jt∥≤γT\prod_{t}\Vert J_t\Vert\le\gamma^T with the numeric example 0.950≈0.0050.9^{50}\approx0.005?
2
Why do RNNs suffer vanishing gradients more than CNNs? How does the LSTM additive cell-state path help?
3
Which variances do Xavier and Kaiming preserve? Why does Kaiming introduce a factor of 2 for ReLU?
4
Why do residual connections y=F(x)+xy=F(x)+x mitigate vanishing gradients? What does the identity-shortcut gradient highway mean?
5
Besides init and residuals, what other fixes exist (normalization / ReLU family / gradient clipping / LSTM gating)? Mechanisms?
Updated 2026-08-12
🎯
Test Your Knowledge: Practice Questions for "Vanishing/Exploding Gradients"
Single choice pitfall questions with instant feedback and mistake tracking.
🚀 Start Card Practice ➔
← Previous CardActivation FunctionsNext Card →Loss Functions

🔗 More Deep Learning Knowledge Cards

Adam & AdamWAutograd Compute GraphBatch NormalizationClassic CNN Architectures