Skip to main content
QUICK REVIEW

[Paper Review] h-detach: Modifying the LSTM Gradient Towards Better Optimization

Devansh Arpit, Bhargav Kanuparthi|arXiv (Cornell University)|Oct 6, 2018
Stochastic Gradient Optimization TechniquesComputer Science12 citations
TL;DR

This paper proposes h-detach, a stochastic gradient modification for LSTM networks that prevents gradient suppression in the cell state path—critical for capturing long-term dependencies. By stochastically blocking gradients through the hidden state during backpropagation, h-detach improves convergence speed, robustness to hyperparameters, and generalization on tasks with long-range dependencies, outperforming vanilla LSTM without increasing computational cost.

ABSTRACT

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.

Motivation & Objective

  • To address the exploding and vanishing gradient problem (EVGP) in LSTMs, especially on tasks requiring long-term memory retention.
  • To identify that large LSTM weights suppress gradient components through the linear cell state path, which carry information about long-term dependencies.
  • To propose a simple, efficient method that prevents this suppression, improving optimization stability and performance.
  • To demonstrate that h-detach enhances convergence speed, robustness to learning rate and weight initialization, and generalization on benchmark tasks.

Proposed method

  • h-detach introduces a stochastic mechanism that blocks gradient flow through the LSTM hidden state $\mathbf{h}_t$ during backpropagation using a Bernoulli random variable $\xi_t$.
  • The method modifies the backpropagation process such that gradients through $\mathbf{h}_t$ are set to zero with probability $p$, while gradients through the cell state $\mathbf{c}_t$ remain unaffected.
  • This stochastic blocking ensures that in expectation, the gradient updates are adjusted to prevent suppression of cell state path components.
  • The approach is computationally efficient and compatible with automatic differentiation frameworks, as it only modifies the backward pass.
  • Theoretical analysis shows that h-detach effectively dampens gradient components from non-cell-state paths, preserving the cell state's contribution.
  • It is implemented as a lightweight modification to standard LSTM training, requiring no architectural changes or additional parameters.

Experimental results

Research questions

  • RQ1Why do gradients through the cell state path in LSTMs get suppressed when weights are large, and how does this affect long-term dependency learning?
  • RQ2Can a simple stochastic modification to the backpropagation process improve LSTM optimization without increasing computational cost?
  • RQ3Does preventing suppression of cell state gradients lead to faster convergence and better generalization on long-sequence tasks?
  • RQ4How does h-detach compare to existing methods like gradient clipping, attention mechanisms, or unitary RNNs in terms of performance and efficiency?

Key findings

  • h-detach significantly improves convergence speed on the copying task, sequential MNIST, and permuted MNIST compared to vanilla LSTM.
  • The method enhances robustness to weight initialization and learning rate hyperparameters across multiple benchmarks.
  • LSTMs trained with h-detach achieve better generalization performance on image captioning and sequential MNIST, even though image captioning is not a long-range dependency task.
  • Empirical results show that h-detach maintains stable training dynamics even without gradient clipping, suggesting reduced sensitivity to gradient explosion.
  • The improvement is attributed to preserved gradient flow through the cell state path, which carries information about long-term dependencies.
  • h-detach outperforms existing methods in terms of training stability and convergence while reducing computational overhead compared to alternatives like attention or auxiliary losses.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.