A vanilla RNN reuses the same weights at each step, so gradients vanish or explode over long sequences and it forgets distant context.
An LSTM adds a cell state with three gates: the forget gate (what to discard), the input gate (what new information to store), and the output gate (what to expose as the hidden state). The additive cell-state path keeps gradients alive.
A GRU merges these into two gates (update and reset), with fewer parameters and similar performance on many tasks.
Both are sequential, so they cannot parallelize across time steps, which is a main reason transformers replaced them in NLP.
Loading…