Vanishing Gradients › The Path to LSTM: What the Architecture Needs
Language AI HandbookAll chapters Vanishing Gradients › The Path to LSTM: What the Architecture NeedsOne section · Sections in this chapter15 / 18 ↓
Reading tools Definitions & inline links
Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.
Article links
Make inline references clickable
The vanishing gradient problem has practical consequences. It is the reason vanilla RNNs are rarely used in modern NLP despite their elegant formulation. The failure is architectural: there is no mechanism in the basic RNN to independently control how much information is retained versus discarded across time, or how much gradient signal is allowed to flow backward.
Any solution to the vanishing gradient problem must address this root cause. The architecture needs a way to:
- Preserve information over long distances without the information being transformed (and potentially diluted) at every step.
- Selectively update which information in memory is relevant to the current input.
- Control gradient flow such that gradients can propagate backward without being repeatedly multiplied by the same shrinking factors.
The LSTM architecture, introduced by Hochreiter and Schmidhuber in 1997, addresses all three requirements through a combination of a separate memory cell and learnable gate mechanisms. Rather than passing the hidden state through a nonlinearity at every step, the LSTM maintains a cell state that can change by addition rather than multiplication. Because addition does not shrink gradient magnitudes the way multiplication does, gradients can flow backward through the cell state pathway with minimal attenuation.
Why Addition Solves the Problem
To see intuitively why addition helps, consider the gradient through an additive update. Suppose the cell state evolves as for some input-dependent function . The gradient of with respect to is then:
The gradient is identically 1, regardless of sequence length. Information from any timestep is equally accessible via the cell state pathway. The LSTM's actual update is slightly more complex because the forget gate modulates before the addition, but the key insight remains: an additive update path creates a near-constant gradient that does not decay with distance.
This is the conceptual heart of LSTM and, later, of residual connections in deep networks. The additive pathway is a gradient highway, allowing the loss at the final timestep to reach and update weights at any earlier position. The gates in LSTM control what information enters the highway and what exits it, but the highway itself is always open.
We will explore the LSTM architecture in detail in the next chapter, and then examine the mathematics of LSTM gradient flow in the chapter after that. The key insight to carry forward from this chapter is that the vanishing gradient problem is a consequence of the multiplicative gradient chain, and any solution must break or bypass this chain for long-distance signals.