Why is dot-product attention used instead of additive attention?
Last updated
Dot-product scores are one
QKᵀmatrix multiply, which is fast on GPUs and fusable (FlashAttention). Additive attention (vᵀ tanh(W_q q + W_k k)) needs a memory-boundn × m × dintermediate.Unscaled dot-product lost to additive at large
d_kdue to softmax saturation. Scaling by√d_kcloses the quality gap.Learned
W_Q/W_Kmake the score a learned bilinear form, and stacked heads and layers supply the nonlinearity.