• English
  • // how large language models work

    Watch a language model think, one token at a time.

    Tokenizers, vectors, attention, backpropagation and the tricks behind today's models, each explained with a tiny example you can play, pause and poke.

    • 15 chapters
    • every figure is live
    • runs in your browser
    tokens intransformer layers ×4next tokenThe·cat·sat·on·themat 41%floor 18%sofa 14%·mat

    The whole idea in one loop

    A language model reads the text so far, scores every token it knows, picks one and appends it. Then it does it again. Press play, or step through it.

    Chapter 1 explains each step →
    The·cat·sat·on·the
    1. Read
    2. Layers
    3. Scores
    4. Pick
    5. Append
    1/25

    The model sees 5 tokens. It never sees letters, only these pieces (as numbers).

    Contents