Attention as a Hypernetwork
Not on the map. Why?
Abstract (arXiv)
Transformers can under some circumstances generalize to novel problem instances whose constituent parts might have been encountered during training, but whose compositions have not. What mechanisms underlie this ability for compositional generalization? By reformulating multi-head attention as a hypernetwork, we reveal that a composable, low-dimensional latent code specifies key-query specific operations. We find empirically that this latent code is predictive of the subtasks the network performs on unseen task compositions, revealing that latent codes acquired during training are reused to solve unseen problem instances. To further examine the hypothesis that the intrinsic hypernetwork of multi-head attention supports compositional generalization, we ablate whether making the hypernetwork-generated linear value network nonlinear strengthens compositionality. We find that this modification improves compositional generalization on abstract reasoning tasks. In particular, we introduce a symbolic version of the Raven's Progressive Matrices human intelligence test, which gives us precise control over the problem compositions encountered during training and evaluation. We demonstrate on this task how scaling model size and data enables compositional generalization in transformers and gives rise to a functionally structured latent space.
Key facts. Cited by 13 papers in the map (data through 14 Oct 2026). Builds on 44 of its 68 references that are in the map. First posted on arXiv 9 Jun 2024.
Builds on
44 of 68 references.
References · 44
- 2017Attention Is All You Needcited by 60,361
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,599
- 2017Graph Attention Networkscited by 8,923
- 2016SGDR: Stochastic Gradient Descent with Warm Restartscited by 5,045
- 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,703
- 2017Outrageously Large Neural Networks: The Sparsely-Gated Mixture-of-Experts Layercited by 3,509
- 2016Pointer Sentinel Mixture Modelscited by 3,096
- 2015Neural Machine Translation of Rare Words with Subword Unitscited by 2,918
- 2020Transformers are RNNs: Fast Autoregressive Transformers with Linear Attentioncited by 2,022
- 2018SentencePiece: A simple and language independent subword tokenizer and detokenizer for Neural Text Processingcited by 1,989
- 2020GLU Variants Improve Transformercited by 1,804
32 more
- 2019Root Mean Square Layer Normalizationcited by 1,480
- 2018Relational inductive biases, deep learning, and graph networkscited by 1,360
- 2022Measuring and Narrowing the Compositionality Gap in Language Modelscited by 1,075
- 2016HyperNetworkscited by 1,027
- 2022In-context Learning and Induction Headscited by 964
- 2019Analyzing Multi-Head Self-Attention: Specialized Heads Do the Heavy Lifting, the Rest Can Be Prunedcited by 856
- 2019Are Sixteen Heads Really Better than One?cited by 816
- 2022What learning algorithm is in-context learning? Investigations with linear modelscited by 684
- 2022Towards Reasoning in Large Language Models: A Surveycited by 596
- 2023Gated Linear Attention Transformers with Hardware-Efficient Trainingcited by 514
- 2023Faith and Fate: Limits of Transformers on Compositionalitycited by 503
- 2021Linear Transformers Are Secretly Fast Weight Programmerscited by 502
- 2023In-Context Learning Creates Task Vectorscited by 312
- 2023Function Vectors in Large Language Modelscited by 308
- 2019RAVEN: A Dataset for Relational and Analogical Visual rEasoNingcited by 226
- 2023Zoology: Measuring and Improving Recall in Efficient Language Modelscited by 204
- 2023Exphormer: Sparse Transformers for Graphscited by 170
- 2018Measuring abstract reasoning in neural networkscited by 166
- 2017Routing Networks: Adaptive Selection of Non-linear Functions for Multi-Task Learningcited by 126
- 2023Uncovering mesa-optimization algorithms in Transformerscited by 100
- 2020Compositional Generalization in Semantic Parsing: Pre-training vs. Specialized Architecturescited by 95
- 2020Stratified Rule-Aware Network for Abstract Visual Reasoningcited by 72
- 2018Modular Networks: Learning to Decompose Neural Computationcited by 62
- 2023How Do In-Context Examples Affect Compositional Generalization?cited by 51
- 2022Is a Modular Architecture Enough?cited by 36
- 2021Dynamic Inference with Neural Interpreterscited by 24
- 2022On the Compositional Generalization Gap of In-Context Learningcited by 24
- 2023Discovering modular solutions that generalize compositionallycited by 23
- 2023Some Might Say All You Need Is Sumcited by 21
- 2021Multi-head or Single-head? An Empirical Comparison for Transformer Trainingcited by 16
- 2023Asynchronous Algorithmic Alignment with Cocyclescited by 13
- 2021SimpleTRON: Simple Transformer with O(N) Complexitycited by 1
Built on by
Citing papers per year: 2024: 2; 2025: 6; 2026: 5.
13 papers.
Sort:
By area:
- 2025Text-to-LoRA: Instant Transformer Adaptioncited by 58
- 2025ResearchCodeBench: Benchmarking LLMs on Implementing Novel Machine Learning Research Codecited by 36
- 2024When can transformers compositionally generalize in-context?cited by 7
- 2025Scaling can lead to compositional generalizationcited by 7
- 2025Hyper-GoalNet: Goal-Conditioned Manipulation Policy Learning with HyperNetworkscited by 4
- 2024Cross-Camera Distracted Driver Classification through Feature Disentanglement and Contrastive Learningcited by 1
- 2026Power law graph attention: exact generalization of scaled dot-product attention, empirical collapse at inferencecited by 1
- 2025In-Context Compositional Learning via Sparse Coding Transformercited by 0
- 2025Lessons from Neuroscience for AI: How integrating Actions, Compositional Structure and Episodic Memory could enable Safe, Interpretable and Human-Like AIcited by 0
- 2026GOT-JEPA: Generic Object Tracking with Model Adaptation and Occlusion Handling using Joint-Embedding Predictive Architecturecited by 0
- 2026Generalization in LLM Problem Solving: The Case of the Shortest Pathcited by 0
- 2026Matrix Zonotopic Attention: A Context-Adaptive Value Projection for Set Transformerscited by 0
- 2026Thought without systematicity? Evaluating reasoning models on rule induction tasks12 Sep 2026
- 2026Power law graph attention: exact generalization of scaled dot-product attention, empirical collapse at inference10 Aug 2026
- 2026Matrix Zonotopic Attention: A Context-Adaptive Value Projection for Set Transformers5 Aug 2026
- 2026Generalization in LLM Problem Solving: The Case of the Shortest Path16 Apr 2026
- 2026GOT-JEPA: Generic Object Tracking with Model Adaptation and Occlusion Handling using Joint-Embedding Predictive Architecture16 Feb 2026
- 2025Lessons from Neuroscience for AI: How integrating Actions, Compositional Structure and Episodic Memory could enable Safe, Interpretable and Human-Like AI27 Dec 2025
- 2025Hyper-GoalNet: Goal-Conditioned Manipulation Policy Learning with HyperNetworks26 Nov 2025
- 2025In-Context Compositional Learning via Sparse Coding Transformer25 Nov 2025
- 2025Scaling can lead to compositional generalization9 Jul 2025
- 2025Text-to-LoRA: Instant Transformer Adaption6 Jun 2025
- 2025ResearchCodeBench: Benchmarking LLMs on Implementing Novel Machine Learning Research Code2 Jun 2025
- 2024Cross-Camera Distracted Driver Classification through Feature Disentanglement and Contrastive Learning20 Nov 2024
1 more
- 2024When can transformers compositionally generalize in-context?17 Jul 2024
- 2025Text-to-LoRA: Instant Transformer Adaptioncited by 58
- 2025ResearchCodeBench: Benchmarking LLMs on Implementing Novel Machine Learning Research Codecited by 36
- 2024When can transformers compositionally generalize in-context?cited by 7
- 2025Scaling can lead to compositional generalizationcited by 7
- 2024Cross-Camera Distracted Driver Classification through Feature Disentanglement and Contrastive Learningcited by 1
- 2026Power law graph attention: exact generalization of scaled dot-product attention, empirical collapse at inferencecited by 1
- 2025In-Context Compositional Learning via Sparse Coding Transformercited by 0
- 2025Lessons from Neuroscience for AI: How integrating Actions, Compositional Structure and Episodic Memory could enable Safe, Interpretable and Human-Like AIcited by 0
- 2026GOT-JEPA: Generic Object Tracking with Model Adaptation and Occlusion Handling using Joint-Embedding Predictive Architecturecited by 0
- 2026Generalization in LLM Problem Solving: The Case of the Shortest Pathcited by 0
- 2026Matrix Zonotopic Attention: A Context-Adaptive Value Projection for Set Transformerscited by 0
- 2026Power law graph attention: exact generalization of scaled dot-product attention, empirical collapse at inference10 Aug 2026
- 2026Matrix Zonotopic Attention: A Context-Adaptive Value Projection for Set Transformers5 Aug 2026
- 2026Generalization in LLM Problem Solving: The Case of the Shortest Path16 Apr 2026
- 2026GOT-JEPA: Generic Object Tracking with Model Adaptation and Occlusion Handling using Joint-Embedding Predictive Architecture16 Feb 2026
- 2025Lessons from Neuroscience for AI: How integrating Actions, Compositional Structure and Episodic Memory could enable Safe, Interpretable and Human-Like AI27 Dec 2025
- 2025In-Context Compositional Learning via Sparse Coding Transformer25 Nov 2025
- 2025Scaling can lead to compositional generalization9 Jul 2025
- 2025Text-to-LoRA: Instant Transformer Adaption6 Jun 2025
- 2025ResearchCodeBench: Benchmarking LLMs on Implementing Novel Machine Learning Research Code2 Jun 2025
- 2024Cross-Camera Distracted Driver Classification through Feature Disentanglement and Contrastive Learning20 Nov 2024
- 2024When can transformers compositionally generalize in-context?17 Jul 2024