Atomic flashcards for this topic. Free for everyone. Pro syncs them into your spaced-repetition queue.
Write the scaled dot-product attention formula.▾
Attention(Q, K, V) = softmax(QKᵀ / √d_k) · V
Why divide by √d_k?▾
To keep dot-product variance stable across dimensions, preventing softmax saturation and gradient vanishing.
What does multi-head attention provide?▾
Parallel sub-projections with independent learned parameters, letting different heads specialize in different relationships (positional, syntactic, long range).
What is causal masking?▾
Setting future-position attention scores to -∞ before softmax so a token can only attend to itself and prior tokens, required for autoregressive language modeling.
+ 2 more cards in the full deck · Drill all cards (Pro)