mlsanityData to 7 Oct 2026

Which Data Attributes Stimulate Math and Code Reasoning? An Investigation via Influence Functions

arXiv 2505.19949 ↗First posted 26 May 2025cs.LGcited by 7

On the map: LLM reasoning → Mathematical reasoning

Abstract (arXiv)

Large language models (LLMs) have demonstrated remarkable reasoning capabilities in math and coding, often bolstered by post-training on the chain-of-thoughts (CoTs) generated by stronger models. However, existing strategies for curating such training data predominantly rely on heuristics, limiting generalizability and failing to capture subtleties underlying in data. To address these limitations, we leverage influence functions to systematically attribute LLMs' reasoning ability on math and coding to individual training examples, sequences, and tokens, enabling deeper insights into effective data characteristics. Our Influence-based Reasoning Attribution (Infra) uncovers nontrivial cross-domain effects across math and coding tasks: high-difficulty math examples improve both math and code reasoning, while low-difficulty code tasks most effectively benefit code reasoning. Based on these findings, we introduce a simple yet effective dataset reweighting strategy by flipping task difficulty, which doubles AIME24 accuracy from 10% to 20% and boosts LiveCodeBench accuracy from 33.8% to 35.3% for Qwen2.5-7B-Instruct. Moreover, our fine-grained attribution reveals that the sequence-level exploratory behaviors enhance reasoning performance in both math and code, and the token-level influence patterns are distinct for math and code reasoning: the former prefers natural language logic connectors and the latter emphasizes structural syntax.

Key facts. Cited by 7 papers in the map (data through 7 Oct 2026). Placed in Mathematical reasoning, one of 17 directions in LLM reasoning. Builds on 25 of its 41 references that are in the map. First posted on arXiv 26 May 2025.

Builds on

25 of 41 references.

Closest ancestors · 1

Same direction, newest first

  1. 2025LIMO: Less is More for Reasoning5 Feb

Other references · 24

  1. 2021Training Verifiers to Solve Math Word Problemscited by 9,743
  2. 2025DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learningcited by 6,146
  3. 2024Qwen2.5 Technical Reportcited by 4,713
  4. 2021Program Synthesis with Large Language Modelscited by 3,509
  5. 2025s1: Simple test-time scalingcited by 1,311
  6. 2024OpenAI o1 System Cardcited by 1,220
  7. 2024Tulu 3: Pushing Frontiers in Open Language Model Post-Trainingcited by 988
  8. 2023MetaMath: Bootstrap Your Own Mathematical Questions for Large Language Modelscited by 724
  9. 2022Towards Reasoning in Large Language Models: A Surveycited by 593
  10. 2024Do NOT Think That Much for 2+3=? On the Overthinking of o1-Like LLMscited by 564
  11. 2023MAmmoTH: Building Math Generalist Models through Hybrid Instruction Tuningcited by 483
  12. 2025Stop Overthinking: A Survey on Efficient Reasoning for Large Language Modelscited by 456
12 more
  1. 2025Cognitive Behaviors that Enable Self-Improving Reasoners, or, Four Habits of Highly Effective STaRscited by 373
  2. 2023Studying Large Language Model Generalization with Influence Functionscited by 311
  3. 2022Reasoning with Language Model Prompting: A Surveycited by 251
  4. 2025Light-R1: Curriculum SFT, DPO and RL for Long COT from Scratch and Beyondcited by 175
  5. 2024Imitate, Explore, and Self-Improve: A Reproduction Report on Slow-thinking Reasoning Systemscited by 162
  6. 2024O1 Replication Journey: A Strategic Progress Report -- Part 1cited by 140
  7. 2025LLM Post-Training: A Deep Dive into Reasoning Large Language Modelscited by 129
  8. 2025Towards System 2 Reasoning in LLMs: Learning How to Think With Meta Chain-of-Thoughtcited by 108
  9. 2024O1 Replication Journey -- Part 2: Surpassing O1-preview through Simple Distillation, Big Progress or Bitter Lesson?cited by 90
  10. 2024Interpretable Contrastive Monte Carlo Tree Search Reasoningcited by 62
  11. 2025CodeI/O: Condensing Reasoning Patterns via Code Input-Output Predictioncited by 54
  12. 2024Procedural Knowledge in Pretraining Drives Reasoning in Large Language Modelscited by 41

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2025: 2; 2026: 5.

7 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2025Influence Functions for Efficient Data Selection in Reasoning
  2. 2025On Code-Induced Reasoning in LLMs
  3. 2026What Really Improves Mathematical Reasoning: Structured Reasoning Signals Beyond Pure Code
  4. 2026Not All Code Is Equal: A Data-Centric Study of Code Complexity and LLM Reasoning
  5. 2024CoinMath: Harnessing the Power of Coding Instruction for Math LLMs
  6. 2025More Data or Better Data? A Critical Analysis of Data Selection and Synthesis for Mathematical Reasoning
  7. 2025MathFimer: Enhancing Mathematical Reasoning by Expanding Reasoning Steps through Fill-in-the-Middle Task
  8. 2024Evaluating LLMs' Mathematical and Coding Competency through Ontology-guided Interventions