Skip to content
Learn with AlakhSharma

C11

Transformers and Attention from Scratch

5 lessons4 hoursPlannedFree

Outcome

Implement scaled dot-product attention and a small Transformer.

Prerequisites

Lessons

  1. L01Attention mechanism · coming soonExercise: Implement attention on toy sequences.
  2. L02Multi-head attention and masking · coming soonExercise: Add causal masking.
  3. L03Positional encodings · coming soonExercise: Compare sinusoidal and learned encodings.
  4. L04Transformer block · coming soonExercise: Build and train a character-level language model.
  5. L05Inference: KV cache basics · coming soonExercise: Measure generation speed with and without caching.