AdvancedAbout 35 min

    Transformer Explainer

    Read the full article on Substack

    7 min read.

    Learn how Transformer models like GPT work with a toy transformer running in your browser (8-word vocabulary, 4-number vectors, random weights). Step through embeddings, attention and next-word probabilities.

    thecatsatonthe

    The model gets a sentence, cut into tokens. It does not know what any word means yet.

    1/3

    Check your understanding

    Answer from memory before you scroll back up. Pulling an idea out of your head is what makes it stay there.

    One transformer block

    Sequence

    Order the sub-layers of a pre-norm decoder block.

    Tap a piece, then tap where it goes — or drag it. Tap the tray to take one back.

    1. 1Drop a step here
    2. 2Drop a step here
    3. 3Drop a step here
    4. 4Drop a step here
    5. 5Drop a step here
    6. 6Drop a step here
    6 pieces left to place

    Quiz

    20 questions
    Question 1 of 20
    Score: 0

    Transformer Explainer visualizes how a GPT-style model…

    Done with this lesson?

    Sign in free to keep your progress, streak and quiz scores.

    Keep going