Skip to content
nonconvexcard

Multi-head attention is a sum of low-rank maps

ProofAdvanced⏱ 30 minDeep Learningmulti-headrankloracircuits

Problem

Show that multi-head attention equals ∑mAmXWVmWOm\sum_m A^mXW_V^mW_O^m with each WVmWOmW_V^mW_O^m of rank at most d/hd/h, and that head mm's logits depend on WQm(WKm)⊤W_Q^m(W_K^m)^\top only. Discuss the consequences for interpretability and for LoRA.

Write a complete argument. Every inequality you use should be one you could state precisely.

Solution

Opening this before you have a real attempt on paper is the fastest way to feel like you understand something you cannot reproduce.

Related problems

All problems
SolvedProblemFieldTypeDifficultyTime
Adapter parameter countsFine-TuningNumericalFoundation15 min
LoRA parameter accountingLLMsNumericalBeginner15 min
When does attention dominate the MLP?Deep LearningNumericalBeginner30 min
Will this fine-tune fit?Fine-TuningNumericalBeginner30 min
Attention is permutation equivariantDeep LearningProofIntermediate30 min