What is causal mask?
The rule that stops a token from attending to tokens that come after it, so the model cannot see the answer it is being trained to predict.
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 causal mask?
- The rule that stops a token from attending to tokens that come after it, so the model cannot see the answer it is being trained to predict.
- Where is causal mask 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 causal mask?
- Each token produces a query, a key and a value.
- Where can I learn causal mask step by step?
- In the lesson “Attention” in Gradient’s course on the maths behind AI, with interactive diagrams and questions.