Skip to content
Road to Intelligence

Concept · Chapter 6: Language Before Transformers

LSTMs and GRUs

Must knowUnderstand15 minDifficulty

LSTMs and GRUs add learned gates to a recurrent network so it can keep, discard and update information more deliberately.

The problem

A plain RNN repeatedly transforms one hidden state, making old information and its training signal hard to preserve.

The solution

Use gates to control how much previous memory survives and how much new information is written at each step.

The consequence

Longer dependencies became more learnable, but the sequence still has to be processed step by step.

A memory with controls

Imagine reading "The keys to the old cabinet are missing." To predict the verb, the model needs to carry the plural subject across several intervening words. A plain RNN repeatedly overwrites one state. An LSTM gives memory a more direct route through time and learns gates that decide what to retain, write and reveal. A GRU uses a smaller gating arrangement with a similar aim.

Each gate is computed from the current input and previous state, passed through a sigmoid, then multiplied by an information path. A gate near 0 blocks most of that path; one near 1 lets it through. The values are learned during training, not hand-coded rules such as "remember nouns".

LSTMs made long-range sequence tasks practical and powered important translation systems. They did not remove the dependency between step tt and step t−1t-1: a recurrent model still has to read in order.

What to remember

  • A gate is a learned number between 0 and 1 that scales an information path.
  • An LSTM keeps a separate cell state with gates for writing and reading; a GRU combines memory and output more compactly.
  • Gating helps long-range learning but does not remove sequential computation.

Key papers

Essential

Long Short-Term Memory

Sepp Hochreiter, Jürgen Schmidhuber · 1997 · Neural Computation

LSTM added gated memory cells so recurrent networks could keep information over long sequences; it dominated sequence modelling until Transformers.

~1 h readdoi:10.1162/neco.1997.9.8.1735✓ verified 2026-09-26