When Can Transformers Ground and Compose: Insights from Compositional Generalization Benchmarks
Ankur Sikarwar, Arkil Patel, Navin Goyal
Abstract
Humans can reason compositionally whilst grounding language utterances to the real world. Recent benchmarks like ReaSCAN (Wu et al., 2021) use navigation tasks grounded in a grid world to assess whether neural models exhibit similar capabilities. In this work, we present a simple transformer-based model that outperforms specialized architectures on ReaSCAN and a modified version (Qiu et al., 2021) of gSCAN (Ruis et al., 2020). On analyzing the task, we find that identifying the target location in the grid world is the main challenge for the models. Furthermore, we show that a particular split in ReaSCAN, which tests depth generalization, is unfair. On an amended version of this split, we show that transformers can generalize to deeper input structures. Finally, we design a simpler grounded compositional generalization task, RefEx, to investigate how transformers reason compositionally. We show that a single self-attention layer with a single head generalizes to novel combinations of object attributes. Moreover, we derive a precise mathematical construction of the transformer's computations from the learned network. Overall, we provide valuable insights about the grounded compositional generalization task and the behaviour of transformers on it, which would be useful for researchers working in this area.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 4bf0c069-a00f-4dfc-b4d8-f24b8c8e1baaCited by top-tier papers5
- NeSyCoCo: A Neuro-Symbolic Concept Composer for Compositional GeneralizationDanial Kamali, Elham J. Barezi, Parisa KordjamshidiAAAI 2025 · 4 citations
- MAGNIFICo: Evaluating the In-Context Learning Ability of Large Language Models to Generalize to Novel InterpretationsArkil Patel, Satwik Bhattamishra, Siva Reddy, Dzmitry BahdanauEMNLP 2023 · 2 citations
- Generating Demonstrations for In-Context Compositional Generalization in Grounded Language LearningSam Spilsbury, Pekka Marttinen, Alexander IlinEMNLP 2024
- CARMA: Enhanced Compositionality in LLMs via Advanced Regularisation and Mutual Information AlignmentNura Aljaafari, Danilo S. Carvalho, André FreitasEMNLP 2025
- Transformers Learn Faster with Semantic FocusParikshit Ram, Kenneth L. Clarkson, Tim Klinger, Shashanka Ubaru et al.NeurIPS 2025
Builds on3
- Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
- Compositional Generalization via Neural-Symbolic Stack MachinesXinyun Chen, Chen Liang, Adams Wei Yu, Dawn Song et al.NeurIPS 2020 · 112 citations
- The Devil is in the Detail: Simple Tricks Improve Systematic Generalization of TransformersRóbert Csordás, Kazuki Irie, Jürgen SchmidhuberEMNLP 2021 · 55 citations
Related papers
- A Benchmark for Systematic Generalization in Grounded Language UnderstandingLaura Ruis, Jacob Andreas, Marco Baroni, Diane Bouchacourt et al.NeurIPS 2020 · 169 citations
- Compositional Generalization by Learning Analytical ExpressionsQian Liu, Shengnan An, Jian-Guang Lou, Bei Chen et al.NeurIPS 2020 · 79 citations
- Inducing Transformer's Compositional Generalization Ability via Auxiliary Sequence Prediction TasksYichen Jiang, Mohit BansalEMNLP 2021
- On the generalization capacity of neural networks during generic multimodal reasoningTakuya Ito, Soham Dan, Mattia Rigotti, James R. Kozloski et al.ICLR 2024 · 4 citations
- Attention as a HypernetworkSimon Schug, Seijin Kobayashi, Yassir Akram, João Sacramento et al.ICLR 2025
