Systematic Generalization and Emergent Structures in Transformers Trained on Structured Tasks
Not on the map. Why?
Abstract (arXiv)
Transformer networks have seen great success in natural language processing and machine vision, where task objectives such as next word prediction and image classification benefit from nuanced context sensitivity across high-dimensional inputs. However, there is an ongoing debate about how and when transformers can acquire highly structured behavior and achieve systematic generalization. Here, we explore how well a causal transformer can perform a set of algorithmic tasks, including copying, sorting, and hierarchical compositions of these operations. We demonstrate strong generalization to sequences longer than those used in training by replacing the standard positional encoding typically used in transformers with labels arbitrarily paired with items in the sequence. We search for the layer and head configuration sufficient to solve these tasks, then probe for signs of systematic processing in latent representations and attention patterns. We show that two-layer transformers learn reliable solutions to multi-level problems, develop signs of task decomposition, and encode input items in a way that encourages the exploitation of shared computation across related tasks. These results provide key insights into how attention layers support structured computation both within a task and across multiple tasks.
Key facts. Cited by 19 papers in the map (data through 7 Oct 2026). Builds on 31 of its 39 references that are in the map. First posted on arXiv 2 Oct 2022.
Builds on
31 of 39 references.
References · 31
- 2017Attention Is All You Needcited by 59,932
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,581
- 2021Zero-Shot Text-to-Image Generationcited by 4,276
- 2021On the Opportunities and Risks of Foundation Modelscited by 3,961
- 2021Decision Transformer: Reinforcement Learning via Sequence Modelingcited by 1,528
- 2021Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolationcited by 1,085
- 2019Attention is not Explanationcited by 916
- 2019Analyzing Multi-Head Self-Attention: Specialized Heads Do the Heavy Lifting, the Rest Can Be Prunedcited by 844
- 2019Are Sixteen Heads Really Better than One?cited by 803
- 2022A Generalist Agentcited by 802
19 more
- 2014Neural Turing Machinescited by 630
- 2019Attention is not not Explanationcited by 629
- 2020Transformer Interpretability Beyond Attention Visualizationcited by 620
- 2022Grokking: Generalization Beyond Overfitting on Small Algorithmic Datasetscited by 599
- 2022Using cognitive psychology to understand GPT-3cited by 389
- 2022Neural Networks and the Chomsky Hierarchycited by 214
- 2022Multi-Game Decision Transformerscited by 212
- 2022Exploring Length Generalization in Large Language Modelscited by 204
- 2022Language models show human-like content effects on reasoning taskscited by 171
- 2022Transformer Language Models without Positional Encodings Still Learn Positional Informationcited by 148
- 2022Impact of Pretraining Term Frequencies on Few-Shot Reasoningcited by 142
- 2021The Devil is in the Detail: Simple Tricks Improve Systematic Generalization of Transformerscited by 117
- 2022The CLRS Algorithmic Reasoning Benchmarkcited by 103
- 2020Syntactic Structure from Deep Learningcited by 99
- 2021Neural Algorithmic Reasoningcited by 92
- 2021Making Transformers Solve Compositional Taskscited by 72
- 2019Attention Interpretability Across NLP Taskscited by 71
- 2021The Neural Data Router: Adaptive Control Flow in Transformers Improves Systematic Generalizationcited by 62
- 2022Neurocompositional computing: From the Central Paradox of Cognition to a new generation of AI systemscited by 44
Built on by
Citing papers per year: 2022: 1; 2023: 5; 2024: 8; 2025: 5.
19 papers.
Sort:
By area:
- 2023Randomized Positional Encodings Boost Length Generalization of Transformerscited by 114
- 2024Transformers, parallel computation, and logarithmic depthcited by 75
- 2024Understanding Transformer Reasoning Capabilities via Graph Algorithmscited by 64
- 2023Positional Description Matters for Transformers Arithmeticcited by 56
- 2023Mind meets machine: Unravelling GPT-4's cognitive psychologycited by 31
- 2023Schema-learning and rebinding as mechanisms of in-context learning and emergencecited by 14
- 2024Explicitly Encoding Structural Symmetry is Key to Length Generalization in Arithmetic Taskscited by 10
- 2024Benchmarking GPT-4 on Algorithmic Problems: A Systematic Evaluation of Prompting Strategiescited by 9
- 2025Behavioural vs. Representational Systematicity in End-to-End Models: An Opinionated Surveycited by 5
- 2024Reasoning in Large Language Models: A Geometric Perspectivecited by 4
- 2025TRACE for Tracking the Emergence of Semantic Representations in Transformerscited by 3
- 2022Achieving and Understanding Out-of-Distribution Generalization in Systematic Reasoning in Small-Scale Transformerscited by 2
7 more
- 2024A Neural Rewriting System to Solve Algorithmic Problemscited by 2
- 2025Synthetic Tabular Data Detection In the Wildcited by 2
- 2023A Hybrid System for Systematic Generalization in Simple Arithmetic Problemscited by 1
- 2024Enhancing Length Extrapolation in Sequential Models with Pointer-Augmented Neural Memorycited by 0
- 2024Cross-table Synthetic Tabular Data Detectioncited by 0
- 2025Learning Modular Exponentiation with Transformerscited by 0
- 2025Learning neuro-symbolic convergent term rewriting systemscited by 0
- 2025Learning neuro-symbolic convergent term rewriting systems25 Jul 2025
- 2025Learning Modular Exponentiation with Transformers30 Jun 2025
- 2025Behavioural vs. Representational Systematicity in End-to-End Models: An Opinionated Survey4 Jun 2025
- 2025TRACE for Tracking the Emergence of Semantic Representations in Transformers23 May 2025
- 2025Synthetic Tabular Data Detection In the Wild3 Mar 2025
- 2024Cross-table Synthetic Tabular Data Detection17 Dec 2024
- 2024Reasoning in Large Language Models: A Geometric Perspective2 Jul 2024
- 2024Explicitly Encoding Structural Symmetry is Key to Length Generalization in Arithmetic Tasks4 Jun 2024
- 2024Understanding Transformer Reasoning Capabilities via Graph Algorithms28 May 2024
- 2024Enhancing Length Extrapolation in Sequential Models with Pointer-Augmented Neural Memory18 Apr 2024
- 2024A Neural Rewriting System to Solve Algorithmic Problems27 Feb 2024
- 2024Benchmarking GPT-4 on Algorithmic Problems: A Systematic Evaluation of Prompting Strategies27 Feb 2024
7 more
- 2024Transformers, parallel computation, and logarithmic depth14 Feb 2024
- 2023Positional Description Matters for Transformers Arithmetic22 Nov 2023
- 2023A Hybrid System for Systematic Generalization in Simple Arithmetic Problems29 Jun 2023
- 2023Schema-learning and rebinding as mechanisms of in-context learning and emergence16 Jun 2023
- 2023Randomized Positional Encodings Boost Length Generalization of Transformers26 May 2023
- 2023Mind meets machine: Unravelling GPT-4's cognitive psychology20 Mar 2023
- 2022Achieving and Understanding Out-of-Distribution Generalization in Systematic Reasoning in Small-Scale Transformers7 Oct 2022
- 2024Understanding Transformer Reasoning Capabilities via Graph Algorithmscited by 64
- 2024Explicitly Encoding Structural Symmetry is Key to Length Generalization in Arithmetic Taskscited by 10
- 2024Reasoning in Large Language Models: A Geometric Perspectivecited by 4
- 2022Achieving and Understanding Out-of-Distribution Generalization in Systematic Reasoning in Small-Scale Transformerscited by 2
- 2023A Hybrid System for Systematic Generalization in Simple Arithmetic Problemscited by 1
- 2024Reasoning in Large Language Models: A Geometric Perspective2 Jul 2024
- 2024Explicitly Encoding Structural Symmetry is Key to Length Generalization in Arithmetic Tasks4 Jun 2024
- 2024Understanding Transformer Reasoning Capabilities via Graph Algorithms28 May 2024
- 2023A Hybrid System for Systematic Generalization in Simple Arithmetic Problems29 Jun 2023
- 2022Achieving and Understanding Out-of-Distribution Generalization in Systematic Reasoning in Small-Scale Transformers7 Oct 2022
- 2023Randomized Positional Encodings Boost Length Generalization of Transformerscited by 114
- 2024Transformers, parallel computation, and logarithmic depthcited by 75
- 2023Positional Description Matters for Transformers Arithmeticcited by 56
- 2023Mind meets machine: Unravelling GPT-4's cognitive psychologycited by 31
- 2023Schema-learning and rebinding as mechanisms of in-context learning and emergencecited by 14
- 2024Benchmarking GPT-4 on Algorithmic Problems: A Systematic Evaluation of Prompting Strategiescited by 9
- 2025Behavioural vs. Representational Systematicity in End-to-End Models: An Opinionated Surveycited by 5
- 2025TRACE for Tracking the Emergence of Semantic Representations in Transformerscited by 3
- 2024A Neural Rewriting System to Solve Algorithmic Problemscited by 2
- 2025Synthetic Tabular Data Detection In the Wildcited by 2
- 2024Enhancing Length Extrapolation in Sequential Models with Pointer-Augmented Neural Memorycited by 0
- 2024Cross-table Synthetic Tabular Data Detectioncited by 0
12 most cited of 14 All 14 (JSON)
- 2025Learning neuro-symbolic convergent term rewriting systems25 Jul 2025
- 2025Learning Modular Exponentiation with Transformers30 Jun 2025
- 2025Behavioural vs. Representational Systematicity in End-to-End Models: An Opinionated Survey4 Jun 2025
- 2025TRACE for Tracking the Emergence of Semantic Representations in Transformers23 May 2025
- 2025Synthetic Tabular Data Detection In the Wild3 Mar 2025
- 2024Cross-table Synthetic Tabular Data Detection17 Dec 2024
- 2024Enhancing Length Extrapolation in Sequential Models with Pointer-Augmented Neural Memory18 Apr 2024
- 2024A Neural Rewriting System to Solve Algorithmic Problems27 Feb 2024
- 2024Benchmarking GPT-4 on Algorithmic Problems: A Systematic Evaluation of Prompting Strategies27 Feb 2024
- 2024Transformers, parallel computation, and logarithmic depth14 Feb 2024
- 2023Positional Description Matters for Transformers Arithmetic22 Nov 2023
- 2023Schema-learning and rebinding as mechanisms of in-context learning and emergence16 Jun 2023
12 newest of 14 All 14 (JSON)