Transformers: Big Picture
AI & ML: lesson 7 of 15
A stack of identical blocks refining one sequence.
Lesson 7 of 15 · 5 min
Transformers: Big Picture
Step 1 of 12
A transformer is a stack of identical blocks refining one sequence. Start with the text.
The Idea
A transformer turns tokens into vectors, adds position information, then pushes them through many identical blocks. Each block mixes across positions with attention, then transforms each position on its own. The last layer scores every vocabulary entry.
Real-World Example
A relay of copy-editors. One manuscript passes across thirty identical desks; each editor may read the whole document and nudge every sentence slightly. No single desk rewrites it.
The Tradeoff
Attention compares every position with every other, so cost grows with the square of sequence length — which is why long inputs are expensive and why approximate attention schemes exist at all. Older recurrent models were cheaper per token but had to read strictly in order; transformers buy parallel training with that quadratic bill.
Your turn
Put the steps in the right order.
- Run the stack of identical blocks: attention, then a per-position network
- Split the text into tokens and look up a vector for each
- Score every vocabulary entry to pick what comes next
- Add position information so word order is not lost
Mini quiz
1 / 3