25/25
Part 6 of 6 · Follow-upsCheck yourself
Check yourself
5 questions
  1. 1.The head size goes from 64 to 256 and you forgot the 1/√d scale. What happens to the attention weights?

  2. 2.scores has shape (B, H, T, T). Which axis does the softmax run over?

  3. 3.You apply the causal mask by multiplying the softmax output by a lower-triangular matrix of ones. What breaks?

  4. 4.Why subtract the row max before exponentiating?

  5. 5.At 8,192 tokens of context, how big is one head's fp16 score matrix for one sequence?

Now the problem this lesson builds to: 01 Scaled dot-product attention (NumPy)Practice it