Vismo · Create · Explore · Topics · Guides · Pricing

Self-Attention Finds It Means Animal

This animation visualizes one attention head in a Transformer resolving the pronoun 'it' in the sentence 'The animal didn't cross the street because it was too tired.' It shows the word's vector transformed by a learned matrix into a Query, compared against Key vectors beneath each word via scaled dot-product, and producing a relevance score that links 'it' to 'animal' with a glowing curved connection. Useful for students learning how attention mechanisms locate context.

Narrated · 16:9 · Preview before teaching · automatic layout checks do not establish subject accuracy

The prompt that made it

Create a short, premium mathematical animation explaining one idea from Transformer self-attention: how the word "it" can find relevant context. Use this sentence: "The animal didn't cross the street because it was too tired." Keep the sentence visible throughout the animation. Start with the complete sentence centred horizontally on a near-black background. Use elegant mathematical typography, generous spacing and minimal visual clutter. Highlight the word "it" in teal while subtly dimming the other words. From beneath "it", smoothly reveal its representation x_it as a small mathematical vector. Transform x_it through the learned projection matrix W_Q: q_it = W_Q x_it Do not simply replace one equation with another. Visually animate x_it flowing through W_Q and emerging as the Query vector q_it. Next, reveal a Key vector k_j beneath each word in the sentence. Move the same q_it Query vector smoothly towards the Key associated with "animal". Show the scaled dot-product comparison: (q_it · k_animal) / sqrt(d_k) Animate the vector comparison visually, then transform the calculation into a single relevance score. The score should emerge from the calculation and move underneath the word "animal". Then create an elegant curved connection from "it" to "animal". Make the connection brighten and strengthen to communicate that this illustrative attention head has found "animal" highly relevant to "it". End there. Do NOT explain softmax yet. Do NOT introduce Value vectors. Do NOT introduce weighted sums. Do NOT show the full Attention(Q,K,V) equation. Do NOT add a summary screen. The animation should be one continuous visual transformation, not a sequence of presentation slides. Objects should persist and transform naturally. Avoid repeatedly fading everything out. Visual direction: - premium mathematical educational animation - near-black background - crisp vector graphics - restrained teal, blue, coral and warm gold accents - elegant mathematical typography - thin geometric lines - generous negative space - smooth easing - subtle camera movement only when useful - no generic infographic boxes - no dashboard appearance - no decorative particles - no sci-fi HUD - no unnecessary text Prioritise mathematical clarity, precise alignment and beautiful continuous motion. This is an illustrative attention example, not a claim about the attention behaviour of a specific trained model. 16:9 landscape. Approximately 10–15 seconds. No narration. No music.

Make your own version

Make the next one in this series