Teaching Algorithmic Reasoning via In-context Learning
On the map: LLM reasoning → Mathematical reasoning
Abstract (arXiv)
Large language models (LLMs) have shown increasing in-context learning capabilities through scaling up model and data size. Despite this progress, LLMs are still unable to solve algorithmic reasoning problems. While providing a rationale with the final answer has led to further improvements in multi-step reasoning problems, Anil et al. 2022 showed that even simple algorithmic reasoning tasks such as parity are far from solved. In this work, we identify and study four key stages for successfully teaching algorithmic reasoning to LLMs: (1) formulating algorithms as skills, (2) teaching multiple skills simultaneously (skill accumulation), (3) teaching how to combine skills (skill composition) and (4) teaching how to use skills as tools. We show that it is possible to teach algorithmic reasoning to LLMs via in-context learning, which we refer to as algorithmic prompting. We evaluate our approach on a variety of arithmetic and quantitative reasoning tasks, and demonstrate significant boosts in performance over existing prompting techniques. In particular, for long parity, addition, multiplication and subtraction, we achieve an error reduction of approximately 10x, 9x, 5x and 2x respectively compared to the best available baselines.
Key facts. Cited by 111 papers in the map (data through 7 Oct 2026). Placed in Mathematical reasoning, one of 17 directions in LLM reasoning. Builds on 43 of its 71 references that are in the map. First posted on arXiv 15 Nov 2022.
Builds on
43 of 71 references.
Closest ancestors · 2
Same direction, newest first
- 2022Solving Quantitative Reasoning Problems with Language Models29 Jun
- 2020Generative Language Modeling for Automated Theorem Proving7 Sep
Other references · 41
- 2017Attention Is All You Needcited by 59,932
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,302
- 2021Training Verifiers to Solve Math Word Problemscited by 9,743
- 2021Evaluating Large Language Models Trained on Codecited by 8,053
- 2020Scaling Laws for Neural Language Modelscited by 6,411
- 2022Self-Consistency Improves Chain of Thought Reasoning in Language Modelscited by 5,601
- 2022PaLM: Scaling Language Modeling with Pathwayscited by 5,304
- 2021Measuring Mathematical Problem Solving With the MATH Datasetcited by 5,203
- 2022Large Language Models are Zero-Shot Reasonerscited by 4,323
- 2022Training Compute-Optimal Large Language Modelscited by 2,927
- 2022Emergent Abilities of Large Language Modelscited by 2,483
29 more
- 2022Rethinking the Role of Demonstrations: What Makes In-Context Learning Work?cited by 1,413
- 2022Least-to-Most Prompting Enables Complex Reasoning in Large Language Modelscited by 1,397
- 2022STaR: Bootstrapping Reasoning With Reasoningcited by 895
- 2021Show Your Work: Scratchpads for Intermediate Computation with Language Modelscited by 871
- 2017Program Induction by Rationale Generation : Learning to Solve and Explain Algebraic Word Problemscited by 642
- 2019Analysing Mathematical Reasoning Abilities of Neural Modelscited by 331
- 2022Autoformalization with Large Language Modelscited by 252
- 2022Exploring Length Generalization in Large Language Modelscited by 204
- 2022TALM: Tool Augmented Language Modelscited by 197
- 2022Maieutic Prompting: Logically Consistent Reasoning with Recursive Explanationscited by 159
- 2019What Can Neural Networks Reason About?cited by 155
- 2022Impact of Pretraining Term Frequencies on Few-Shot Reasoningcited by 142
- 2021Investigating the Limitations of Transformers with Simple Arithmetic Taskscited by 136
- 2022Faithful Reasoning Using Large Language Modelscited by 130
- 2022Text and Patterns: For Effective Chain of Thought, It Takes Two to Tangocited by 128
- 2015Neural GPUs Learn Algorithmscited by 118
- 2021The Devil is in the Detail: Simple Tricks Improve Systematic Generalization of Transformerscited by 117
- 2022Rationale-Augmented Ensembles in Language Modelscited by 111
- 2022Capturing Failures of Large Language Models via Human Cognitive Biasescited by 97
- 2022Thor: Wielding Hammers to Integrate Language Models and Automated Theorem Proverscited by 97
- 2021Neural Algorithmic Reasoningcited by 92
- 2021Representing Numbers in NLP: a Survey and a Visioncited by 83
- 2020Compositional Generalization via Neural-Symbolic Stack Machinescited by 80
- 2021NaturalProofs: Mathematical Theorem Proving in Natural Languagecited by 80
- 2018Semantically-Aligned Equation Generation for Solving and Reasoning Math Word Problemscited by 49
- 2020Neural Execution Engines: Learning to Execute Subroutinescited by 36
- 2021How to transfer algorithmic reasoning knowledge to learn new algorithms?cited by 22
- 2019Do Multi-hop Readers Dream of Reasoning Chains?cited by 14
- 2021Towards Tractable Mathematical Reasoning: Challenges, Strategies, and Opportunities for Solving Math Word Problemscited by 12
Built on by
Citing papers per year: 2022: 7; 2023: 48; 2024: 29; 2025: 21; 2026: 6.
111 papers.
Sort:
By area:
- 2023Teaching Large Language Models to Self-Debugcited by 963
- 2022A Survey on In-context Learningcited by 717
- 2022Towards Reasoning in Large Language Models: A Surveycited by 593
- 2023Faith and Fate: Limits of Transformers on Compositionalitycited by 496
- 2023Llemma: An Open Language Model For Mathematicscited by 385
- 2025The Illusion of Thinking: Understanding the Strengths and Limitations of Reasoning Models via the Lens of Problem Complexitycited by 298
- 2024Quiet-STaR: Language Models Can Teach Themselves to Think Before Speakingcited by 292
- 2022Reasoning with Language Model Prompting: A Surveycited by 251
- 2023Can Language Models Solve Graph Problems in Natural Language?cited by 249
- 2023Looped Transformers as Programmable Computerscited by 224
- 2023Looped Transformers are Better at Learning Learning Algorithmscited by 135
- 2023Deductive Verification of Chain-of-Thought Reasoningcited by 122
38 more
- 2023Teaching Arithmetic to Small Transformerscited by 121
- 2023Hypothesis Search: Inductive Reasoning with Language Modelscited by 119
- 2024Tokenization counts: the impact of tokenization on arithmetic in frontier LLMscited by 112
- 2024Chain of Thoughtlessness? An Analysis of CoT in Planningcited by 100
- 2023Amortizing intractable inference in large language modelscited by 94
- 2025DeepSeek-R1 Thoughtology: Let's think about LLM Reasoningcited by 91
- 2023Goat: Fine-tuned LLaMA Outperforms GPT-4 on Arithmetic Taskscited by 84
- 2024Transformers Can Achieve Length Generalization But Not Robustlycited by 82
- 2023Few-shot In-context Learning for Knowledge Base Question Answeringcited by 74
- 2023Exposing Attention Glitches with Flip-Flop Language Modelingcited by 74
- 2023Evaluating Large Language Models on Controlled Generation Taskscited by 73
- 2023Unleashing the potential of prompt engineering for large language modelscited by 72
- 2022Complementary Explanations for Effective In-Context Learningcited by 71
- 2023GPT Can Solve Mathematical Problems Without a Calculatorcited by 68
- 2022LAMBADA: Backward Chaining for Automated Reasoning in Natural Languagecited by 66
- 2023Large Language Models can Learn Rulescited by 66
- 2023Length Generalization in Arithmetic Transformerscited by 64
- 2024Understanding Transformer Reasoning Capabilities via Graph Algorithmscited by 64
- 2022Parsel: Algorithmic Reasoning with Language Models by Composing Decompositionscited by 62
- 2023Towards Better Chain-of-Thought Prompting Strategies: A Surveycited by 62
- 2023Prompted LLMs as Chatbot Modules for Long Open-domain Conversationcited by 61
- 2023Positional Description Matters for Transformers Arithmeticcited by 56
- 2025A Survey on Large Language Models for Mathematical Reasoningcited by 52
- 2024Why Larger Language Models Do In-context Learning Differently?cited by 44
- 2023Self-Polish: Enhance Reasoning in Large Language Models via Problem Refinementcited by 43
- 2024Evolving Code with A Large Language Modelcited by 42
- 2023Code Execution with Pre-trained Language Modelscited by 33
- 2023Learning the greatest common divisor: explaining transformer predictionscited by 33
- 2024Leveraging the Context through Multi-Round Interactions for Jailbreaking Attackscited by 32
- 2024The CLRS-Text Algorithmic Reasoning Language Benchmarkcited by 28
- 2024Language Models Need Inductive Biases to Count Inductivelycited by 25
- 2024In-Context Learning Enables Robot Action Prediction in LLMscited by 25
- 2023Mathematical Language Models: A Surveycited by 24
- 2025Social Genome: Grounded Social Reasoning Abilities of Multimodal Modelscited by 24
- 2024How Well Can Transformers Emulate In-context Newton's Method?cited by 23
- 2023Passive learning of active causal strategies in agents and language modelscited by 21
- 2023Language models are weak learnerscited by 21
- 2024Bypassing the Exponential Dependency: Looped Transformers Efficiently Learn In-context by Multi-step Gradient Descentcited by 21
50 most cited of 111 All 111 (JSON)
- 2026Limits of Confidence in Diffusion17 Sep 2026
- 2026How Well Do LLMs Perform on the Simplest Long-Chain Reasoning Tasks: An Empirical Study on the Equivalence Class Problem7 May 2026
- 2026When LLMs Stop Following Steps: A Diagnostic Study of Procedural Execution in Language Models1 May 2026
- 2026A Guideline-Aware AI Agent for Zero-Shot Target Volume Auto-Delineation10 Mar 2026
- 2026Failing to Explore: Language Models on Interactive Tasks29 Jan 2026
- 2026CAST: Achieving Stable LLM-based Text Analysis for Data Analytics26 Jan 2026
- 2025Generalizable Insights for Graph Transformers in Theory and Practice11 Nov 2025
- 2025CG-TTRL: Context-Guided Test-Time Reinforcement Learning for On-Device Large Language Models9 Nov 2025
- 2025In-Context Adaptation of VLMs for Few-Shot Cell Detection in Optical Microscopy4 Nov 2025
- 2025Reasoning About Reasoning: Towards Informed and Reflective Use of LLM Reasoning in HCI27 Oct 2025
- 2025MathRobust-LV: Evaluation of Large Language Models' Robustness to Linguistic Variations in Mathematical Reasoning7 Oct 2025
- 2025Bridging Kolmogorov Complexity and Deep Learning: Asymptotically Optimal Description Length Objectives for Transformers26 Sep 2025
38 more
- 2025Do Language Models Follow Occam's Razor? An Evaluation of Parsimony in Inductive and Abductive Reasoning3 Sep 2025
- 2025Improving Value-based Process Verifier via Low-Cost Variance Reduction14 Aug 2025
- 2025Length Representations in Large Language Models27 Jul 2025
- 2025A Group Theoretic Analysis of the Symmetries Underlying Base Addition and Their Learnability by Neural Networks14 Jul 2025
- 2025A Survey on Large Language Models for Mathematical Reasoning10 Jun 2025
- 2025The Illusion of Thinking: Understanding the Strengths and Limitations of Reasoning Models via the Lens of Problem Complexity7 Jun 2025
- 2025EPiC: Towards Lossless Speedup for Reasoning Training through Edge-Preserving CoT Condensation4 Jun 2025
- 2025Retrieval-Augmented Generation of Ontologies from Relational Databases2 Jun 2025
- 2025Primal-Dual Neural Algorithmic Reasoning29 May 2025
- 2025DeepSeek-R1 Thoughtology: Let's think about LLM Reasoning2 Apr 2025
- 2025L0-Reasoning Bench: Evaluating Procedural Correctness in Language Models via Simple Program Execution28 Mar 2025
- 2025A Survey on Mathematical Reasoning and Optimization with Large Language Models22 Mar 2025
- 2025Improving Value-based Process Verifier via Structural Prior Injection21 Feb 2025
- 2025Social Genome: Grounded Social Reasoning Abilities of Multimodal Models21 Feb 2025
- 2025Are Transformers Able to Reason by Connecting Separated Knowledge in Training Data?27 Jan 2025
- 2024Prompting Strategies for Enabling Large Language Models to Infer Causation from Correlation18 Dec 2024
- 2024SetLexSem Challenge: Using Set Operations to Evaluate the Lexical and Semantic Robustness of Language Models11 Nov 2024
- 2024Quantifying artificial intelligence through algorithmic generalization8 Nov 2024
- 2024RARe: Retrieval Augmented Retrieval with In-Context Examples26 Oct 2024
- 2024ALTA: Compiler-Based Analysis of Transformers23 Oct 2024
- 2024In-Context Learning Enables Robot Action Prediction in LLMs16 Oct 2024
- 2024Bypassing the Exponential Dependency: Looped Transformers Efficiently Learn In-context by Multi-step Gradient Descent15 Oct 2024
- 2024Beyond Graphs: Can Large Language Models Comprehend Hypergraphs?14 Oct 2024
- 2024Everything Everywhere All at Once: LLMs can In-Context Learn Multiple Tasks in Superposition8 Oct 2024
- 2024Your Context Is Not an Array: Unveiling Random Access Limitations in Transformers10 Aug 2024
- 2024Effective Generative AI: The Human-Algorithm Centaur16 Jun 2024
- 2024Transformers meet Neural Algorithmic Reasoners13 Jun 2024
- 2024The CLRS-Text Algorithmic Reasoning Language Benchmark6 Jun 2024
- 2024Language Models Need Inductive Biases to Count Inductively30 May 2024
- 2024Why Larger Language Models Do In-context Learning Differently?30 May 2024
- 2024Understanding Transformer Reasoning Capabilities via Graph Algorithms28 May 2024
- 2024Chain of Thoughtlessness? An Analysis of CoT in Planning8 May 2024
- 2024A Survey on the Integration of Generative AI for Critical Thinking in Mobile Networks10 Apr 2024
- 2024SAAS: Solving Ability Amplification Strategy for Enhanced Mathematical Reasoning in Large Language Models5 Apr 2024
- 2024Language Models as Compilers: Simulating Pseudocode Execution Improves Algorithmic Reasoning in Language Models3 Apr 2024
- 2024Task Agnostic Architecture for Algorithm Induction via Implicit Composition3 Apr 2024
- 2024Quiet-STaR: Language Models Can Teach Themselves to Think Before Speaking14 Mar 2024
- 2024Mastering Text, Code and Math Simultaneously via Fusing Highly Specialized Language Models13 Mar 2024
50 newest of 111 All 111 (JSON)
- 2023Teaching Large Language Models to Self-Debugcited by 963
- 2022Towards Reasoning in Large Language Models: A Surveycited by 593
- 2023Llemma: An Open Language Model For Mathematicscited by 385
- 2025The Illusion of Thinking: Understanding the Strengths and Limitations of Reasoning Models via the Lens of Problem Complexitycited by 298
- 2024Quiet-STaR: Language Models Can Teach Themselves to Think Before Speakingcited by 292
- 2022Reasoning with Language Model Prompting: A Surveycited by 251
- 2023Can Language Models Solve Graph Problems in Natural Language?cited by 249
- 2023Deductive Verification of Chain-of-Thought Reasoningcited by 122
- 2023Hypothesis Search: Inductive Reasoning with Language Modelscited by 119
- 2024Chain of Thoughtlessness? An Analysis of CoT in Planningcited by 100
- 2025DeepSeek-R1 Thoughtology: Let's think about LLM Reasoningcited by 91
- 2022LAMBADA: Backward Chaining for Automated Reasoning in Natural Languagecited by 66
12 most cited of 42 All 42 (JSON)
- 2026How Well Do LLMs Perform on the Simplest Long-Chain Reasoning Tasks: An Empirical Study on the Equivalence Class Problem7 May 2026
- 2025Reasoning About Reasoning: Towards Informed and Reflective Use of LLM Reasoning in HCI27 Oct 2025
- 2025MathRobust-LV: Evaluation of Large Language Models' Robustness to Linguistic Variations in Mathematical Reasoning7 Oct 2025
- 2025Do Language Models Follow Occam's Razor? An Evaluation of Parsimony in Inductive and Abductive Reasoning3 Sep 2025
- 2025A Survey on Large Language Models for Mathematical Reasoning10 Jun 2025
- 2025The Illusion of Thinking: Understanding the Strengths and Limitations of Reasoning Models via the Lens of Problem Complexity7 Jun 2025
- 2025EPiC: Towards Lossless Speedup for Reasoning Training through Edge-Preserving CoT Condensation4 Jun 2025
- 2025DeepSeek-R1 Thoughtology: Let's think about LLM Reasoning2 Apr 2025
- 2025L0-Reasoning Bench: Evaluating Procedural Correctness in Language Models via Simple Program Execution28 Mar 2025
- 2025A Survey on Mathematical Reasoning and Optimization with Large Language Models22 Mar 2025
- 2025Improving Value-based Process Verifier via Structural Prior Injection21 Feb 2025
- 2025Social Genome: Grounded Social Reasoning Abilities of Multimodal Models21 Feb 2025
12 newest of 42 All 42 (JSON)
- 2026Limits of Confidence in Diffusioncited by 2
- 2026Limits of Confidence in Diffusion17 Sep 2026
- 2022A Survey on In-context Learningcited by 717
- 2023Faith and Fate: Limits of Transformers on Compositionalitycited by 496
- 2023Looped Transformers as Programmable Computerscited by 224
- 2023Looped Transformers are Better at Learning Learning Algorithmscited by 135
- 2023Teaching Arithmetic to Small Transformerscited by 121
- 2024Tokenization counts: the impact of tokenization on arithmetic in frontier LLMscited by 112
- 2023Amortizing intractable inference in large language modelscited by 94
- 2023Goat: Fine-tuned LLaMA Outperforms GPT-4 on Arithmetic Taskscited by 84
- 2024Transformers Can Achieve Length Generalization But Not Robustlycited by 82
- 2023Few-shot In-context Learning for Knowledge Base Question Answeringcited by 74
- 2023Exposing Attention Glitches with Flip-Flop Language Modelingcited by 74
- 2023Evaluating Large Language Models on Controlled Generation Taskscited by 73
12 most cited of 63 All 63 (JSON)
- 2026When LLMs Stop Following Steps: A Diagnostic Study of Procedural Execution in Language Models1 May 2026
- 2026A Guideline-Aware AI Agent for Zero-Shot Target Volume Auto-Delineation10 Mar 2026
- 2026Failing to Explore: Language Models on Interactive Tasks29 Jan 2026
- 2026CAST: Achieving Stable LLM-based Text Analysis for Data Analytics26 Jan 2026
- 2025Generalizable Insights for Graph Transformers in Theory and Practice11 Nov 2025
- 2025CG-TTRL: Context-Guided Test-Time Reinforcement Learning for On-Device Large Language Models9 Nov 2025
- 2025Bridging Kolmogorov Complexity and Deep Learning: Asymptotically Optimal Description Length Objectives for Transformers26 Sep 2025
- 2025Improving Value-based Process Verifier via Low-Cost Variance Reduction14 Aug 2025
- 2025Length Representations in Large Language Models27 Jul 2025
- 2025A Group Theoretic Analysis of the Symmetries Underlying Base Addition and Their Learnability by Neural Networks14 Jul 2025
- 2025Primal-Dual Neural Algorithmic Reasoning29 May 2025
- 2025Are Transformers Able to Reason by Connecting Separated Knowledge in Training Data?27 Jan 2025
12 newest of 63 All 63 (JSON)
Similar, not cited
Close in wording, no citation either way
- 2024Benchmarking Large Language Models for Math Reasoning Tasks
- 2024Multi-Step Reasoning with Large Language Models, a Survey
- 2024Teaching-Inspired Integrated Prompting Framework: A Novel Approach for Enhancing Reasoning in Large Language Models
- 2025Teaching LLMs According to Their Aptitude: Adaptive Reasoning for Mathematical Problem Solving
- 2025A Survey on Feedback-based Multi-step Reasoning for Large Language Models on Mathematics
- 2026Mathematical Reasoning in Large Language Models: Benchmarks, Architectures, Evaluation, and Open Challenges
- 2024From Next-Token to Mathematics: The Learning Dynamics of Mathematical Reasoning in Language Models
- 2024What Makes In-context Learning Effective for Mathematical Reasoning: A Theoretical Analysis