When can transformers reason with abstract symbols?
Enric Boix-Adserà, Omid Saremi, Emmanuel Abbe, Samy Bengio, Etai Littwin, Joshua Susskind
Abstract
We investigate the capabilities of transformer models on relational reasoning tasks. In these tasks, models are trained on a set of strings encoding abstract relations, and are then tested out-of-distribution on data that contains symbols that did not appear in the training dataset. We prove that for any relational reasoning task in a large family of tasks, transformers learn the abstract relations and generalize to the test set when trained by gradient descent on sufficiently large quantities of training data. This is in contrast to classical fully-connected networks, which we prove fail to learn to reason. Our results inspire modifications of the transformer architecture that add only two trainable parameters per head, and that we empirically demonstrate improve data efficiency for learning to reason.
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 b67d4b51-7915-42eb-a914-1d7a3168d882Cited by top-tier papers10
- Learning to grok: Emergence of in-context learning and skill composition in modular arithmetic tasksTianyu He, Darshil Doshi, Aritra Das, Andrey GromovNeurIPS 2024 · 52 citations
- What Can Transformer Learn with Varying Depth? Case Studies on Sequence Learning TasksXingwu Chen, Difan ZouICML 2024 · 22 citations
- Interpret Your Decision: Logical Reasoning Regularization for Generalization in Visual ClassificationZhaorui Tan, Xi Yang, Qiufeng Wang, Anh Nguyen et al.NeurIPS 2024 · 8 citations
- Learning to Add, Multiply, and Execute Algorithmic Instructions Exactly with Neural NetworksArtur Back de Luca, George Giapitzakis, Kimon FountoulakisNeurIPS 2025 · 4 citations
- AbstRaL: Augmenting LLMs' Reasoning by Reinforcing Abstract ThinkingSilin Gao, Antoine Bosselut, Samy Bengio, Emmanuel AbbeICLR 2026 · 3 citations
Builds on15
- Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
- What Can Transformers Learn In-Context? A Case Study of Simple Function ClassesShivam Garg, Dimitris Tsipras, Percy Liang, Gregory ValiantNeurIPS 2022 · 883 citations
- Transformers learn to implement preconditioned gradient descent for in-context learningKwangjun Ahn, Xiang Cheng, Hadi Daneshmand, Suvrit SraNeurIPS 2023 · 324 citations
- Tensor Programs IV: Feature Learning in Infinite-Width Neural NetworksGreg Yang, Edward J. HuICML 2021 · 242 citations
- Inductive Biases and Variable Creation in Self-Attention MechanismsBenjamin L. Edelman, Surbhi Goel, Sham M. Kakade, Cyril ZhangICML 2022 · 154 citations
Related papers
- Abstractors and relational cross-attention: An inductive bias for explicit relational reasoning in TransformersAwni Altabaa, Taylor Whittington Webb, Jonathan D. Cohen, John LaffertyICLR 2024 · 13 citations
- Enhancing Transformers for Generalizable First-Order Logical EntailmentTianshi Zheng, Jiazheng Wang, Zihao Wang, Jiaxin Bai et al.ACL 2025 · 7 citations
- Relational Attention: Generalizing Transformers for Graph-Structured TasksCameron Diao, Ricky LoyndICLR 2023 · 6 citations
- Measuring Systematic Generalization in Neural Proof Generation with TransformersNicolas Gontier, Koustuv Sinha, Siva Reddy, Christopher PalNeurIPS 2020 · 69 citations
- Unravelling the Logic: Investigating the Generalisation of Transformers in Numerical Satisfiability ProblemsTharindu Madusanka, Marco Valentino, Iqra Zahid, Ian Pratt-Hartmann et al.ACL 2025 · 1 citation
