What Really Improves Mathematical Reasoning: Structured Reasoning Signals Beyond Pure Code
On the map: LLM reasoning → Reasoning for agents, planning and code
Abstract (arXiv)
Code has become a standard component of modern foundation language model (LM) training, yet its role beyond programming remains unclear. We revisit the claim that code improves reasoning through controlled pretraining experiments on a 10T-token corpus with fine-grained domain separation. Our findings are threefold. First, when code is restricted to standalone executable programs and Code-NL data are controlled for, code substantially improves programming ability but does not act as a general reasoning enhancer; instead, it competes with knowledge-intensive tasks, especially complex mathematical reasoning. Second, the reasoning gains often attributed to code are better explained by cross-domain structured reasoning traces, such as code-text and math-text mixtures, rather than by executable code alone. Third, increasing the density of structured math-domain samples within a fixed math budget yields substantial gains on difficult mathematical reasoning while largely preserving programming performance, suggesting that cognitive scaffolds offer a targeted way to mitigate cross-domain trade-offs. Finally, routing analyses show that data-composition effects are reflected in expert-activation patterns, providing mechanism-level evidence for competitive and synergistic interactions across domains. Our results clarify which data characteristics transfer across capability dimensions and point to more precise data-centric optimization strategies.
Key facts. Cited by 1 paper in the map (data through 14 Oct 2026). Placed in Reasoning for agents, planning and code, one of 17 directions in LLM reasoning. Builds on 27 of its 37 references that are in the map. First posted on arXiv 19 May 2026.
Builds on
27 of 37 references.
Closest ancestors · 1
Same direction, newest first
Other references · 26
- 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,599
- 2021Evaluating Large Language Models Trained on Codecited by 8,320
- 2023Toolformer: Language Models Can Teach Themselves to Use Toolscited by 4,182
- 2021Switch Transformers: Scaling to Trillion Parameter Models with Simple and Efficient Sparsitycited by 3,073
- 2024Mixtral of Expertscited by 1,823
- 2023MetaGPT: Meta Programming for A Multi-Agent Collaborative Frameworkcited by 1,808
- 2021WebGPT: Browser-assisted question-answering with human feedbackcited by 1,745
- 2020GShard: Scaling Giant Models with Conditional Computation and Automatic Shardingcited by 1,631
- 2016Enriching Word Vectors with Subword Informationcited by 1,583
- 2024DeepSeek-V2: A Strong, Economical, and Efficient Mixture-of-Experts Language Modelcited by 1,135
- 2022Program of Thoughts Prompting: Disentangling Computation from Reasoning for Numerical Reasoning Taskscited by 1,076
- 2024DeepSeekMoE: Towards Ultimate Expert Specialization in Mixture-of-Experts Language Modelscited by 867
14 more
- 2023Are Emergent Abilities of Large Language Models a Mirage?cited by 523
- 2024A Survey on Data Selection for Language Modelscited by 236
- 2024OS-Copilot: Towards Generalist Computer Agents with Self-Improvementcited by 205
- 2024SWE-bench Multimodal: Do AI Systems Generalize to Visual Software Domains?cited by 203
- 2024RegMix: Data Mixture as Regression for Language Model Pre-trainingcited by 177
- 2023D4: Improving LLM Pretraining via Document De-Duplication and Diversificationcited by 150
- 2022Impact of Pretraining Term Frequencies on Few-Shot Reasoningcited by 142
- 2025Reinforcement Learning for Long-Horizon Interactive LLM Agentscited by 108
- 2019On the Use of ArXiv as a Datasetcited by 103
- 2023At Which Training Stage Does Code Data Help LLMs Reasoning?cited by 82
- 2024To Code, or Not To Code? Exploring Impact of Code in Pre-trainingcited by 47
- 2024Adaptive Data Optimization: Dynamic Sample Selection with Scaling Lawscited by 47
- 2024Data Selection via Optimal Control for Language Modelscited by 38
- 2024Programming Every Example: Lifting Pre-training Data Quality Like Experts at Scalecited by 37
Built on by
Citing papers per year: 2026: 1.
1 paper.
Similar, not cited
Close in wording, no citation either way
- 2025Which Data Attributes Stimulate Math and Code Reasoning? An Investigation via Influence Functions
- 2026Not All Code Is Equal: A Data-Centric Study of Code Complexity and LLM Reasoning
- 2024CoinMath: Harnessing the Power of Coding Instruction for Math LLMs
- 2025MathFimer: Enhancing Mathematical Reasoning by Expanding Reasoning Steps through Fill-in-the-Middle Task
- 2025On Code-Induced Reasoning in LLMs
- 2026Teaching Language Models to Think in Code
- 2026Exploring Extrinsic and Intrinsic Properties for Effective Reasoning with Code Interpreter
- 2026Math Reasoning in LLMs is Organized by Approach, Not Topic