Reasoning, Code, or Both? How Large Language Models Handle Variations in Math Questions
On the map: LLM reasoning → Mathematical reasoning
Abstract (arXiv)
Large Language Models (LLMs) achieve impressive accuracy on mathematical reasoning benchmarks, yet their performance drops when problems are modified with simple changes like different names or numbers. Code execution methods, which let models generate and run Python code instead of reasoning in natural language, have been proposed as a solution, but their effect on reasoning robustness (the ability to maintain accuracy across problem variations) has not been systematically tested. This study evaluates three approaches on 1,000 problems from the GSM-Symbolic dataset: pure reasoning using chain-of-thought (CoT) prompting, single-shot code execution using Program-Aided Language models (PAL), and iterative code execution using Step-by-Step Coding (SBSC). All three were run on paired original and modified problems using Claude Haiku 4.5. CoT was the most robust method, with an accuracy drop of 1.3 percentage points and 1.8% of problems breaking under perturbation. PAL was the least robust at 1.7 percentage points and 3.1% broke, with SBSC falling in between. Although these differences were not statistically significant (p = .096), the directional trend was consistent across all measures, suggesting that code execution, whether single-shot or iterative, does not improve reasoning robustness on grade-school-level problem variations.
Key facts. No citing papers in the map yet (data through 7 Oct 2026). Placed in Mathematical reasoning, one of 17 directions in LLM reasoning. Builds on 8 of its 8 references that are in the map. First posted on arXiv 26 May 2026.
Builds on
8 of 8 references.
Closest ancestors · 3
Same direction, newest first
- 2025SBSC: Step-By-Step Coding for Improving Mathematical Olympiad Performance23 Feb
- 2024GSM-Symbolic: Understanding the Limitations of Mathematical Reasoning in Large Language Models7 Oct
- 2024GSM-Plus: A Comprehensive Benchmark for Evaluating the Robustness of LLMs as Mathematical Problem Solvers29 Feb
Other references · 5
- 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,302
- 2021Training Verifiers to Solve Math Word Problemscited by 9,743
- 2022PAL: Program-aided Language Modelscited by 635
- 2025Winning Gold at IMO 2025 with a Model-Agnostic Verification-and-Refinement Pipelinecited by 79
- 2025ASyMOB: Algebraic Symbolic Mathematical Operations Benchmarkcited by 5
Built on by
Not cited yet.
Similar, not cited
Close in wording, no citation either way
- 2025Are Large Language Models Robust in Understanding Code Against Semantics-Preserving Mutations?
- 2025On Code-Induced Reasoning in LLMs
- 2026Representation Robustness Under Executable Reasoning Constraints in Large Language Models for Mathematical Problem Solving
- 2024Evaluating Mathematical Reasoning of Large Language Models: A Focus on Error Identification and Correction
- 2025Do LLMs Overthink Basic Math Reasoning? Benchmarking the Accuracy-Efficiency Tradeoff in Language Models
- 2025Mathematical Reasoning in Large Language Models: Assessing Logical and Arithmetic Errors across Wide Numerical Ranges
- 2025Cross-Task Benchmarking and Evaluation of General-Purpose and Code-Specific Large Language Models ↗
- 2026CodeEval: A pedagogical approach for targeted evaluation of code-trained Large Language Models