What is attention?
The operation that lets each token gather information from other tokens. Scores are dot products of queries with keys, softmax turns them into weights, and the output is a weighted mix of values.
Where it is taught
Attention. Attention lets each token ask a question of every token before it and take a weighted mix of the answers. It is built from dot products and softmax.
What the lesson leaves you with
- Each token produces a query, a key and a value.
- Scores are dot products of queries with keys. Softmax turns them into weights. The output is a weighted mix of values.
- The causal mask stops tokens from attending to later positions.
Questions
- What is attention?
- The operation that lets each token gather information from other tokens. Scores are dot products of queries with keys, softmax turns them into weights, and the output is a weighted mix of values.
- Where is attention used in AI?
- Attention lets each token ask a question of every token before it and take a weighted mix of the answers. It is built from dot products and softmax.
- What is the key idea to remember about attention?
- Each token produces a query, a key and a value.
- Where can I learn attention step by step?
- In the lesson “Attention” in Gradient’s course on the maths behind AI, with interactive diagrams and questions.