Step 01 / 02
Library analogy
Attention is often explained with three roles. A library analogy keeps them memorable:
- Query — what you are looking for (“information about Transformer attention”).
- Key — the descriptive label on each book used for matching.
- Value — the useful content inside the books you matched.
You compare your query with keys. Stronger matches get more attention. Values from those matches are combined into a new representation.
Query
↓
compare with Keys
↓
Attention Scores
↓
Weight Values
↓
Combined RepresentationOptional math exists (scaled dot-product attention). For this course, recognition beats derivation: know the roles, know the flow.