Explain scaled dot-product attention
Interview insights are lockedSee how often this is asked and which companies asked it with Buncho Pro.Explain scaled dot-product attention.
- Write the formula and explain what queries, keys and values represent.
- Why is the score divided by
sqrt(d_k)? - Implement it in PyTorch with an optional causal mask, and state its time and memory complexity.