Scaled dot-product attention
Tap a symbol above, or choose one here:
Meaning
One vector per position: "what am I looking for?" Computed as Q = XW_Q from the input.
Its job in this equation
One side of every relevance comparison.
Picture it
A search query typed by each word.
Read it, progressively
1. Gist
Each word looks at every other word, decides how relevant each one is, and takes a relevance-weighted blend of their information.
What it does not establish
Attention weights are not explanations: a high weight does not prove that token was "why" the model answered as it did. The equation omits masks, multiple heads, projections, positional information and the rest of the transformer block.