Learning objectives
- Explain the ideas behind attention and transformers.
- Apply the ideas to the example and identify how you would check the result.
Concepts
Attention maps a query and keys to scores, normalizes the scores, and combines values using the resulting weights. Transformers use this operation alongside feed-forward layers and positional information.
Practical example
Select a token and inspect which other words receive weight. Treat the example weights as a teaching illustration.
Try the exercise
- Define the task. Select a token and inspect which other words receive weight. Treat the example weights as a teaching illustration.
- Identify the key idea. Attention maps a query and keys to scores, normalizes the scores, and combines values using the resulting weights.
- Check your decision. Describe an alternative and how you would compare its results.