# 梯度消失问题

梯度消失问题是指神经网络中的误差梯度在反向传播经过许多层或时间步时趋于零的现象，导致较早的权重获得的更新量过小，无法从中学习。它主要影响通过反向传播训练的深层前馈网络和循环神经网络，也正是序列中长期依赖关系的学习长期被视为困难的原因。<sup>[1](https://doi.org/10.1142/S0218488598000094)</sup><sup> • </sup><sup>[2](https://pubmed.ncbi.nlm.nih.gov/18267787/)</sup>

| 关键事实 | 详情 |
|---|---|
| 定义 | 损失梯度在反向传播步骤中数值消失，因此远离输出的权重获得可忽略的更新<sup>[3](https://openresearch-repository.anu.edu.au/bitstreams/ac9d83e7-8ea4-4db4-a6d0-5de511990b0b/download)</sup> |
| 数学成因 | 雅可比矩阵的长乘积；若每个单步因子的范数至多为κ < 1，则跨越T − t步的梯度被κ^(T−t)所界定<sup>[4](https://mlmetrics.org/recurrent_neural_networks.html)</sup> |
| 首次分析 | 泽普·霍赫赖特，1991年毕业论文；在1997年期刊论文中扩展，分析循环网络中误差流的衰减<sup>[1](https://doi.org/10.1142/S0218488598000094)</sup><sup> • </sup><sup>[5](https://github.com/hgus107/AI-History/blob/main/06-Statistical-Era-%281990s%29/1991-Hochreiter-Vanishing-Gradient.md)</sup> |
| 有影响力的形式化 | 本吉奥、西马尔和弗拉斯科尼，《IEEE神经网络汇刊》5(2):157–166，1994年<sup>[2](https://pubmed.ncbi.nlm.nih.gov/18267787/)</sup> |
| 对应现象 | 梯度爆炸，即相同的雅可比乘积增长而非收缩；通常是致命的失败模式（NaN、发散），而梯度消失则是一种可控的局限<sup>[4](https://mlmetrics.org/recurrent_neural_networks.html)</sup><sup> • </sup><sup>[6](https://ronsgit.github.io/DL4CV/Chapter_16_Lecture_16_Recurrent_Networks.html)</sup> |
| 标准补救方法 | 门控架构（LSTM、GRU）、残差连接、ReLU激活函数、谨慎的权重初始化，以及针对梯度爆炸情况的梯度裁剪<sup>[7](https://etd.lib.metu.edu.tr/upload/12622769/index.pdf)</sup><sup> • </sup><sup>[8](https://vizlearn.in/deep_learning/vanishing_vs_exploding_gradient.html)</sup> |

## 机制

反向传播——由大卫·E·鲁梅尔哈特、杰弗里·E·辛顿和[罗纳德·J·威廉姆斯](https://www.edgepedia.org/zh/ronald-j-williams)于1986年在《自然》杂志上描述的学习过程——反复调整连接权重以最小化实际输出与期望输出之间的差异，将误差信号沿网络反向传播。<sup>[9](https://doi.org/10.1038/323533a0)</sup> 在通过时间反向传播训练的循环网络中，循环被展开为一个T层前馈网络，每一步复用相同的权重，而关于早期状态的梯度包含一个单步雅可比矩阵的乘积，每个时间步一个因子。<sup>[10](https://jiahuic.github.io/teaching/math-4990v5990v/14-rnn/)</sup>

该乘积的大小决定结果。对于普通RNN，梯度包含形如diag(g′(z)) W_hh的项的乘积，其中W_hh是循环权重矩阵，g′是激活函数的导数。若每个因子的[谱范数](https://www.edgepedia.org/zh/spectral-norm)至多为κ且0 ≤ κ < 1，由次乘性可知，整个乘积的谱范数以κ^(T−t)为上界，因此一个固定的终端损失在传向早期状态的过程中被乘以一个几何收缩的因子；在有界局部导数下，早期步骤的贡献在数值上变得可忽略。<sup>[4](https://mlmetrics.org/recurrent_neural_networks.html)</sup> 对于tanh激活函数，其导数介于零和一之间，‖W_hh‖ < 1是该收缩的充分条件。<sup>[4](https://mlmetrics.org/recurrent_neural_networks.html)</sup> 若主导奇异值反而超过1，例如‖J‖ ≈ 1.1，这仅允许潜在的增长，因为增长取决于雅可比矩阵的乘积及其作用方向，并不必然导致长序列上的梯度爆炸。<sup>[6](https://ronsgit.github.io/DL4CV/Chapter_16_Lecture_16_Recurrent_Networks.html)</sup><sup> • </sup><sup>[4](https://mlmetrics.org/recurrent_neural_networks.html)</sup>

同样的数学适用于前馈网络中的深度维度：没有捷径时，梯度必须依次经过每一个变换，许多小雅可比矩阵的乘积将其驱向零，这在残差网络出现之前限制了网络的深度。<sup>[11](https://praveentn.live/learn/concepts/layernorm-residual-connections)</sup>

## 历史

**霍赫赖特1991年的分析。** 当时在[慕尼黑工业大学](https://www.edgepedia.org/zh/technical-university-of-munich)的泽普·霍赫赖特分析了循环网络中误差流的衰减，并展示了为什么当相关输入与期望输出之间相隔许多时间步时，基于梯度的学习需要极长的时间。<sup>[1](https://doi.org/10.1142/S0218488598000094)</sup> 1994年，[约书亚·本吉奥](https://www.edgepedia.org/zh/yoshua-bengio)、帕特里斯·西马尔和保罗·弗拉斯科尼独立重新发现了这一问题，并在《IEEE神经网络汇刊》上发表了他们的分析。<sup>[5](https://github.com/hgus107/AI-History/blob/main/06-Statistical-Era-%281990s%29/1991-Hochreiter-Vanishing-Gradient.md)</sup> 他们的论文展示了为什么随着待捕获依赖关系持续时间的增加，基于梯度的学习面临越来越困难的问题，揭示了通过梯度下降高效学习与长期保持信息之间的权衡。<sup>[2](https://pubmed.ncbi.nlm.nih.gov/18267787/)</sup>

这对该领域的影响是巨大的。带有标准反向传播的标准sigmoid网络无法用于深层架构，人们普遍认为从头训练极深的网络是不可能的；1991年至2015年间深度学习中几乎每一项重大架构创新都可以被解读为对梯度消失问题的回应。<sup>[5](https://github.com/hgus107/AI-History/blob/main/06-Statistical-Era-%281990s%29/1991-Hochreiter-Vanishing-Gradient.md)</sup><sup> • </sup><sup>[12](https://www.mjjsmith.com/reports/mikes_thesis.pdf)</sup>

## 补救方法

**门控循环架构。** [长短期记忆](https://www.edgepedia.org/zh/long-short-term-memory)（LSTM）和门控循环单元（GRU）是专门为解决该问题而提出的。<sup>[7](https://etd.lib.metu.edu.tr/upload/12622769/index.pdf)</sup> 由于它们的细胞状态以加法方式更新——先前状态经遗忘机制门控后与候选变化相结合——这些单元在循环设置中起到类似残差连接的作用，使其能够处理比基本RNN长得多的序列。<sup>[8](https://vizlearn.in/deep_learning/vanishing_vs_exploding_gradient.html)</sup> 霍赫赖特本人1997年的论文将长短期记忆列为使长时间滞后问题能在合理时间内解决的方法之一。<sup>[1](https://doi.org/10.1142/S0218488598000094)</sup>

**残差连接。** 残差块计算输出 = F(x) + x，其导数为F′(x) + 1，为梯度提供了一条绕过学习变换的直接路径。<sup>[8](https://vizlearn.in/deep_learning/vanishing_vs_exploding_gradient.html)</sup> 在变换器中，层归一化相对于残差分支的位置很重要：Post-LN变换器存在梯度消失问题，阻碍了深层模型的训练，而Pre-LN变换器避免了这一问题，但代价是表示坍缩；ResiDual架构融合了两者以继承其优势。<sup>[13](https://arxiv.org/abs/2304.14802)</sup>

**激活函数与初始化。** 循环网络的两种常用技术是将循环权重矩阵初始化为单位矩阵而非小的随机值，以及使用ReLU（max(0, x)）替代tanh或sigmoid，前者的导数为0或1。<sup>[7](https://etd.lib.metu.edu.tr/upload/12622769/index.pdf)</sup> 格洛罗和本吉奥2010年对深层前馈网络的分析发现，逻辑sigmoid不适用于随机初始化的深层网络，因为其均值将顶层隐藏层驱入饱和状态，且当每层雅可比矩阵的奇异值远离1时训练更加困难；他们的初始化方案带来了显著更快的收敛。<sup>[14](https://proceedings.mlr.press/v9/glorot10a.html)</sup>

**架构替代方案。** NARX循环网络反馈的是输出值而非隐藏状态，它并不绕过长期依赖问题，但能比传统循环网络保持信息两到三倍长的时间，且收敛更快。<sup>[15](https://ieeexplore.ieee.org/document/548162/)</sup> 后来的设计包括循环身份网络，它使普通循环网络无需门控即可克服梯度消失，<sup>[16](https://arxiv.org/abs/1801.06105)</sup> 以及谱RNN，它显式控制权重矩阵的奇异值。<sup>[17](https://arxiv.org/abs/1803.09327)</sup>

## 图景的细化

后来的工作表明，仅凭梯度大小并不能完全解释深层网络中的训练困难。使用相同普通架构且在初始化时具有相似梯度消失的实验产生了不同的性能表现，而同样消除了梯度消失的架构之间仍然存在差异，这使作者得出结论：梯度消失并非训练困难的唯一解释。<sup>[18](https://openreview.net/pdf?id=HkwBEMWCZ)</sup> 层间的梯度相关性也很重要：梯度相关性较高的模型即使在梯度绝对值较低时也能更好地收敛。<sup>[19](https://openreview.net/pdf?id=5fJ0qcwBNr0)</sup>

具体到循环网络，尼古拉·祖凯和安东尼奥·奥尔维耶托2024年的一项分析发现，随着网络记忆的增加，其参数变化产生越来越大的输出变化，使得基于梯度的学习即使没有梯度爆炸也变得高度敏感。逐元素循环结合谨慎的参数化可以缓解这一效应，这一特征存在于状态空间模型和LSTM中，为某些架构为何比其他架构更好地学习长期记忆提供了新的解释。<sup>[20](https://arxiv.org/abs/2405.21064)</sup>

## References

1. [Sepp Hochreiter (1998). The Vanishing Gradient Problem During Learning Recurrent Neural Nets and Problem Solutions. International Journal of Uncertainty, Fuzziness and Knowledge-Based Systems.](https://doi.org/10.1142/S0218488598000094)
2. [Yoshua Bengio, Patrice Simard, Paolo Frasconi (1994). Learning long-term dependencies with gradient descent is difficult. IEEE Transactions on Neural Networks 5(2):157–166.](https://pubmed.ncbi.nlm.nih.gov/18267787/)
3. [The Vanishing Gradient Problem (VGP), ANU open research repository thesis.](https://openresearch-repository.anu.edu.au/bitstreams/ac9d83e7-8ea4-4db4-a6d0-5de511990b0b/download)
4. [Vanishing and Exploding Gradients, MLmetrics: Machine Learning for Econometricians.](https://mlmetrics.org/recurrent_neural_networks.html)
5. [1991 Hochreiter Vanishing Gradient, AI-History repository.](https://github.com/hgus107/AI-History/blob/main/06-Statistical-Era-%281990s%29/1991-Hochreiter-Vanishing-Gradient.md)
6. [Lecture 16: Recurrent Networks, DL4CV.](https://ronsgit.github.io/DL4CV/Chapter_16_Lecture_16_Recurrent_Networks.html)
7. [METU thesis on techniques for the vanishing gradient problem in RNNs.](https://etd.lib.metu.edu.tr/upload/12622769/index.pdf)
8. [Vanishing & Exploding Gradients, VizLearn.](https://vizlearn.in/deep_learning/vanishing_vs_exploding_gradient.html)
9. [David E. Rumelhart, Geoffrey E. Hinton, Ronald J. Williams (1986). Learning representations by back-propagating errors. Nature 323:533–536.](https://doi.org/10.1038/323533a0)
10. [Lecture 14 — Recurrent Neural Networks, Jiahui Chen.](https://jiahuic.github.io/teaching/math-4990v5990v/14-rnn/)
11. [Layer Normalization and Residual Connections, Praveen T N.](https://praveentn.live/learn/concepts/layernorm-residual-connections)
12. [Mike Smith, thesis: Sidestepping the Vanishing Gradient Problem.](https://www.mjjsmith.com/reports/mikes_thesis.pdf)
13. [Shufang Xie et al. (2023). ResiDual: Transformer with Dual Residual Connections. arXiv.](https://arxiv.org/abs/2304.14802)
14. [Xavier Glorot, Yoshua Bengio (2010). Understanding the difficulty of training deep feedforward neural networks. AISTATS, PMLR 9:249–256.](https://proceedings.mlr.press/v9/glorot10a.html)
15. [Learning long-term dependencies in NARX recurrent neural networks. IEEE Transactions on Neural Networks 7(6):1329–1338, 1996.](https://ieeexplore.ieee.org/document/548162/)
16. [Overcoming the vanishing gradient problem in plain recurrent networks. arXiv.](https://arxiv.org/abs/1801.06105)
17. [Stabilizing Gradients for Deep Neural Networks via Efficient SVD Parameterization. arXiv.](https://arxiv.org/abs/1803.09327)
18. [Balduzzi et al. (2018). The Shattered Gradients Problem. ICLR 2018.](https://openreview.net/pdf?id=HkwBEMWCZ)
19. [ICLR 2021 submission on gradient values and correlations in network architecture search.](https://openreview.net/pdf?id=5fJ0qcwBNr0)
20. [Nicolas Zucchet, Antonio Orvieto (2024). Recurrent neural networks: vanishing and exploding gradients are not the end of the story. arXiv.](https://arxiv.org/abs/2405.21064)

---
*Initially written Sep 17, 2026 · Reviewed: Sep 17, 2026; Sep 30, 2026; Oct 15, 2026 · Edited: Sep 30, 2026; Oct 15, 2026 · Last review: Oct 15, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 人工智能与数据 › Machine learning and neural computation › Neural networks and deep learning › Neural networks overview

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/vanishing-gradient-problem

English original: https://www.edgepedia.org/vanishing-gradient-problem
