Become an AI engineer

The transformer

The transformer is a unit of 19 lessons in Rabbithole's Become an AI engineer course, at levels 3 to 5.

Lessons

  1. Long context: why attention gets expensive and how to cut the costLevel 3
  2. The Transformer: Blocks, Variants and Loading OneLevel 3
  3. Attention: how tokens share informationLevel 3
  4. Beam search: keeping several candidates while decodingLevel 3
  5. BERT: an encoder trained to read both waysLevel 3
  6. Encoder–decoder architectureLevel 3
  7. Feed-forward layers: the per-token computation in a transformerLevel 3
  8. Grouped-Query AttentionLevel 4
  9. KV Caching and Cross-Layer SharingLevel 4
  10. Latent generalization: what a model can't read off the pageLevel 4
  11. Masked language modelling: hide a token, predict it from both sidesLevel 3
  12. Mixture of experts: routing, balancing and capacityLevel 4
  13. Multi-head attention: many small attentions in parallelLevel 4
  14. Scaled dot-product attentionLevel 4
  15. Sliding Window AttentionLevel 4
  16. Sparse Attention: Scoring, Selecting and SkippingLevel 4
  17. Vision Transformer: an image as a sequence of patchesLevel 4
  18. FlashAttention: exact attention that respects the memory hierarchyLevel 5
  19. State-space models: a recurrent state you must size and snapshotLevel 5

Sources

These lessons draw on 29 sources. The most used:

All units in Become an AI engineer