[论文解读] h-detach: Modifying the LSTM Gradient Towards Better Optimization
本文提出 h-detach,一种针对 LSTM 网络的随机梯度修改方法,可防止单元状态路径中的梯度抑制——这对捕捉长时依赖关系至关重要。通过在反向传播过程中随机阻断隐藏状态的梯度,h-detach 提升了收敛速度、对超参数的鲁棒性以及在长程依赖任务上的泛化能力,且未增加计算成本,优于原始 LSTM 模型。
Recurrent neural networks are known for their notorious exploding and vanishing gradient problem (EVGP). This problem becomes more evident in tasks where the information needed to correctly solve them exist over long time scales, because EVGP prevents important gradient components from being back-propagated adequately over a large number of steps. We introduce a simple stochastic algorithm ( extit{h}-detach) that is specific to LSTM optimization and targeted towards addressing this problem. Specifically, we show that when the LSTM weights are large, the gradient components through the linear path (cell state) in the LSTM computational graph get suppressed. Based on the hypothesis that these components carry information about long term dependencies (which we show empirically), their suppression can prevent LSTMs from capturing them. Our algorithm\footnote{Our code is available at https://github.com/bhargav104/h-detach.} prevents gradients flowing through this path from getting suppressed, thus allowing the LSTM to capture such dependencies better. We show significant improvements over vanilla LSTM gradient based training in terms of convergence speed, robustness to seed and learning rate, and generalization using our modification of LSTM gradient on various benchmark datasets.
研究动机与目标
- 为解决 LSTMs 中的梯度爆炸与消失问题(EVGP),尤其是在需要长期记忆保持的任务中。
- 识别出大权重会通过线性单元状态路径抑制梯度分量,而这些分量承载着关于长时依赖关系的信息。
- 提出一种简单且高效的方法,防止此类抑制,从而提升优化稳定性与性能。
- 证明 h-detach 能够提升收敛速度、对学习率与权重初始化的鲁棒性,以及在基准任务上的泛化能力。
提出的方法
- h-detach 引入一种随机机制,在反向传播过程中使用伯努利随机变量 $\xi_t$ 阻断 LSTM 隐藏状态 $\mathbf{h}_t$ 的梯度流动。
- 该方法修改了反向传播过程,使得通过 $\mathbf{h}_t$ 的梯度以概率 $p$ 被置为零,而通过单元状态 $\mathbf{c}_t$ 的梯度保持不变。
- 这种随机阻断确保在期望上,梯度更新被调整以防止单元状态路径分量的抑制。
- 该方法计算高效,且与自动微分框架兼容,因为它仅修改反向传播过程。
- 理论分析表明,h-detach 有效抑制了非单元状态路径的梯度分量,同时保留了单元状态的贡献。
- 它被实现为对标准 LSTM 训练的轻量级修改,无需架构变更或额外参数。
实验结果
研究问题
- RQ1当权重较大时,LSTMs 中通过单元状态路径的梯度为何会被抑制?这如何影响长时依赖学习?
- RQ2能否通过对反向传播过程进行简单的随机修改,提升 LSTM 优化性能,且不增加计算成本?
- RQ3防止单元状态梯度抑制是否能带来更快的收敛速度和在长序列任务上的更好泛化能力?
- RQ4与梯度裁剪、注意力机制或酉 RNN 等现有方法相比,h-detach 在性能与效率方面表现如何?
主要发现
- 与原始 LSTM 相比,h-detach 在复制任务、序列 MNIST 和置换 MNIST 上显著提升了收敛速度。
- 该方法在多个基准测试中增强了对权重初始化和学习率超参数的鲁棒性。
- 使用 h-detach 训练的 LSTMs 在图像字幕生成和序列 MNIST 任务上实现了更好的泛化性能,即使图像字幕生成并非长程依赖任务。
- 实证结果表明,h-detach 即使在不使用梯度裁剪的情况下也能维持稳定的训练动态,表明对梯度爆炸的敏感性降低。
- 性能提升归因于单元状态路径中梯度流动的保留,而该路径承载着关于长时依赖关系的信息。
- h-detach 在训练稳定性和收敛速度方面优于现有方法,且相比注意力机制或辅助损失等替代方案,计算开销更低。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。