DL
advanced
Self-Attention Mechanism
Interactive visualization of how self-attention works in transformer models.
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
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.
- 1Drop a step here
- 2Drop a step here
- 3Drop a step here
- 4Drop a step here
- 5Drop a step here
- 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