Neural Ninjas ยท Agentic AI Lab
Self-Attention: Theatre Stage & Solar System
Sentence: "The cat sat on the mat" โ pick a word, pick a head, watch attention move.
๐ญ Spotlights follow attention
Brighter spotlight = higher attention weight from the token in the gold box
Head 0 โ local (looks at neighbor)
Head 1 โ subject tracking ("cat")
Head 2 โ broad / diffuse
What this showsEach actor's spotlight brightness is that word's attention weight โ the floor grid marks fixed positions, same idea as positional encoding.
๐ The sun is whichever word is asking
Closer orbit = higher attention weight to that word
Head 0 โ local
Head 1 โ subject tracking
Head 2 โ broad / diffuse
What this showsEvery planet keeps orbiting โ that's just motion. Its distance from the sun is the real signal: attention weight.