DL
    advanced

    Self-Attention Mechanism

    algorithms.live

    Self-Attention Mechanism

    Click on any word to see which other words it pays attention to

    Peak Focus: 40%

    Click a word to see what it pays attention to:

    "sat" attending to all tokens

    Line thickness shows attention strength

    satQUERY10%TheKEY/VALUE35%catKEY/VALUE40%satKEY/VALUE10%onKEY/VALUE3%theKEY/VALUE2%matKEY/VALUE

    Attention Pattern Analysis

    "sat" pays strongest attention to:

    sat
    40%
    cat
    35%
    The
    10%

    Linguistic Pattern

    "sat" (verb) attends to "cat" (subject) - classic subject-verb relationship!

    These patterns emerge automatically from training - the model learns grammar without explicit rules!

    Scaled dot-product attention

    Sequence

    Order the computation.

    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

    Test your knowledge

    20 questions
    Question 1 of 20
    Score: 0

    Self-attention lets each token in a sequence…

    Learn these first

    Interview Questions

    Google
    Meta
    OpenAI
    Anthropic
    Google
    Microsoft
    NVIDIA
    Google
    Amazon
    Meta
    Allen AI
    Google
    Anthropic
    Meta
    GitHub
    Google
    Meta
    Mistral AI

    Love this visualization?

    Sign up to track your progress, earn achievements, use the AI assistant, and access your personal learning dashboard.

    100% free • No credit card required