Papers › Reasoning, Code, or Both? How Large Language Models Handle Variations in Math Questions

Reasoning, Code, or Both? How Large Language Models Handle Variations in Math Questions

26 May 2026arXiv:2605.26414added by Syntology

Matthew Kutakh

Title, abstract, authors and date from arXiv's metadata (CC0); this paper is not in the Papers with Code archive (frozen 2025-07-28).

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.

PaperPDFCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2605.26414")

Code

Syntology Ran 6 of 7 code samples harvested from 1 repository linked to this paper; 1 has no recorded run. Of those that ran: 6 ran with no contract checked.

By repository: found in paper text by Syntology: 7 samples from 1 repository, 6 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

masamodelkin/llm-robustness-code-execution found in paper text by Syntology report

Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

7 samples harvested; 6 ran; 0 honoured the contract we drafted; 1 has no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

6ran
1unverified

Licence: 0 of the 7 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from masamodelkin/llm-robustness-code-execution. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

build_cot_prompt masamodelkin/llm-robustness-code-execution/src/prompts/CoT.py found in paper text by Syntology ran fingerprinted MIT (permissive) · f50e6d4ed64675b8 · report
build_pal_prompt masamodelkin/llm-robustness-code-execution/src/prompts/PAL.py found in paper text by Syntology ran fingerprinted MIT (permissive) · 896ba67910f72b31 · report
execute_code masamodelkin/llm-robustness-code-execution/src/evals/PAL.py found in paper text by Syntology ran MIT (permissive) · e0e689a905260a24 · report
extract_answer masamodelkin/llm-robustness-code-execution/src/evals/CoT.py found in paper text by Syntology ran fingerprinted MIT (permissive) · f8f102d5cfc1883c · report
extract_code masamodelkin/llm-robustness-code-execution/src/evals/PAL.py found in paper text by Syntology ran fingerprinted MIT (permissive) · 1b2e245d59818293 · report
extract_final_answer masamodelkin/llm-robustness-code-execution/src/evals/SBSC.py found in paper text by Syntology ran fingerprinted MIT (permissive) · 3f5c70d489db7cf6 · report
build_sbsc_prompt masamodelkin/llm-robustness-code-execution/src/prompts/SBSC.py found in paper text by Syntology unverified MIT (permissive) · 2aa8b762243cf7ff · report

Results from the paper

The Papers with Code archive ends with its 2025-07-28 snapshot. This paper's arXiv identifier, 2605.26414, was issued in May 2026, after that date, so the archive has no leaderboard rows for it.

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections