4 · Transformers & LLMs

10. Sequences: RNNs, LSTMs and the Attention Breakthrough

Why recurrence hit a ceiling and how attention removed it.

10 min read · 3 MCQs

Recurrent models

An RNN carries a hidden state across time steps. Long dependencies suffer from vanishing gradients; LSTMs and GRUs added gates to hold information for longer, which powered translation and speech through the 2010s.

The bottleneck

Sequence-to-sequence models compressed an entire input into one fixed vector, and recurrence forced sequential computation, so training could not exploit parallel hardware.

Attention

Attention lets every output position look directly at every input position with learned weights. 'Attention Is All You Need' (2017) dropped recurrence entirely, giving full parallelism over sequence length and constant path length between any two tokens.

Chapter quiz

3 questions · pass mark 75%
  1. 1. The main limitation of RNNs for long sequences is…

  2. 2. Attention gives which advantage over recurrence?

  3. 3. The transformer paper appeared in…

Answer every question to submit. Progress for ai-10 is saved in this browser.