[Paper Review] Talking-Heads Attention
Introduces talking-heads attention, a variant of multi-head attention with learned linear projections across the attention-heads dimension before and after softmax, improving perplexity and downstream task performance with modest extra parameters.
We introduce "talking-heads attention" - a variation on multi-head attention which includes linearprojections across the attention-heads dimension, immediately before and after the softmax operation.While inserting only a small number of additional parameters and a moderate amount of additionalcomputation, talking-heads attention leads to better perplexities on masked language modeling tasks, aswell as better quality when transfer-learning to language comprehension and question answering tasks.
Motivation & Objective
- Motivate and address limitations of traditional multi-head attention where head-specific projections may reduce expressiveness when heads are too small.
- Propose a mechanism to allow information exchange across attention heads via learned projections across the heads dimension.
- Demonstrate empirical benefits on pre-training and fine-tuning tasks across language modeling and understanding benchmarks.
- Provide analysis and complexity considerations of the new mechanism compared to standard multi-head attention.
Proposed method
- Introduce two additional learned linear projections (P_l and P_w) that connect attention-heads before and after the softmax to enable cross-head information exchange.
- Define TalkingHeadsAttention as a generalization of multi-head attention with three head-dimensions (h_k for queries/keys, h for logits/weights, h_v for values) and show two equivalent formulations (concise and explicit).
- Derive computational costs and show that talking-heads projections add a term to the standard cost but can be advantageous when h_k, h, h_v are chosen appropriately.
- Provide a unified view (GBMA) connecting standard MHA and talking-heads as special cases of a general bilinear multihead attention.
- Experiment with Text-to-Text Transfer Transformer (T5), ALBERT, and BERT-style setups to compare multi-head vs talking-heads across pre-training perplexity and downstream tasks.
Experimental results
Research questions
- RQ1Does injecting cross-head projections improve model perplexity on pre-training tasks compared to standard multi-head attention?
- RQ2Do talking-heads provide consistent gains across encoder/decoder components and various head-dimension configurations?
- RQ3What are the trade-offs in complexity and hardware efficiency when using talking-heads attention vs traditional multi-head attention?
- RQ4How do talking-heads interact with projection granularity (logits/weights) and dynamic vs static projections in practice?
- RQ5Can the benefits of talking-heads attention transfer to widely used architectures like BERT and ALBERT?
Key findings
- Talking-heads attention improves perplexity on masked language modeling tasks compared to standard multi-head attention under several head-size configurations.
- Increasing the softmax-heads dimension h often yields notable gains, while very small key/value dimensions (d_k, d_v) can degrade performance in traditional MHA but are mitigated by talking-heads.
- Applying talking-heads in encoder self-attention yields larger downstream gains than applying it in decoder attention in several setups.
- Configuring three separate head-dimensions (h_k, h, h_v) and using both logits- and weights-projections yields the strongest improvements in many experiments (e.g., on T5 and ALBERT).
- Dynamic projections can reduce pre-training perplexity but did not consistently improve downstream tasks in their experiments.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.