Plain RNNs multiply gradients through time, so error signal either vanishes or explodes over long sequences. The LSTM adds a protected cell state that information flows through with mostly additive updates — an uninterrupted gradient highway. Three learned gates regulate that highway, letting the network hold context for hundreds of steps.
fₜ = σ(·) — decides what fraction of old memory to erase.
iₜ + tanh candidate — chooses which new info to write in.
Cₜ — the long-term memory conveyor belt, additive path.
oₜ → hₜ = oₜ ⊙ tanh(Cₜ) — what to expose now.
1. Why does the additive cell-state update fix the vanishing-gradient problem that plagues plain RNNs? Hint: think about what happens to gradients under repeated multiplication vs. repeated addition.
2. If the forget gate outputs values near 1 for every step, what behavior would you expect from the cell state — and when is that useful? Hint: near-1 means memory is preserved almost untouched; consider very long dependencies.
3. When would you reach for a GRU or a Transformer instead of an LSTM? Hint: weigh parameter count / speed (GRU) and parallelism over long context (attention).