Limits of Transformer Language Models on Learning to Compose Algorithms
Not on the map. Why?
Abstract (arXiv)
We analyze the capabilities of Transformer language models in learning compositional discrete tasks. To this end, we evaluate training LLaMA models and prompting GPT-4 and Gemini on four tasks demanding to learn a composition of several discrete sub-tasks. In particular, we measure how well these models can reuse primitives observable in the sub-tasks to learn the composition task. Our results indicate that compositional learning in state-of-the-art Transformer language models is highly sample inefficient: LLaMA requires more data samples than relearning all sub-tasks from scratch to learn the compositional task; in-context prompting with few samples is unreliable and fails at executing the sub-tasks or correcting the errors in multi-round code generation. Further, by leveraging complexity theory, we support these findings with a theoretical analysis focused on the sample inefficiency of gradient descent in memorizing feedforward models. We open source our code at https://github.com/IBM/limitations-lm-algorithmic-compositional-learning.
Key facts. Cited by 13 papers in the map (data through 7 Oct 2026). Builds on 43 of its 64 references that are in the map. First posted on arXiv 8 Feb 2024.
Builds on
43 of 64 references.
References · 43
- 2017Attention Is All You Needcited by 59,932
- 2023LLaMA: Open and Efficient Foundation Language Modelscited by 13,958
- 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,302
- 2021Training Verifiers to Solve Math Word Problemscited by 9,743
- 2020Scaling Laws for Neural Language Modelscited by 6,411
- 2021Measuring Mathematical Problem Solving With the MATH Datasetcited by 5,203
- 2022Training Compute-Optimal Large Language Modelscited by 2,927
- 2020The Pile: An 800GB Dataset of Diverse Text for Language Modelingcited by 2,346
- 2022Measuring and Narrowing the Compositionality Gap in Language Modelscited by 1,054
- 2018Universal Transformerscited by 613
- 2019Deep Equilibrium Modelscited by 603
- 2022Winoground: Probing Vision and Language Models for Visio-Linguistic Compositionalitycited by 523
31 more
- 2023Faith and Fate: Limits of Transformers on Compositionalitycited by 496
- 2022Hungry Hungry Hippos: Towards Language Modeling with State Space Modelscited by 495
- 2023Scalable Extraction of Training Data from (Production) Language Modelscited by 415
- 2019Analysing Mathematical Reasoning Abilities of Neural Modelscited by 331
- 2023Towards Revealing the Mystery behind Chain of Thought: A Theoretical Perspectivecited by 293
- 2019Measuring Compositional Generalization: A Comprehensive Method on Realistic Datacited by 280
- 2020COGS: A Compositional Generalization Challenge Based on Semantic Interpretationcited by 260
- 2022Transformers Learn Shortcuts to Automatacited by 260
- 2022Memorization Without Overfitting: Analyzing the Training Dynamics of Large Language Modelscited by 218
- 2022Neural Networks and the Chomsky Hierarchycited by 214
- 2021Thinking Like Transformerscited by 182
- 2023Solving Challenging Math Word Problems Using GPT-4 Code Interpreter with Code-based Self-Verificationcited by 166
- 2021PonderNet: Learning to Pondercited by 156
- 2023Can Large Language Models Infer Causation from Correlation?cited by 142
- 2021The Devil is in the Detail: Simple Tricks Improve Systematic Generalization of Transformerscited by 117
- 2023Large Language Models as Analogical Reasonerscited by 107
- 2023The ConceptARC Benchmark: Evaluating Understanding and Generalization in the ARC Domaincited by 97
- 2022Compositional Semantic Parsing with Large Language Modelscited by 95
- 2023Phenomenal Yet Puzzling: Testing Inductive Reasoning Capabilities of Language Models with Hypothesis Refinementcited by 89
- 2023Call for Papers -- The BabyLM Challenge: Sample-efficient pretraining on a developmentally plausible corpuscited by 62
- 2023Understanding Causality with Large Language Models: Feasibility and Opportunitiescited by 53
- 2023Skills-in-Context Prompting: Unlocking Compositionality in Large Language Modelscited by 33
- 2021Pointer Value Retrieval: A new benchmark for understanding the limits of neural network generalizationcited by 29
- 2018Complexity of Training ReLU Neural Networkcited by 23
- 2014Edit Distance Cannot Be Computed in Strongly Subquadratic Time (unless SETH is false)cited by 18
- 2023Abstract Visual Reasoning Enabled by Languagecited by 15
- 2021Compositional Processing Emerges in Neural Networks Solving Math Problemscited by 11
- 2023Abductive Commonsense Reasoning Exploiting Mutually Exclusive Explanationscited by 11
- 2024Probabilistic Abduction for Visual Abstract Reasoning via Learning Rules in Vector-symbolic Architecturescited by 9
- 2023Adaptivity and Modularity for Efficient Generalization Over Task Complexitycited by 7
- 2022BigBraveBN: algorithm of structural learning for bayesian networks with a large number of nodescited by 1
Built on by
Citing papers per year: 2024: 2; 2025: 9; 2026: 2.
13 papers.
Sort:
By area:
- 2025Continuous Chain of Thought Enables Parallel Exploration and Reasoningcited by 32
- 2024MathGAP: Out-of-Distribution Evaluation on Problems with Arbitrarily Complex Proofscited by 12
- 2025Lost in Transmission: When and Why LLMs Fail to Reason Globallycited by 9
- 2025Beyond Statistical Learning: Exact Learning Is Essential for General Intelligencecited by 6
- 2025Can Large Reasoning Models do Analogical Reasoning under Perceptual Uncertainty?cited by 5
- 2025Behavioural vs. Representational Systematicity in End-to-End Models: An Opinionated Surveycited by 5
- 2024Benchmarking and Understanding Compositional Relational Reasoning of LLMscited by 4
- 2025Learning Composable Chains-of-Thoughtcited by 3
- 2025DecompSR: A dataset for decomposed analyses of compositional multihop spatial reasoningcited by 1
- 2025Understanding the Staged Dynamics of Transformers in Learning Latent Structurecited by 1
- 2025Can Language Models Compose Skills In-Context?cited by 0
- 2026The Communication Bottleneck: A Round-Trip Study of Tree-Structured Expression Serialization in Language Modelscited by 0
- 2026Beyond the Training Horizon: Mechanisms and Limits of Length Generalization in Looped Transformers27 Sep 2026
- 2026The Communication Bottleneck: A Round-Trip Study of Tree-Structured Expression Serialization in Language Models18 Sep 2026
- 2025Understanding the Staged Dynamics of Transformers in Learning Latent Structure24 Nov 2025
- 2025DecompSR: A dataset for decomposed analyses of compositional multihop spatial reasoning4 Nov 2025
- 2025Can Language Models Compose Skills In-Context?27 Oct 2025
- 2025Beyond Statistical Learning: Exact Learning Is Essential for General Intelligence30 Jun 2025
- 2025Behavioural vs. Representational Systematicity in End-to-End Models: An Opinionated Survey4 Jun 2025
- 2025Continuous Chain of Thought Enables Parallel Exploration and Reasoning29 May 2025
- 2025Learning Composable Chains-of-Thought28 May 2025
- 2025Lost in Transmission: When and Why LLMs Fail to Reason Globally13 May 2025
- 2025Can Large Reasoning Models do Analogical Reasoning under Perceptual Uncertainty?14 Mar 2025
- 2024Benchmarking and Understanding Compositional Relational Reasoning of LLMs17 Dec 2024
1 more
- 2025Continuous Chain of Thought Enables Parallel Exploration and Reasoningcited by 32
- 2025Lost in Transmission: When and Why LLMs Fail to Reason Globallycited by 9
- 2025Beyond Statistical Learning: Exact Learning Is Essential for General Intelligencecited by 6
- 2025Can Large Reasoning Models do Analogical Reasoning under Perceptual Uncertainty?cited by 5
- 2024Benchmarking and Understanding Compositional Relational Reasoning of LLMscited by 4
- 2025Learning Composable Chains-of-Thoughtcited by 3
- 2025DecompSR: A dataset for decomposed analyses of compositional multihop spatial reasoningcited by 1
- 2026The Communication Bottleneck: A Round-Trip Study of Tree-Structured Expression Serialization in Language Modelscited by 0
- 2026Beyond the Training Horizon: Mechanisms and Limits of Length Generalization in Looped Transformerscited by 0
- 2026Beyond the Training Horizon: Mechanisms and Limits of Length Generalization in Looped Transformers27 Sep 2026
- 2026The Communication Bottleneck: A Round-Trip Study of Tree-Structured Expression Serialization in Language Models18 Sep 2026
- 2025DecompSR: A dataset for decomposed analyses of compositional multihop spatial reasoning4 Nov 2025
- 2025Beyond Statistical Learning: Exact Learning Is Essential for General Intelligence30 Jun 2025
- 2025Continuous Chain of Thought Enables Parallel Exploration and Reasoning29 May 2025
- 2025Learning Composable Chains-of-Thought28 May 2025
- 2025Lost in Transmission: When and Why LLMs Fail to Reason Globally13 May 2025
- 2025Can Large Reasoning Models do Analogical Reasoning under Perceptual Uncertainty?14 Mar 2025
- 2024Benchmarking and Understanding Compositional Relational Reasoning of LLMs17 Dec 2024
- 2024MathGAP: Out-of-Distribution Evaluation on Problems with Arbitrarily Complex Proofscited by 12
- 2025Behavioural vs. Representational Systematicity in End-to-End Models: An Opinionated Surveycited by 5
- 2025Understanding the Staged Dynamics of Transformers in Learning Latent Structurecited by 1
- 2025Can Language Models Compose Skills In-Context?cited by 0
- 2025Understanding the Staged Dynamics of Transformers in Learning Latent Structure24 Nov 2025
- 2025Can Language Models Compose Skills In-Context?27 Oct 2025
- 2025Behavioural vs. Representational Systematicity in End-to-End Models: An Opinionated Survey4 Jun 2025
- 2024MathGAP: Out-of-Distribution Evaluation on Problems with Arbitrarily Complex Proofs17 Oct 2024