mlsanityData to 7 Oct 2026

Compositional Attention: Disentangling Search and Retrieval

arXiv 2110.09419 ↗First posted 18 Oct 2021cs.LGcited by 12

Not on the map. Why?

Abstract (arXiv)

Multi-head, key-value attention is the backbone of the widely successful Transformer model and its variants. This attention mechanism uses multiple parallel key-value attention blocks (called heads), each performing two fundamental computations: (1) search - selection of a relevant entity from a set via query-key interactions, and (2) retrieval - extraction of relevant features from the selected entity via a value matrix. Importantly, standard attention heads learn a rigid mapping between search and retrieval. In this work, we first highlight how this static nature of the pairing can potentially: (a) lead to learning of redundant parameters in certain tasks, and (b) hinder generalization. To alleviate this problem, we propose a novel attention mechanism, called Compositional Attention, that replaces the standard head structure. The proposed mechanism disentangles search and retrieval and composes them in a dynamic, flexible and context-dependent manner through an additional soft competition stage between the query-key combination and value pairing. Through a series of numerical experiments, we show that it outperforms standard multi-head attention on a variety of tasks, including some out-of-distribution settings. Through our qualitative analysis, we demonstrate that Compositional Attention leads to dynamic specialization based on the type of retrieval needed. Our proposed mechanism generalizes multi-head attention, allows independent scaling of search and retrieval, and can easily be implemented in lieu of standard attention heads in any network architecture.

Key facts. Cited by 12 papers in the map (data through 7 Oct 2026). Builds on 42 of its 52 references that are in the map. First posted on arXiv 18 Oct 2021.

Builds on

42 of 52 references.

References · 42

  1. 2017Attention Is All You Needcited by 59,932
  2. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
  3. 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 29,915
  4. 2014Neural Machine Translation by Jointly Learning to Align and Translatecited by 4,530
  5. 2016Pointer Sentinel Mixture Modelscited by 2,992
  6. 2020Reformer: The Efficient Transformercited by 1,658
  7. 2020Rethinking Attention with Performerscited by 1,584
  8. 2019Generating Long Sequences with Sparse Transformerscited by 1,523
  9. 2019fairseq: A Fast, Extensible Toolkit for Sequence Modelingcited by 1,486
  10. 2020Linformer: Self-Attention with Linear Complexitycited by 1,462
  11. 2015Show, Attend and Tell: Neural Image Caption Generation with Visual Attentioncited by 1,421
  12. 2015Effective Approaches to Attention-based Neural Machine Translationcited by 1,024
30 more
  1. 2020Object-Centric Learning with Slot Attentioncited by 865
  2. 2019Analyzing Multi-Head Self-Attention: Specialized Heads Do the Heavy Lifting, the Rest Can Be Prunedcited by 844
  3. 2019Are Sixteen Heads Really Better than One?cited by 803
  4. 2020Efficient Transformers: A Surveycited by 784
  5. 2014Neural Turing Machinescited by 630
  6. 2018Universal Transformerscited by 613
  7. 2019Deep Equilibrium Modelscited by 603
  8. 2017A simple neural network module for relational reasoningcited by 345
  9. 2019Measuring Compositional Generalization: A Comprehensive Method on Realistic Datacited by 280
  10. 2020Inductive Biases for Deep Learning of Higher-Level Cognitioncited by 273
  11. 2019Compositionality decomposed: how do neural networks generalise?cited by 264
  12. 2019Recurrent Independent Mechanismscited by 219
  13. 2018Compositional Attention Networks for Machine Reasoningcited by 183
  14. 2019A Meta-Transfer Objective for Learning to Disentangle Causal Mechanismscited by 158
  15. 2021Investigating the Limitations of Transformers with Simple Arithmetic Taskscited by 136
  16. 2021The Devil is in the Detail: Simple Tricks Improve Systematic Generalization of Transformerscited by 117
  17. 2017The Consciousness Priorcited by 105
  18. 2021Coordination Among Neural Modules Through a Shared Global Workspacecited by 83
  19. 2020Compositional Generalization via Neural-Symbolic Stack Machinescited by 80
  20. 2021Neural Production Systems: Learning Rule-Governed Visual Dynamicscited by 75
  21. 2021Systematic Evaluation of Causal Discovery in Visual Model Based Reinforcement Learningcited by 53
  22. 2019Compositional Generalization for Primitive Substitutionscited by 48
  23. 2020Object Files and Schemata: Factorizing Declarative and Procedural Knowledge in Dynamical Systemscited by 48
  24. 2020Emergent Symbols through Binding in External Memorycited by 47
  25. 2020The EOS Decision and Length Extrapolationcited by 46
  26. 2018Memorize or generalize? Searching for a compositional RNN in a haystackcited by 41
  27. 2020Learning to Combine Top-Down and Bottom-Up Signals in Recurrent Neural Networks with Attention over Modulescited by 38
  28. 2021Fast and Slow Learning of Recurrent Independent Mechanismscited by 36
  29. 2021Transformers with Competitive Ensembles of Independent Mechanismscited by 19
  30. 2018Compositional Attention Networks for Interpretability in Natural Language Question Answeringcited by 1

Built on by

Cited by year

Citing papers per year: 2022: 4; 2023: 4; 2024: 3; 2025: 1.

12 papers.