Collection · 6 sites

Learning LLM Systems

How language models generate text, reuse computation and serve requests. Work through Modules 1–4 in order, each building on the one before; Module 0 and the Explorer are optional.

  • AI
  • LLM systems
Start with Module 1

Start here: Modules 1–4, in order

Module 1Interactive guide

LLM Inference: Foundations & KV Cache

Tokens, prefill, decode, attention, cache memory and prefix reuse through interactive diagrams.

Simplified simulations: no real model runs and no performance is measured.

  • Know dot products and matrix multiplication; Module 0 is a refresher

Built while studying PagedAttention, the Hugging Face cache guide and vLLM prefix caching. Covers prerequisites and related mechanisms, not the entire paper.

Open module

Module 3GPU systems

GPU Architecture and Performance Engineering

Map work to threads and memory, derive tiled matrix traffic, then compare prefill and decode with roofline models.

Analytical models in the browser: no GPU required and no speedup measured.

  • 5 lessons
  • After Module 2
Open module

Module 4Efficient attention

Efficient Attention and Memory

Derive online softmax, follow tile residency and IO, then resolve KV block tables, sharing and copy-on-write.

Computed CPU teaching models: no GPU or measured speedup.

Needs from earlier modules: 2.1 and 2.3–2.5 (attention, KV heads, cache, memory), plus 3.3 and 3.5 (tiling; prefill vs decode). Lessons 4.1–4.3 open with the Module 3 terms they use.

  • 5 lessons
  • After Module 3
Open module

Optional companions: use when you need them

Module 0Optional toolkit

Mathematical Notation for Systems Engineers

Notation, indices, tensor shapes and stable softmax, connected to the attention equations.

Optional checks explain mistakes without scores or gates.

  • 6 lessons
Open toolkit

OptionalVisual companion

Transformer Architecture Explorer

Open a causal decoder in 3D, trace Q/K/V and head sharing, and inspect tensor shapes.

A schematic: it runs no pretrained model.

  • Pairs with lessons 2.1–2.3
Open explorer