KnowML
Interactive

Attention Lab

One four-word sentence, run through seven different attention mechanisms. Every matrix comes from one seeded example — step through and watch the actual numbers, not a diagram of them.

Step through at your own pace · prerequisites: Attention & Transformers (08)

How to use this page ▾

Pick a tab — MHA first if you're new to this, since every other tab reuses its vocabulary and its epilogue (concat, then one output projection). Every number below is computed by real matrix arithmetic in your browser from one seeded example (four tokens: "The cat sat down"), not hand-typed — the FlashAttention tab even checks its own answer against the plain-softmax result and shows you the difference.

What this page simplifies, on purpose

Related pages