the complete roadmap

How an LLM is born

From four matrices of random numbers to a working model you can download and publish — eleven chapters and seven hands-on labs, taken one clear step at a time.

11 chapters 7 hands-on labs real python, in the browser no install
Part I · the ideas
  1. 0
    before chapter one
    The Big 4

    Meet the four matrices of random numbers that a trillion corrections turn into a mind.

  2. 1
    chapter 01
    A brain of random numbers

    Day one: 268 million meaningless fractions, every one perfectly balanced.

  3. 2
    chapter 02
    Cutting language into bricks

    Tokenisation — chopping text into the units a model actually reads.

  4. L1
    hands-on lab
    Tokeniser

    Build byte-pair encoding from scratch and watch it discover its vocabulary.

  5. 3
    chapter 03
    The lookup table

    Give every token 4,096 coordinates — a position in the space of meaning.

  6. 4
    chapter 04
    A trillion guesses

    Pre-training: guess the next word, be wrong, nudge every number a hair, repeat.

  7. 5
    chapter 05
    Constellations

    Meaning becomes location — words drift into clusters entirely on their own.

  8. L2
    hands-on lab
    The embedding matrix

    Train embeddings and watch the map sort itself out, live, from nothing.

  9. 6
    chapter 06
    Same row, two meanings

    Why a frozen dictionary definition can't be the whole story.

  10. 7
    chapter 07
    The party

    Self-attention: queries, keys and values, and the 8×8 map of who listens to whom.

  11. L3
    hands-on lab
    Queries, keys & values

    One attention head, forward and backward pass, written out by hand — no autograd.

  12. 8
    chapter 08
    Layer on layer

    Stacking, residual connections, and why the rectangle never changes size.

  13. L4
    hands-on lab
    Depth

    Twelve models: see why residuals and LayerNorm are non-negotiable at depth.

  14. 9
    chapter 09
    Charm school

    Fine-tuning: turn a brilliant text-predictor into something that will actually help.

  15. L5
    hands-on lab
    The whole thing

    Train a full model over 600 sentences, then catch it memorising.

  16. 10
    chapter 10
    The ink dries

    Inference: the weights freeze, the thought forms, and then it dissolves.

  17. the pipeline
    The whole thing, end to end

    Every step of the loop, at speed, from text in to the next word out.

  18. 11
    chapter 11
    The receipt

    Where the “7B” in a model's name actually comes from.

  19. L6
    hands-on lab
    Freeze it

    Write a real safetensors file by hand, then read it straight back.

  20. L7
    hands-on lab
    Publish

    Give it a model card and push your model to the Hugging Face Hub.

Ready to build one?

Start from the top →