LLM Explained

The course map

131 episodes in 19 modules and four parts. Each part covers a different area. Start at the top and nothing is assumed, or skip what you already know. 5 transcripts are ready to read, one with its full written lesson.

Part 1

Foundations

Start here: no code or math needed. Use LLMs well, see how computers run code, learn Python from zero, and the math of AI drawn as pictures.

Already write Python? Skip Module 3. Comfortable with vectors and probability? Skim Module 4.

4

The Math of AI, Visually

From school algebra to everything an LLM uses. Pictures first, symbols second.

  1. 4.1 Functions and graphs Coming soon
  2. 4.2 Vectors Coming soon
  3. 4.3 The dot product is similarity Coming soon
  4. 4.4 Matrices and matrix multiplication Coming soon
  5. 4.5 Derivatives Coming soon
  6. 4.6 The chain rule Coming soon
  7. 4.7 Probability and distributions Coming soon
  8. 4.8 Exponentials, logs and softmax Coming soon
  9. 4.9 Cross-entropy: measuring surprise Coming soon

Checkpoint: Multiply two small matrices by hand and explain what softmax does.

Part 2

How Machines Learn

Machine learning from the ground up. Build a neural network from scratch, move to PyTorch, then turn language into numbers.

Trained neural networks in PyTorch before? Skim to Module 8.

Part 3

Building LLMs

Build a GPT yourself, then see how modern LLMs differ, how labs train them, and how apps are built on them.

Know the transformer well? Start at Module 10.

9

The Transformer

Build the architecture behind every modern LLM, piece by piece.

  1. 9.1 Attention: the intuition Coming soon
  2. 9.2 Queries, keys and values Coming soon
  3. 9.3 Scaled dot-product and causal masking Coming soon
  4. 9.4 Multi-head attention Coming soon
  5. 9.5 The feed-forward block Coming soon
  6. 9.6 Residuals and layer norm Coming soon
  7. 9.7 Position: from sinusoids to RoPE Coming soon
  8. 9.8 Assembling GPT Coming soon
  9. 9.9 Counting parameters and FLOPs Coming soon

Checkpoint: Draw a transformer block from memory and calculate its parameter count.

Part 4

LLMs in Production

Inference engineering: serving LLMs fast and cheap, layer by layer, from the GPU chip up to production.

Already know how transformers work? You can start here.

13

How Inference Works

Know exactly where the time and money go when a model runs.

  1. 13.1 The inference stack: three layers Coming soon
  2. 13.2 Prefill and decode Coming soon
  3. 13.3 The KV cache Coming soon
  4. 13.4 Latency metrics: TTFT, TPS, ITL Coming soon
  5. 13.5 Throughput vs latency Coming soon
  6. 13.6 Compute-bound vs memory-bound Coming soon
  7. 13.7 Calculating bottlenecks by hand Coming soon
  8. 13.8 Optimizing attention Coming soon
  9. 13.9 Budgets: picking a model for your app Coming soon

Checkpoint: Given a model and a GPU, estimate TTFT and decode speed within 2x.