← All models

MODEL EXPLORER / ATTENTION

Inside self-attention

How do queries, keys and values meet?

Curated by TensorVizTokenMixer · 4-step tour
Static architecture
How do queries, keys and values meet?
Opening the interactive graph…
Architecture snapshot · No Python requiredDownload graph ↓

ABOUT THIS EXAMPLE

Trace one attention head from three projections to a weighted mixture, then follow the residual back to the output.

Source, capture & limitations +

One untrained, unmasked attention head over four 32-wide tokens; not a complete language model. TensorViz groups the score calculation and weighted value mixture into two Python nodes. Source shows the exact operations.

Original TensorViz teaching example. PyTorch provides the underlying operators.

No separate redistribution license has been declared for these project examples.

Content revision
d2b8dd93364c22a1
Source SHA-256
c8c21db7fcd9192b0f641cafd9e216a291d49926e230f137dc81a95adada0adb
Captured
2026-09-17 · Python 3.13.13 / Torch 2.7.1

One CPU forward with float32 ones; untrained example, no accuracy claim. Installed VS Code workflow not separately verified for this example.

Read the model manifest ↗