Sequences are everywhere in computation: a sentence is a sequence of words, a genome is a sequence of bases, a melody is a sequence of notes. The natural tool for sequences is the recurrent neural network (RNN) — a loop that reads one element at a time and passes a hidden state forward, so each step can "remember" what came before.
The trouble is that a plain RNN suffers from the vanishing-gradient problem: as you backpropagate errors across many time steps the gradients shrink exponentially, meaning the network can barely learn from context more than a handful of steps away. Ask it to translate the first word of a long sentence using information from the last, and it has effectively forgotten.
Sepp Hochreiter and Jürgen Schmidhuber introduced the Long Short-Term Memory (LSTM) in 1997 to fix this. Instead of a single hidden state that gets noisily overwritten at each step, an LSTM maintains a dedicated cell state — a kind of conveyor belt of memory — protected by three multiplicative gates:
- Forget gate — decides what fraction of the old memory to erase.
- Input gate — decides how much of a new candidate value to write in.
- Output gate — decides what part of the cell state to expose as the hidden state.
Each gate is a sigmoid (outputting 0–1) applied to a learned linear combination of the current input and the previous hidden state, so the network learns what to remember and what to discard. Gradients now flow almost unchanged through the cell state, bypassing the vanishing-gradient collapse.
In 2014, Junyoung Chung, Caglar Gulcehre, KyungHyun Cho, and Yoshua Bengio proposed the Gated Recurrent Unit (GRU), a streamlined alternative with only two gates — a reset gate and an update gate — and no separate cell state. The GRU is faster to train and often matches LSTM quality on shorter sequences. Both architectures powered the neural machine translation revolution and every major sequence-to-sequence task before the arrival of Transformers.
Comments
Loading comments...