Transformers · Level 3 of 5
Attention
A mechanism that weights information from candidate sources based on relevance.
Weights are computed from representations and need not be faithful explanations.
Listen to the definition and example
Audio transcript
Attention. A mechanism that weights information from candidate sources based on relevance. Weights are computed from representations and need not be faithful explanations. For example: A decoder emphasizes selected input positions when producing a token.
Explore this concept
A useful analogy
A learned mixing desk that assigns different volumes to available information.
Why it matters
This helps you trace how token representations exchange and transform information.
Technical detail
Scores from queries and keys are normalized and used to weight values. In scaled dot-product attention, output = softmax(QKᵀ/√d)V.
Common misconception
Attention weights are not automatically causal explanations for a prediction.
Related concepts
Quick recall question
Try answering before looking back at the definition.