Why did transformers replace RNNs for sequence modeling?
medium- RNNs process tokens sequentially, so they don't parallelize across time and struggle with long-range dependencies due to vanishing gradients (LSTMs help but only partly).
- Transformers process all tokens in parallel with attention, capture arbitrary-range dependencies directly, and scale much better on GPUs/TPUs.
- RNNs still appear in niche low-resource or online settings and in modern SSMs (Mamba) that revisit sequential modeling.