build · hands-on · pytorch

Build your own tiny LLM from scratch.

A code-along walkthrough — open the article in one tab, your editor in another. By the end you've written every line of a working 10M-parameter transformer that generates coherent toy text. Every concept cross-references the matching article and interactive demo, so the math, the visualization, and the code are one click apart.

17
steps
17
ready to read
5h 31m
of reading
7h 7m
of hands-on
the destination

What you end up with

the model
10M-param GPT
A decoder-only transformer with multi-head attention, layer norm, and a learned tokenizer. Yours. Runs in your browser by step 15.
the training
TinyStories quality
Trained on the TinyStories corpus to write coherent simple stories. Not ChatGPT — but every line of how it works, you wrote.
the understanding
Full-stack mental model
Tokenization, attention, gradients, sampling, KV cache, fine-tuning — every concept in modern AI, implemented and validated against the demos you've already explored.
the path

The 17-step curriculum

Three phases, each a coherent run. Live steps render now; stubs mark what's coming. Numbers are stable — you can bookmark step 05 today and it'll still be step 05 next month.

How this fits the rest of the site

Every step cross-references the matching theory article and interactive demo. When you implement attention in step 05, the page links to the math derivation and the Attention Inspector. The site becomes a multi-modal study environment: code in your editor, math in one tab, real-model visualization in another.

You're not expected to have read the theory articles first. The build track is self-contained — but if anything in a step feels shaky, the matching theory + demo are exactly one click away.

Status: 17 live · 0 wip · 0 stubbed. The full ~3-month roadmap is set; articles ship in three releases (foundations → model → make it real).