Introduction
The current state-of-the-art for enhancing Large Language Model (LLM) reasoning capabilities involves post-training on Chain-of-Thought (CoT) data, often distilled from frontier models like OpenAI-o1 or DeepSeek-R1. Despite the success of this approach, the curation of such training data remains more of an art than a science. Researchers typically rely on broad heuristics—such as filtering for well-structured formatting or prioritizing high-difficulty problems—without a granular understanding of why specific data points are effective.
This paper addresses this gap by introducing a systematic, data-driven framework to attribute an LLM's reasoning capabilities directly to its training data. By analyzing influence at the instance, sequence, and token levels, the authors uncover the underlying mechanisms that drive performance in mathematics and programming.
Methodology: The Infra Framework
The authors introduce Infra (Influence-based Reasoning Attribution). To avoid the computationally prohibitive task of retraining models repeatedly to measure the impact of specific data points, the framework utilizes influence functions. This technique estimates how a model's parameters—and its subsequent performance on a test set—would change if a specific training example were upweighted.
To make this tractable for massive LLMs, the authors employ the EK-FAC (Eigenvalue-Corrected Kronecker-Factored Approximate Curvature) method to approximate the Hessian matrix. The analysis focuses specifically on the model's MLP parameters and is applied at three distinct granularities:
- Instance-level: Ranking entire training examples to determine which domains (math vs. code) and difficulty levels drive the most significant performance gains.
- Sequence-level: Measuring the value of specific cognitive behaviors by virtually "erasing" sentences—such as verification or backtracking steps—and re-computing the influence score.
- Token-level: Decomposing gradients autoregressively to identify the exact tokens that trigger the model's reasoning processes.
Key Insights: The "Difficulty-Flip" and Exploration
The Synergy of Math and Code
One of the paper's most striking findings is the "Difficulty-Flip" synergy. While one might assume that harder data is always better, the authors discovered that the optimal training mix consists of hard math problems paired with easy coding tasks.
Their analysis suggests that math serves as the primary driver for core logical reasoning. Conversely, easy code provides clear, consistent structural templates that help the model organize its logic. Interestingly, hard code problems were found to be less helpful, likely because their complexity can obscure the underlying reasoning patterns the model needs to learn.
Exploration as a Necessity, Not an Inefficiency
Long-form CoT models frequently exhibit "exploratory" behaviors, such as pausing to reconsider an approach or checking for errors (e.g., "Alternatively, maybe there's a different way..."). While some researchers previously viewed this as inefficient "overthinking," Infra proves these steps are highly influential. These exploratory traces are essential for generalizable reasoning; removing them leads to a significant drop in performance across both math and code benchmarks.
Divergent Reasoning Triggers
Token-level analysis reveals that the model utilizes different "anchors" for different domains. In mathematics, the most influential tokens are natural language logical connectors like Wait, However, Therefore, and Alternatively. In coding, the model relies on structural syntax markers, such as Markdown headings, backticks, and function definitions (def).
Experimental Results
The authors validated their findings by applying a "Difficulty-Flipped" data mixing strategy to a 17k dataset and fine-tuning Qwen2.5-7B-Instruct. The results demonstrated substantial improvements:
- AIME24: Accuracy doubled from 10.0% to 20.0%.
- LiveCodeBench: Accuracy increased from 33.8% to 35.3%.
- Ablation Studies: Removing exploratory reasoning steps from the training data caused MATH500 accuracy to drop from 77.2% to 73.8%, confirming that these traces are vital for high-level performance.
Conclusion and Future Work
By moving beyond heuristics and utilizing influence functions, this research provides a clearer roadmap for data curation in the era of reasoning-heavy LLMs. The study highlights that the value of data lies not just in its difficulty, but in how it balances logical depth with structural clarity.
While the current work is limited to the math and code domains and focuses on MLP parameters, it sets the stage for future investigations into other complex fields, such as commonsense reasoning and multi-step planning, to see if similar cross-domain synergies exist.
Summary updated