Which Data Attributes Stimulate Math and Code Reasoning? An Investigation via Influence Functions
Authors: Siqi Kou
Qingyuan Tian
Hanwen Xu
Zihao Zeng
Zhijie Deng
Venue: NeurIPS 2025 poster ()
Keywords: influence functions
llm reasoning
Primary area: deep_learning
TL;DR: In this paper, we propose a fine-grained influence function framework to trace how training data on SFT phase shapes LLM reasoning in math and code tasks.

Abstract: 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.

Which Data Attributes Stimulate Math and Code Reasoning? An Investigation via Influence Functions
Siqi Kou, Qingyuan Tian, Hanwen Xu, Zihao Zeng, and Zhijie Deng" Shanghai Jiao Tong University
(happy-kark) , qy tian, detnorin, zengzihao, zhijied) edu. cn
Abstract
Large language models (LLMs) have demonstrated remarkable reasoning capabili- ties in math and coding, often bolstered by post-training on the saain-of-thought (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 based Reasoning Attribution (Infra) uncovers nontrivial cross-domen effects across math and cod- ing tasks: high-diffiellty math examples improve both math and code reasoning, while low-difficulty code tasks most effectively benefit code reasoning. Based on these findings, introduce 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-7BB-Instrue. Moreover, our fine-grain fne-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.
Introduction
Large language models (LLMS) for reasoning, with OpenAl-ol 15 and DeepSeek-R1 9 as popular examples, have shown great promise in solving complex math and coding problems. Recently, the community has witnessed the prevalence of reproducing such reasoning capacities on open-source An initial stage of the solutions often involves post-training the model on some chain-of-though (CoT) reasoning traces curated by leading models (c.g., RI) for As data-centric paradigm, the core research question here is: which attributes of the training data are effective in stimulating reasoning capabiliries?
small- medium-sized LLMs
19
3 29
diverse problems 34 23 24
25
Pioneering studies addressing this question predominantly adopt heuristic approaches. Typically, they first establish quantitative data quality metrics based on human expertise or empirical preferences, then selectively retain high-quality data for model training cultivate robust reasoning capabilities with minimal data inputs. For example, s (24) filters 1 (question, answer) pairs with well-structured formatting, longer CoT length, and broader domain coverage from an initial pool of 59k data for training math reasoning LLMs. Similarly, LIMO [37 suggests incorporating more challenging math questions with complex reasoning chains enable better math reasoning.
Beyond focusing exclusively on math, Sky-T1 25 targets competitive reasoning performance across both math and coding tasks. It notices that the naive incorporation of code data from APPS (I0)
Conresponding author.
39th Conference on Neural Information Processing Systems (NcurIPS 2025).

---

Hard Math
Hard Code
Orggies dateant
Deliicltty dlippl desase
Velts Friy Hoe Code Faxdre Foo
+10.00
higher infisence
+30.0
Kwar iefirece
Easy Math
Easy Code
ADHEX AIMES5
LbwCokettach
Figure 1: An illustration of our key findings towards the question: Which atrriuues of training data effectively stimulate reasoning capabilities? Mixing challenging math problems with easier coding tasks leads the highest influence scores for mathematical and coding reasoning (left). Guided by this insight, we curate an improved dataset and observe enhanced performance (right).
degrades math performance and advocates mitigating this by introducing more difficult math questions and code tasks for training. Nevertheless, the underlying mechanism of such cross cross-domann influence remains underexplored. Furthermore, these heuristic strategies suffer from unreliable generalization to other reasoning scenarios and cannot clearly explain how some fine-grained reasoning patterns in the training data (e.g., verification, backtracking, etc.) affect the learned models.
To bridge the gap, we leverage influence functions 17 a classical technique for tracing the impacts of individual training data model behavior-to systematically identify which training examples, along with their internal patterns and tokens, most significantly enhance the reasoning capabilities on math and coding tasks. Following previous works on influence functions for LLMs an easy-to- to--iimmmmmeettt and cost-effective influence function for reasoning oriented supervised fine- tuning (SFT). We further extend the instance- wise influence function to more fine-gre mmn-iirieed variants at the sequence and token levels for an in-depth data attribution. We dub our approach as Infra.
30] we define
We begin by investigating cross-domain influence in basic math and code reasoning scenarios without long COT. To this end, we fine-tune L.L.MA3-8B-BBB Base 7 on mixture of MetaMathQA 39 and OSS-Instruct 33 datasets and compute the influence function on the accuracy of GSM8k and MBPP [O]. We rank all training data by their influence scores and find that, while in-domain data yield the highest scores expected, cross-domain data also contribute nontrivially. Furthermore, aggregating these scores by category and difficulty reveals that symbolic math examples and high- difficulty math problems are particularly effective in improving code reasoning.
Extending Infra to complex long CoT reasoning, we fine-tune Stratos- 1 7 dataset and measure influence using AIME, MATH500 (.]. and LiveCodeBench [I6] benchmarks. Consistent with earlier findings, we observe cross-domain gains, with harder math problems better helping code reasoning. Going step further, we find that both high-difficuly math and code examples are more influential on math reasoning, whereas low-difficulty code tasks contribute most significantly to code reasoning (see Figure Motivated by these insights, we flip easy math problems as hard and hard code tasks as easy the training data. This reweighted dataset doubles AIME accuracy and improves LiveCodeBench accuracy from 33.8% to 35.3%.
77--ssuuttt 36) on Bespoke-
Furthermore, we perform attribution sequence and token levels in long COT. Sequence-level attribution shows that the exploration behavior of seeking alternative approaches after reaching correctness (refer to Figure which common in long CoTs, improves both math and code reasoning performance. Despite being seen as overthinking (2) 32 our studies suggest it is advantageous. Besides, we observe distinct token-level influence patterns for math and code reasoning. In math, the most influential tokens are natural language with logical connectors, whereas code Co'Ts rely more on syntax markers. This divergence explains why easier code problems with clearer structural solutions benefit code reasoning when combined with math CoT that already provides logical skills.
2 Related Work
LLM reasoning, Reasoning cognitive process that involves using evidence, arguments, and logic to arrive at conclusions or make judgments. It is widely regarded as a foundational element of

---

advanced Large Language Models (LLMs) and an essential milestone on the path toward Artificial General Intelligence (AGI) [22
13 35 A very recent approach to achieve reasoning capacity in LLMs is through post-training, such as OpenAl-ol [T5] and Deepseek-RI [9], which expose
28
29
the model to large-scale curated reasoning examples after the initial pretraining phase refine its inferential abilities [18]. These reasoning datasets predominantly fall into two categories: (1) Mathematical reasoning: In earlier work, the construction of high-quality mathematical datasets primarily relied on increasing the quantity of problems and enhancing their difficulty levels 40) Nevertheless, LIMO dataset [37] demonstrated that complex reasoning capabilities can be elicited through surprisingly small datasets (hundreds of examples). In addition, some researchers also opted to distill Sigh-quality reasoning data from strong LLMs [25], leveraging their outputs to construct more targeted and informative training sets for enhancing reasoning performance in weak LLMs. (2) Code generation: As a highly structured and formalized type of data, code has a non-negligible impact on the development of reasoning abilities in large language models. Beyond simply testing LLMs on newly coding test cases [16], many efforts have focused on investigating how and when code data influences the development of reasoning abilities in language models [41 (1]. In work, we consider mathematical capacity and coding ability as two distinct manifestations of advanced reasoning, and we aim analyze and understand the interactions between these capabilities to gain deeper insights into the underlying mechanisms of LLM reasoning.
Data attribution and influence functions. Training Data Attribution (TDA) methods seek to interpret a model's 's predictions by analyzing the particular training instances that contributed to shaping its learned representations. Most modern TDA methods can broadly be divided into two categories: retraining-hast -hased methods [22 31 14] and gradient-based methods [38 27 17 However,
applying traditional data attribution methods large language models has remained significant challenge, primarily due to issues computational tractability and the sheer scale of model parame- ters. Nonetheless, there are several works successfully apply data attribution on LLMs by influence function. Researchers in Anthropic adapt EK-FAC influence functions to large-scale Transformers, by which they figured out what kind of pretraining data influences completions of models up to 50B parameters [8] More specifically, for reasoning capabilities, studies have shown that code data encountered during the pretraining-phane
plays critical role in the development of mathematical rea- soning abilities in language models. (30). In this work, we extend similar methodological approaches by employing influence functions to attribute the development of reasoning capabilities during the supervised fine-tuning (SFT) phase, with particular focus on analyzing the interplay between code and mathematical data.
3 Methodology
This section reviews the basics of influence functions 17 g and presents Infra, our adaptation for attributing LLM reasoning performance on math and code problems. particular, we compute instance-level influence scores using mean log- loglliiel proxy, and further shift to the sequence and token levels to uncover how specific reasoning steps and tokens shape model behavior.
3.1 Preliminary: Inffuence Functions
Given a model parameterized by 0 and trained on a dataset Dirain = { 1=11 influence functions 17 estimate the influence of training point 2m 0 (or function thereof) without retraining the model. Specifically, it is measured by computing the change in 0 if zm is upweighted by an infinitesimal amount e. This perturbation can be formalized as the response function
1 N
(c) arg JinJ (0, Durann <) = arg min BERD
Σ
C (z,, 0) eL (2m, 0),
DERD N
where Z(-) is the training loss. The influence of 2m on θ is then defined as the first-order Taylor approximation to the response function around 0 and can be computed using the implicit theorem:
d0
[o(mm)
- (Zm. 0),
de 1==
FFor simplicity, we show the response function for optimal parameters. For non convereee or non-convex models, the actual response function is the Proximal Bregman response function (refer [8) for details).
3

---

where = V2J (0. Puain) is the Hessian of the cost function. Direct interpretation of (z can be difficult due its high dimensionality, so is common to instead compute the influence of 2m on a scalar-valued function of the parameters (()). Using the chain rule for derivatives, this influence admits the closed-form:
(f) Vof (0)" H H VVC (zm:
(zm)
de
complete derivation of Equation is delayed to Appendix A Consequently, f(0) expected to increase after upweighting the sample 2m and then retraining the model if (f
as
f(O(e)) f(0)= (2m))
Vef (0)* H VoL VVo (Zm, E...
(4)
For transformer-based LLMs with billions of parameters, the above H is intractable. To address this, Grosse et al. [8] propose to approximate H using the Eigenvalue- Figenvalue-Correeee
Cronecker-Factoree Approximate Curvature (EK-FAC) method [6), which introduces simplifying assumptions such as layer-wise independence and restricts computation only to the MLP parameters within the model. Given the effectiveness of such a strategy, we also employ it effectively estimate influence scores.
3.2 Attributing LLM Reasoning to Training Data via Influence Functions
We now introduce Infra, our adaptation of influence functions to attribute L.MM reasoning on challeng- ing math and code tasks. As mentioned, our setting is mainly an SFT process with CoT's generated by a stronger model to improve the reasoning abilities of the LLM at hand. We are interested in identifying the most influential training data improve model performance. Since task accuracy is non-differentiable with respect to 0, we instead adopt smooth surrogate: the mean log-likelihood over set of correctly answered examples. Let Donreat {(x 3/));== denote collection of problems x; paired with correct answers ys. we define the surrogate objective as:
((0) = 1 Σ log ((
"
(5)
where n is the size of D Doorrea- The robustness of D correct against variation is ablated in Appendix C
Instance-level influence scores. Plugging Equation 5 into Equation 3 yields the instance-level influence score assigned to each SFT training example 5m reflecting its effect on (0).. Consistent with (8]. restrict our focus to positively influential data, which refers data points that yield an increase in the log-likel log-likeldhood of correct answers and thus more effectively enhances the model's reasoning performance.
Sequence-level influence scores. Reasoning traces of recent models often exhibit sequence-level cognitive behaviors, such as verification exploration (refer to Figure To attribute the contribution of individual sentence
2m, we employ a simple counterfactual tactic: we remove y from the example and measure how the influence scores changes. Let 2m denote the input with sentence erased. Then the sequence-level influence y given by
(v( = (2m) I (2),))
(6)
which isolates the influence of the target function f()).
Token-level influence scores. Tokens that mark critical transitions such 'wait' frequentty appear in long COT. Attributing influence at the token level may therefore help elucidate the underlying mechanisms that guide the model's 's reasoning. Due to the autoregressive nature LLMs, the training gradient of a training sequence 2.. of length T decomposes as:
VeL (Zmas 0)
Ve log p(zm, pom Q),
where ž,,,t denotes the 1-th token and Zm, {mm,1,... 1.. Plugging this into Equation yields the token-level influence of 2m,
(z = Vof (0) H V
0).
(8)
'This term captures the influence of Zm, the output for the model to fit, ignoring its role as input in other cases, for simplicity.

---

mudh code
meth oode
Legartthnic posttive Inthraree scores
10
30-
Logarttmis
0
10000
20000
30000 40000
10000
20000 30000 4,0000
Index
Index
top
scares
Figure 2: Cross-domain influence analysis of LLaMA3-8B--aa fine-tuned on combined Meta- MathQA and OSS-Instruct for math and code performance. The most beneficial examples for math performance predominantly come from the math domain, while code-domain data also contributes non-trivially (left), A similar cross-domain benefit is observed for code performance (right).
Experiments
We begin by detailing the experimental setup ($4.1), and then present the main findings, progressing from coarse- to fine-grained analyses (44.2-$4.4).
4.1 Experimental Setup
We conduct experiments under two SFT settings and interpret math and code reasoning behaviors using influence functions in both scenarios. All training and influence scores computation are carried on servers equipped with 8 NVIDIA A100 80GB GPUs.
Base models trained w/o long COT. We fine-tune the Llama3-8B-Bal 8B-asse model using a mixed training dataset comprising MetaMathQAA1008 [39] and JSS-Instruct-75k 333 MetaMathQA-100
includes reformulated questions bootstrapped from training splits of GSM8k 3 and MATH [I]
paired with brief answers (-100 tokens) generated from GPT-3.5-Turbo 26 OSS-Instruct-75k provides synthetically generated instructions covering a range of coding tasks. We evaluate the resulting model on the test splits of GSM8k and MBPP [. filtering correctly answered data compute influence scores. The MBPP benchmark consists of 1,000 Python programming problems, each comprising a task description and three automated test cases.
Instruction-tuned models trained w/ long COT. We fine-tune the Qwen2.5-76 7 model [36 the Pespoke-Stratoss 7k reasoning datase (7k), which includes SFT distillation data from DeepSeek-R1 19) comprising questions, reasoning traces, and answers. We employ the AIME24, AIME25, MATH500, and LiveCodeBench [16] benchmarks evaluate reasoning performance. AIME is prestigious high school mathematics competition known for its challenging problems. MATH500 is subset of 500 problems drawn from the MATH [11] benchmark. LiveCodeBench evaluates LLMs on diverse coding tasks, including self-repair, code execution, and test output prediction, and currently hosts 400 coding problems.
Influence scores computation. We estimate the Hessian using EK-FAC on the full SFT training set, truncating sequences to 4096 tokens to reduce memory usage. We set 100 in Equation 5 by randomly sampling correctly answered math and code examples.
4.2
Instance-level Attribution
Finding 1:
Code data can positively influence math performance, and vice versa.

---

4.50
63
4.2
Disapartio of Trminon Data
0.00
Avg. Infhancc MOOON 431
use ond you
6.2
cod
Aucrrge Enfuence
MBPP categortes
GSMUk MISPP by difficulties
Figure 3: Average influence of the training dataset combining MetaMathQA and Ins-Instr evaluated on MBPP and GSM8K performance. Results are grouped by training data category (left) and MATH problem difficulty (right).
To investigate cross-domain influence after fine-tuning LLaMA3-8B- BBse MetaMathQA and OSS-Instruct, we rank training samples based on their positive influence on the mean likelihood of correct answers in math and coding tasks, respectively, and categorize them by domain. As shown in Figure the most influential samples for improving math performance predominantly originate from the math domain. However, influence scores from code-domain data concentrated in the low range (0-10); instead, a substantial number exhibit scores in the 15-20 range, indicating non-trivial contribution from code math. A similar pattern of cross cross-domain benefit observed in Figure (b). This also holds in long CoT reasoning scenarios as shown in Appendix
narrowly
To investigate how various training data types influence code reason- ing, we further aggregate training samples by category and compute average influence scores per category. As illustrated in Figure 3 (a). in-domain Python data yields the highest average influence on MBPP benchmark of 1,000 Python problems). Within the math domain, symbolic problem-ansee variables æ in FOBAR and SV formats shown Figure 4 most effectively enhance coding capabilities. Moreover, college-level math questions from the MATH dataset, which utilize LaTee-bbaser formal expressions, contribute more positively to code performance than simpler, conversational high-school problems from GSM8k. This suggests that, beyond domain relevance, the complexity and formality of the data- especially the use of precise symbolic lan- guage-an also play critical role in enabling models to generalize effectively to code reasoning tasks.
Original Question: What is div 3 lodot HS!
FOBAR Question:
88?
T'ee know unknown variable
above quastiion
pairs-such those introducing
Sett-V Verificaaann Question: S sull 3-x-8 lekke 8 85
unknowa variable
Rephrased Question:
Colcclste the valua of die 2 Vaake
Figure 4: Different types of MATH questions from Meta- MathQA dataset.
Finding 2:
Challenging math problems exhibit higher influence scores on both math and code reasoning, while simpler code problems effectively enhance code tasks when combined with math data. The optimal sirategy for co-optimizing reasoning across both domains is to mix challenging math problems with easier code tasks.
To examine how training data difficulty contributes to model performance, we first categorize MATH training data into different difficulty levels and compute the average influence score for each level. As shown in Figure b), higher-difficult problems (Level and 4) contribute more significantly to performance improvements on GSM8k and MBPP compared to lower-difficulty ones (Level 3. 2, and 1). This may attributed to the fact that high-difficulty MATH problems induce more complex reasoning chains and thus better transfer logical capabilities other reasoning intensive tasks.

---

Saub Nab--Natk
Oode-Maia
Cods-Godk
Dasy Manh
Hard Math
Tass Cods
Utrd Code
147
1n1
Flipped
Talhoare Mart Reannsten (-Maat
(-Gaddo)
Oviginal dutsect dist ination
Difficlly revene-lipped
200%
(3) Inflaence of Math and Code Data on Rrasening Acrovs Biffieunty Levels
(b) Ellastration of Training Datioe Distribation
Figure 5: Left: Average influence scores of math and code training data from varying difficulty levels on reasoning performance. For instance, Math->Coee denotes the influence of math data on code reasoning tasks. Right: Distribution of math and code samples across difficulty levels in the BS17k dataset. The original distribution is shown alongside the adjusted distribution obtained via the difficulty-flip strategy. See Table T for comparison of SFT results under different mixing strategies.
Table 1: Comparisons of SFT results with different difficulty- strategies applied to the training dataset on 7B and 14B models. We report pass accuracy LivchodeBench.
Model
AIME241
AIME251
MATH5001
LiveCodeBenchr
Qwen2.5-Instrutt-2
Bespoke Respoke-Stratos-177 17k
10,0
6.7
77.2
33.8
Difficuty-rrevcrs--liipp
13.0
10.0
76.4
30.0
Difficulty-Flipped (Ours)
20.0
16.7
78.2
35.3
Qwen2.5-Instruutt-4B
Bespoke-Stratos-1
20.0
13.3
84.4
45.3
Difficulty-revere--Pe reverss--eeeseeepeee
20.0
23.3
83.0
43.8
Difficulty-Fiipedd (Ours)
23.0
23.3
84.4
45.5
To further investigate the role of difficulty in long CoT reasoning scenarios, we fine-tune Qwen2.5- 7B-Instruct on the BS17k dataset and analyze influence scores grouped by difficulty levels. The results, shown in Figure indicate that challenging tasks in both mathematics and coding are more beneficial for math reasoning. contrast, easier math problems offer limited gains across both math and coding evaluations. This observation aligns with findings from the w/o long CoT setting and prior works such as LIMO [37], which highlight the utility of difficult math problems in developing reasoning capabilities. On the other hand, we find that simpler code problems for improving performance on coding tasks when mixed with math data. We hypothesize that, in addition logical reasoning, programming tasks rely heavily learning structural and syntactic patterns. When paired with math data that enhances logical thinking, simple coding tasks with clearer structure and more consistent syntax facilitate the model's acquisition of fundamental programming patterns, thereby improving code generation performance.
more effective
Based on these insights, we design an optimized data mixing strategy: we replace simple math prob- lems in the original dataset with more challenging ones sourced from larger scale OpenThoughts- dataset, and conversely, dataset retaining the original size of 17k examples, compared in Figure 5)b), is used to retrain the model. As shown in Table T this new difficulty flipped mixing strategy yields consistent improve- ments across AIME, MATH, and LiveCodeBende benchmarks. In contrast, applying the reverse grratey-ssipliiee
replace difficult coding problems with simpler ones. The modified
hard math problems and complicating easy coding tasks results in the worst performance, further validating our finding.
'nttps//huggingfacce http:/gggggggggecoooo//tttt////o hiapssstt//penttoooooo//o//pppe the same pipeline 17k, with identical question sources and answers distilled from Deepseck-RA R..
114k. Note that this dataset is curated using
7

---

Question:
Coasts Halk
Codc
Your role assistunt invalves explorin questions through gystematic long thinking before
providing precise accurate solutions (..) nox divisible by 535?
3399
For which the following integers ShS the hase So5 number $2021_b-- 20221--21110 221
(A)3 (B)
(1)8
Nustec Oesurtnnee
2390
Answer:
<lbegin thought?
Okay, so need to figure out (...) Therefoee, 8 is the only base where 14 2o/2 11 divisible by 3.
Therefore, the answer I.
Thaeefons the unsvuc (x) &
Wait, hut me crose-check this concinsion Let's compune the expression V4 2b-2(b- (.).
1300
3.75
But me juce think apin if then''s snother way approech this portiirs, portaps by conedering the Hence, the is
original submmction base if
4.0
lutt let me check once again by calculainng exch expression modele 3 directly (.))
391
Therofom, the answer is (R).
<jend of thought
<tbegin solution-
Sankratin
Andgged
Verileation
<end of sobation
Explocation
Bohavioue Categorios
Figure 6: Left: An example of long CoT illustrating cognitive behaviors: verification (systematic error-checking) and exploration (searching for another approach after reaching the correct answer). Right: Distribution of different cognitive behaviors in BS-17k training dataset and their average impact on math and code reasoning performance.
Table 2: Sequence-level attribution of cognitive behaviors in long CoT. Left: Comparison of influence scores of the example in Figure math and code reasoning, w/ and w/o verification and exploration sentences. Right: Comparison SFT results w/ and w/o exploration behaviors in BS-17U dataset.
Domain
full CoT
w/o Ver.
w/o Exp.
w/o both
Model
MATH500
LiveCodeBench
Math
2.2c+08
1,5e+08
9.0c+07 8.4c+06
7.0e+07
w/ Exp.
77.2
33.8
Code
2.2c+07
1.6c+07
7.5e+06
w/o Exp.
73.8
32.0
4.3
Sequence-level Attribution
Finding 3:
The presence of 'searching for another approach after reaching correct answers' in math reason- ing traces benefits to both math and code reasoning. While previously considered unnecessary overthinking, our sequence-leve influence analysis and SFT ablations demonstrate its positive impact, suggesting such explorutory behaviour may promote generalizable reasoning skills.
We are interested in the influence of different cognitive behaviors on reasoning performance. Fol- lowing prior work [4], we focus on five key behaviors: exploration (secking alternative approaches after reaching a correct answer), verification (systematic error-checinng), backtracking (abandoning ineffective strategies), subgoal setting (breaking problems into manageable steps), and backward chaining (reasoning from desired outcomes to initial inputs). To identify these behaviors in the @wwen332Biinstruce
BS-17k dataset,
classifier, with details provided in Appendix
As shown in Figure 6 (right), exploration behavior is notably prevalent in the training dataset. However, prior research often views exploration detrimental, considering it form of overthinking We therefore seek to assess whether this cognitive behavior has positive or negative impact using influence functions. Specifically, we truncate sentences in the training data where exploration behavior is present and examine the change in the influence score, as defined in Equation 6 The results, presented in Table (left), show that exploration behavior is not redundant; on the contrary, it has a positive effect on both math and code reasoning performance, with the positive impact of exploration even exceeding that of verification.
that can reduce efficiency 2 32
To further validate this, we use GPT-4o to truncate all exploration behaviors in the BS-17k dataset for SFT, with the instruction details shown in Appendix D The SFT results in Table (right) show a significant performance drop when exploration behavior is removed. We attribute this decline to exploration's 's role in enabling flexible problem-solving. essential for adapting to diverse reasoning tasks. Beyond exploration, we compare average influence scores across other cognitive hehaviors. As shown in Figure (right), backtracking is crucial for mathematical reasoning, while subgoal setting

---

Dlay ieed fist the snaller driee -ight pallstrons tor when multipiee
Eaaay need ts sclve this pregeelien where have partitin an arry into the contigaans arays
mestt to digh paindrem
we't (cam toderraciing
equai every lall
problers iees bi mee Best paknadorne a mumber dud ronda the mase ferwords and bedlwande. Thax
elenent in the rigil The left asuald be scuel as posslee Hean Let thine. key have io find memmmaled poailss lel
coeaitii
kiee you mastiply das Lore digh piliadenee by 1. to Gev digh
expity ao the left leaath can sasge froe to The man ccsciton is Juat the bus checking all pooable purtiisea and fiir mas and min ssgin be ianse connaning for Soia Pytlon, del Dis (sel A.
pilindrcee, St., fist Lanytel
figur laggess
contiply flore
the
derppiiitunn by DI Le aY exurgle Lett 1.1 Minglyy by
Let's lompat the. 101* 1000010011111111 18. Lix tealix
D
0000 palisdome Veu. bocise creading ferwari buckwards (.)
int We need process the samy A. So fres compust lef. maa i AOO fari
waii lst link abor, how sraliphiigg by 0.1 woda. Malls Vina by ii
[0]* lef.
[i]
axkiipyyng by and sking the srightl mumber 17, the origina narber ABC
max E- I.A Ther compure right mis right min [4] night miin 11- (AG...
wher A Care fight and hecarso palrndorre (-) War. so lanilyy bN
AE
da
Thes thoose thoough cnch posilee (.). Corect Sothis egproch works New,
te placa to be left, is SAA.A Addisa BAJ wlsch D0A A. seilled right by Mil8
eacb, Whic socpsible Tike. O+ soch stg, SeC So fine. So is So code
wiee,
101, soppioooaa
10 Oodd adllng mihiptinng 1.3 1881 200kne 3 S.t leyl MAIS 5 oc L.s...) L.). the
would be: dloss Solation| II
joor 1988 @I A BI [irl in): Imm (8) _ _00___xx_000000000000000 1104 x.00% _oex A003 fori range jrox 1.A.D (-) Bet asconding to problim
Bi
pastum 3. the pentior 4 the sam from pi from BA plax ahdi ponticns wondd be
Bionost proriicn thecsam is A
eabarent shere lest paritton, so the leop fisd and rnture bettee
BA0 2, which frves B.X...) Botwail, let's keity this (.)
maching and. shrold work
Figure 7: Left: Visualization of top 5% influential tokens in math CoT. Right: Visualization of top 5% influential tokens in code COT.
more impactful in programming tasks. This may be because programming requires breaking down high-level goals into modular components, making subgoal setting essential.
4.4
Token-level Attribution
Finding 4:
Token-wise attribution analysis reveals distinct paradigms in math and code reasoning. In math CoT, influential tokens are natural language with logical connectors, whereas code CoT are dominated by structured code with syntax markers.
To investigate the most influential tokens for stimulating reasoning, we select the top 100 highly influ- ential examples on math and code reasoning, compute token-wise influence scores using Equation g and highlight the top 5% most influential tokens. Interestingly, as shown in Figure the initial tokens in CoT-such as 'Okay, so I... are frequently highlighted. suggesting that these openers help orient the model's cognitive process to initiate reasoning. Further analysis reveals that, in math CoTs, the influential tokens are predominantly natural language logical connectors, such as 'Wait', 'However', "Verify'. 'Hence', 'First', 'Therefore. and 'Alterntivvlly.. In contrast, in code CoTs, the most influen- tial tokens are structural or syntactic elements such as markdown-style headings (e.g.. ### Solution), fenced code blocks (e.g., bash ), and syntax markers (e.g., def (self, A: List [int])-> int: ) which reflect the highly structured nature of code reasoning. This contrast highlights a divergence in reasoning paradigms: math reasoning relies more heavily on logical discourse, while code reasoning is facilitated by explicit structure and formatting. These divergent patterns may explain why easier code problems with clearer structural formats are particularly beneficial for enhancing code reasoning when integrated with math CoTs that already provide strong logical skills.
5
Conclusion
In this paper, we propose fine-grained influence function framework to trace how training data on SFT phase shapes LLM reasoning in math and code tasks. Our analysis reveals that cross- examples
examples-espeeciill especially high-difficulty math and low-difficulyy code-boost reasoning performance across domains. We further extend influence functions to the sequence level, revealing that exploratory behaviors in long CoT consistently enhance performance, challenging prior assumptions that such behaviors reflect overthinking. Token-level analysis reveals distinct paradigms in math and code reasoning. Our work highlights the utility of influence-based attribution for data-centric optimization and opens a path toward more targeted and interpretable reasoning supervised training.
The main limitations of this work are as follows. We approximate the Hessian H by considering only the MLP parameters and treating the attention as fixed to approximate influence functions for simplicity. Besides, our analysis is limited to mathematical and coding reasoning tasks; extending this framework to other domains, such as commonsense reasoning, remains an open direction for future work.
Limitations.

---

Acknowledgements
This work was supported by NSF of China (Nos. 92470118, 18, 62306176), Natural Science Foundation of Shanghai (No. 232R14287002 CCE-ALIMAMA TECH Kangaroo Fund (NO. CCF-ALIMAMA 2025010), and CCF-Zhipu Large Model Innovation Fund (No. CCF-Zhipu2222412)
References
[1] Jacob Austin, Augustus Odena, Maxwell Nye, Maarten Bosma, Henryk Michalewski, David Dohan, Ellen Jiang, Carrie Cai, Michael Terry, Quoc Le, al. Program synthesis with large language models. arXiv preprint M.X.:::218.07700 2021.
[2] Xingyu Chen, Jiahao Xu, Tian Liang, Zhiwei He, Jianhui Pang, Dian Yu, Linfeng Song, Qiuzhi Liu, Mengfei Zhou, Zhuosheng Zhang, et al. Do not think that much for 2+ 3=? on the overthinking of ol-like Ilms. arXiv preprint arXiv:2412.21187, 2024.
[3] Karl Cobbe, Vineet Kosaraju, Mohammad Bavarian, Mark Chen, Heewoo Jun, Lukasz Kaiser, Matthias Plappert, Jerry Tworek, Jacob Hilton, Reiichiro Nakano, et al. Training verifiers to solve math word problems. arXiv preprint arXiv:2110.14100 2021.
[4] Kanishk Gandhi, Ayush Chakravarthy, Anikait Singh, Nathan Lile, and Noah D Goodman. Cognitive behaviors that enable self- cellviipooiing reasoners, or, four habits of highly effective stars. arXiv preprint arXiv:2503.01307, 2025.
[5] Zitian Gao. Boye Niu, Xuzheng He, Haotian Xu, Hongzhang Liu, Aiwei Liu, Xuming Hu, and Lijie Wen. Interpretable contrastive monte carlo tree search reasoning. arXiv preprint arXiv:2410.01777, 2024.
[6] Thomas George, César Laurent, Xavier Bouthillier, Nicolas Ballas, and Pascal Vincent. Fast approximate natural gradient descent in a kronecker factored cigenbasis. Advances in neural information processing systems, 31, 2018.
[7] Aaron Grattafiori, Abhimanyu Dubey, Abhinav Jauhri, Abhinav Pandey, Abhishek Kadian, Ahmad Al-Dahle, Aiesha Letman, Akhil Mathur, Alan Schelten, Alex Vaughan, al. The Ilama 3 herd of models. arXiv e-prints, pages 2xXiv22477,200
[8] Roger Grosse, Juhan Bae, Cem Anil, Nelson Elhage, Alex Tamkin, Amirhossein Tajdini, Benoit Steiner, Dustin Li, Esin Durmus, and Ethan Perez. Studying large language model generalization with influence functions. arXiv preprint arXiv:2308..m 03399, 2023.
[9] Daya Guo, Dejian Yang, Haowei Zhang, Junxiao Song, Ruoyu Zhang, Runxin Xu, Qihao Zhu, Shirong Ma, Peiyi Wang. Xiao Bi, et Deepseek-rl: Incentivizing reasoning capability in Iims via reinforcement learning. arXiv preprint arXiv:2501.12945 2025.
[10] Dan Hendrycks, Steven Basart, Saurav Kadavath, Mantas Mazeika, Akul Arora, Ethan Guo, Collin Burns, Samir Puranik, Horace He, Dawn Song, et al. Measuring coding challenge competence with apps. In Thirty-fifth Conference on Neural Information Processing Systems Datasets and Benchmurks Track (Round 2),
[11] Dan Hendrycks, Collin Burns, Saurav Kadavath, Akul Arora, Steven Basart, Eric Tang, Dawn Song, and Jacob Steinhardt. Measuring mathematical problem solving with the math dataset. In Thirty-fffth Conference on Neural Information Prucessing Systems Datasets and Benchmarks Track (Round 2),-
[12] Jie Huang and Kevin Chen-Chuan Chang. Towards reasoning in large language models: A survey. arXiv preprini 2rXiv:22/2..1044 2022.
[13] Zhen Huang, Haoyang Zou, Xuefeng Li, Yixiu Liu, Yuxiang Zheng, Ethan Chern, Shijie Xia, Yiwei Qin, Weizhe Yuan, and Pengfei Liu. O1 replication journey-part 2: Surpassing ol -rreview through simple distillation, big progress or bitter lesson? arXiv preprint arXiv:241 16489, 2024.
10

---

[14] Andrew Ilyas, Sung Min Park, Logan Engstrom, Guillaume Leclerc, and Aleksander Madry. Datamodels: Understanding predictions with data and data with predictions. In International Conference Machine Learning, pages 9525-9587. PMLR, 2022.
[15] Aaron Jaech, Adam Kalai, Adam Lerer, Adam Richardson, Ahmed BI-Kishky, Aiden Low, Alec Helyar, Aleksander Madry, Alex Beutel, Alex Carney, et al. Openai ol system card. arXiv preprini arXiv:2412. 2024.
[16] Naman Jain, King Han, Alex Gu, Wen-Ding Li, Fanjia Yan, Tianjun Zhang, Sida Wang. Ar- mando Selar-Lezama, Koushik Sen, and Ion Stoica. Livecodebench: Holistic and contamination free evaluation of large language models for code. In The Thirteenth International Conference on Learning Representations, 2021.
[17] Pang Wei Koh and Percy Liang. Understanding black-box predictions via influence functions. In International conference on machine learning, pages 1885-1894, PMLR, 2017.
[18] Komal Kumar, Tajamul Ashraf, Omkar Thawakar. Rao Muhammad Anwer, Hisham Cholakkal, Mubarak Shah, Ming-Hsuan Yang, Phillip HS Torr, Fahad Shahbaz Khan, and Salman Khan. Llm post-training: A deep dive into reasoning large language models. arXiv preprint arXiv:2502.21322, 2025.
[19] Nathan Lambert, Jacob Morrison, Valentina Pyatkin, Shengyi Huang, Hamish Ivison, Faeze Brahman, Lester James Miranda, Alisa Liu, Nouha Dziri, Shane Lyu, et al. T ulu 3: Pushing frontiers in open language model post-training. arXiv preprint arXiv: 1./1221 2024.
[20] Jia Li, Edward Beeching, Lewis Tunstall, Ben Lipkin, Roman Soletskyi, Shengyi Huang, Kashif Rasul, Longhui Yu, Albert Q Jiang, Ziju Shen, et al. Numinamath: The largest public dataset in ai4maths with 860k pairs of competition math problems and solutions. Hugging Face repository, 13:9, 2024.
[21] Junlong Li, Daya Guo, Dejian Yang, Runxin Xu, Yu Wu, and Junxian He. Codei/o: Condensing reasoning patterns via code input-output prediction. arXiv preprint 2Xix:2502.00316. 2025.
[22] Robert F Ling, Residuals and influence in regression, 1984.
[23] Yingqian Min, Zhipeng Chen, Jinhao Jiang. Jie Chen, Jia Deng, Yiwen Hu, Yiru Tang, Jiapeng Wang, Xiaoxue Cheng, Huatong Song, et al. Imitate, explore, and self-improve: A reproduction report on slow-thinking reasoning systems. arXiv preprint arXiv:2412.09411 12.0441,,, 2024.
[24] Niklas Muennighoff, Zitong Yang, Weijia Shi, Xiang Lisa Li, Fei-Fei, Hannaneh Hajishirzi, Luke Zettlemoyer, Percy Liang, Emmanuel Candès, and Tatsunori Hashimoto. sl: Simple test-time scaling. arXiv preprint arXiv:2501.1939; 2025.
[25] NovaSky. Sky-tl: Train your own ol preview model, 2024. URL https::/
[26] OpenAL. Gpt-3.5-turbo. Technical report, OpenAL, 2022.
[27] Garima Pruthi, Frederick Liu, Satyen Kale, and Mukund Sundararajan. Estimating training data influence by tracing gradient descent. Advances in Neural Information Processing Systems, 33: 19920-199300 2020.
[28) Shuofei Qiao, Yixin Ou, Ningyu Zhang, Xiang Chen, Yunzhi Yao, Shumin Deng, Chuanqi Tan, Fei Huang, and Huajun Chen. Reasoning with language model prompting: A survey. arXiv preprint 1iXXi::2222.09009 2022.
[29] Yiwei Qin, Xuefeng Li, Haoyang Zou. Yixiu Liu, Shijie Xia, Zhen Huang, Yixin Ye, Weizhe Yuan, Hector Liu, Yuanzhi Li, et al. Ol replication journey: A strategic progress report-part 1. arXiv preprint arXiv:2410. 18982, 2024.
[30] Laura Ruis, Maximilian Mozes, Juhan Bae, Siddhartha Rao Kamalakara, Dwarak Talupuru, Acyr Locatelli, Robert Kirk, Tim Rocktäschel, Edward Grefenstette, and Max Bartolo. Pro- cedural knowledge pretraining drives reasoning large language models. arXiv preprint arXiv:2411.12588 2024.
11

---

[31] Lloyd S Shapley et al. A value for n-person games. 1953.
[32] Yang Sui, Yu-Neng Chuang, Guanchu Wang, Jiamu Zhang, Tianyi Zhang, Jiayi Yuan, Hongyi Liu, Andrew Wen, Hanjie Chen, Xia Hu, et al. Stop overthinking: A survey on efficient reasoning for large language models. arXiv preprint arXiv:2503. 16419, 2025.
[33] Yuxiang Wei, Zhe Wang, Jiawei Liu, Yifeng Ding, and Lingming Zhang. Magicoder: Em- powering code generation with oss-instruct. Proceedings of Machine Learning Research, 235: 52632-52657, 2024.
[34] Liang Wen, Yunke Cai, Fenrui Xiao, Xin He, Qi An, Zhenyu Duan, Yimin Du, Junchen Liu, Lifu Tang, Xiaowei Lv, et al. Light-rl: Curriculum sft, dpo and rl for long cot from scratch and beyond. arXiv preprint arXiv:2503. 10460, 2025.
[35] Violet Xiang, Charlie Snell, Kanishk Gandhi, Alon Albalak, Anikait Singh, Chase Blagden, Duy Phung, Rafael Rafailov, Nathan Lile, Dakota Mahan, et al. Towards system 2 reasoning in lims: Learning how think with meta chain-of-thouge arXiv preprint arXiv:2501 .04682, 2025.
[36] An Yang. Baosong Yang. Beichen Zhang, Binyuan Hui, Bo Zheng, Bowen Yu, Chengyuan Li, Dayiheng Liu, Fei Huang, Haoran Wei, et al. Qwen2. 5 technical report. arXiv preprint arXiv:24/2.14 15115, 2024.
[37] Yixin Ye, Zhen Huang, Yang Xiao, Ethan Chern, Shijie Xia, and Pengfei Liu. Limo: Less is more for reasoning. arXiv preprini arXiv:2502.03387, 2025.
[38] Chih-Kuan Yeh, Joon Kim, Ian En-Hsu Yen, and Pradeep K Ravikumar. Representer point selection for explaining deep neural networks. Advances in neural information processing systems, 31, 2018.
[39] Longhui Yu, Weisen Jiang, Han Shi, Jincheng Yu, Zhengying Liu, Yu Zhang, James T Kwok, Zhenguo Li, Adrian Weller, and Weiyang Liu. Metamath: Bootstrap your own mathematical questions for large language models. arXiv preprint arXiv:2309.12233 2023.
[40] Xiang Yue, Xingwei Qu, Ge Zhang, Yao Fu, Wenhao Huang, Huan Sun, Yu Su, and Wenhu Chen. Mammoth: Building math generalist models through hybrid instruction tuning. arXiv preprint arXiv:2309.05560 2023.
[41] Xinlu Zhang, Zhiyu Zoey Chen, Xi Ye, Xianjun Yang, Lichang Chen, William Yang Wang, and Linda Ruth Petzold. Unveiling the impact of coding data instruction fine-tuning on large language models reasoning. In Proceedings of the AAAI Conference on Artificial Intelligence. volume 39, pages 139499259957 2025.
12

---

mosth cuide
math coda
Lagurthaste
12
12-
2000
4.000
80.0
8000
1.0000
2000
4000
8000
8000
10000
Inddex
Indwx
with top Influence
(b)
top Influssace scorus on
Figure 8: Cross-domain influence analysis of Dwwn2.5-7B-Insteen fine-tuned on Bespoke-Strarce 17k dataset for math and code reasoning performance.
A Derivation of Influence Score
Given the influence of 2m on model parameters
d0
Ie (=m)
H
VeL (Zm, 0),
de
1==0
we can obtain its influence on function of parameters S(0) by applying the chain rule for derivatives:
(f
If (Zm)
de
e=0
=Vo((0) d0 de c-
(10)
--Vof(0)' Voo(E 0).
B Cross Domain Influence Analysis in Long CoT Scenarios
In this section, provide additional instance-level attribution experiment on long CoT reasoning scenarios. We fine-tune Qwen2.5-7B-Nnl InI-trct on Bespoke-Stratee Stratos- reasoning dataset. As shown in Figure(ja). the most influential samples for improving math performance predominantly from the math domain, but the samples from code domain are also significant. In Figure B(b, there is similar pattern of cross-domain benefit. This is consistent with the conclusions obtained in the experimental section?
C Robustness on
In this section, we evaluate the robustness of the influence function estimates with respect to the size of the correct sub- fine-tune the LLaMA3-8B-BAL model on mixed training corpus comprising MetaMathQA and OSS-IIntruce and compute influence scores on the math and code performance. We calculate the Pearson correlation between the rankings of training examples induced by influ- ence scores using varying values of using 100 as the reference. Results in Table 3 shows the robustness of for influence scores estimation.
Table 3: Pearson correlation coef-
ficient of rankings on training data across different choices of n, indicat- ing stable influence estimation.
D uommect Specifically,
10
25
50
100
Math
0.52
0.60
0.70
1.0
Code 0.51
0.62
0.60
1.0
13

---

query
The operalion @ is defined for non zero numbers as o&b value of ((1 -1/001111))))))
Determine the
A
B.
C.0
D.
answer
answer
Okay, let figure out this problem.
Okay, lnt me try Sigure out this problem.
(..hhin of Thought)
(..CCnin Thought)
but let think The openatoo defined anrall
don't have any issues zaro here, 760 ls 4r3, which fine, and then (6144)) is 314, Corret.
by
Walt, but me think again. The openatoo is defined for nonzero numberr, so don't have issues with division Conrect
283
((14/3) 3rd.
A Alternatively mayhe there's a different way to approach the problem? Let me tyy expanding both expressions using
"inal Azswer* (boaed[A]
varaabes see if there's
Finalal A Ansver** (Aorod(A)
To assess whether the exploration behavior has a positive or negative impact, we use GPT-4o truncate all exploration behaviors in the BS-17K dataset for SFT. If reasoning contains any searching for another approach after reaching correct answers, like "Aternattivll,, maybe there's different way to approach the problem?", the exploration content will be truncated.
Figure 9:
D Case of Truncating Exploration Behavior
To evaluate the impact of exploration behaviors in reasoning processes, we systematically truncate exploratory content from the BS-17K during SFT. Specifically, any post-correct-ansee exploration (e.g.. "Alternatively, maybe there's different way to approach the problem?") is removed to isolate the core problem-solving trajectory, shown in Figure 9
E Examples for Reasoning Behaviors Classifier
The five cases below show the prompts of five behaviors on reasoning performance and the corre- sponding answers. As shown in Figure I0 and II the prompts include task description, examples of each reasoning behavior, task format, etc.
14

---

Exploration
Verification
Pronpe:
Prompt:
Descripzon
Task Description
You will be provided with text from the intemet.
You providod text from the internet.
Evalunte whether the text continn any "searching for another uppeoach afher rosching cornect anowerd" behevior, where the urier renches correct
Evaluste whether the test contains any va vallication stepe. We want to misk isstanees where the water explictlly checks their own work, such by companing the result
explore perpectives This a type cognttive behavior that reflects intelectual curiesity or soeking mulliple strnegies even after sulving the problem.
sativfictory solution, but explicilly
value checking the result of calculation.
Verillcation steps in mathematies might look like:
"Let's check our answer et by substituting x 3 back inso the original equation."
This Hacktracking,
"To verify this
I'll differemiiate the untierivative and confirm matches
wrttrr changes method becouse current one does not
the original function.
work or is incocsplete.
"Lel's test our fonnuls
simple cose: when n- I, we get QU)- which
Verificntion, where the urite checks the cocrectness of method without
manches our expected result"
altetpping diflevent
"To this solution valid, 1Ill check if satisfies all the given constrinns."
Examples of this behavior include:
you any verification steps, please coust and provide count betwoos
"But let me just think agsin if there's snother way to approsch this." "motthrr way to look this is...
the tags <count> ciccunt>. If the text does not contain any vesificttinn steps, plaase provide count of as co/eun--/ccumn>..
way get
New see
it using
peoeutrry"
Task Format
"A Allemmatively, mayhe thac's a different way to arpreach the problem!
Format your response in markdown as follows:
Count the number of distinct backtracking instances and provide the count between exploration, please provide
<lcounts.
AP Thoughts
of as seount-f-losutt>
[Rriff description descriting what behaviar naticad and verification may have occurred)
rlask Format
Format your response maridown follows:
AP Dozs verificttion?? [yosino]
#hThoughts
[Driet description describing what behavior was noticed and where expleration occurred]
Ab Number of inower ferttiiciion staps scmant> [1/2/..] sicount>
4ADoes explontion thinking? Iyssino]
Task to Verification (response)
HNNumber explonaiion thinking steps <coust> [1/21..] silooutt
Respouse
TTask to evaluate for exploration (response)
*Response
Anrver:
Thoughts
Thoughts
The writer explores mukriple ways to appreach the problem proving that polynomial. After instally considering properties polynomials and given conditions, writer consinues explore different methods and persectives, such as using finite aiffermmnes, induction, and theorems about integrevallud polynomials The writer dves not at the first catisfactory appoacc but contimes question and explore funther, indicaring behavior of seeking alternative methods even after reaching correct sarisfactory solution.
The proviled test is detailed explonation of mathematical probleu involving sequenes and polynomials. The uriter discusees varions appeoaches and theoeems that could polysomial. However, the text not explicilly check any calculation or results against known values or resventy any steps taken is the reasoning process.
sequesee salisfying conditions
prove sequeres satisfying
conditions
vertfiation?
no
Does altemative thinking?
ha
yes
Number of verification stops
tt
Sormnt O </coume>
Number alsemative thinking
Scount- cieeent>
Figure 10: Left: Exploration: When performing reasoning, seeking alternative approaches after reaching a correct answer. We capture this behavior and calculate the number of exploration steps by analyzing the content like "Another way to look at this is..." etc.. Right: Verification: The behavior of reasoning from desired outcomes to initial inputs when performing reasoning. We capture and calculate the number of backward chaining instances by finding the content like "To solve this equation, let's s start with what we want to prove" etc..
15

---

Backtracking
Buckward Chaining
Prompi:
Prompt:
Task Deseription
Task Description
You provided with text
internet.
will be provided with the internet.
Evalunte whether the text contains any backtrackngg behavier, where the writer back try different apprusch.
Evaluase whether the text contains any backward chaining bohavior, where the writer weeking towards goal but starts from the pool and works backward.
realizes puth won't work and explicilly An example of backtracking is: "Let me try again', : "Wait", "I made mistake",
or "we need to try different sequence of opecations". We want to mark abandons thought buck a provious
Puckkard-chuiiing mathematies might look like:
instances computation.
prove: < Working backward, it's 4, then Sx + must be true. Let's verity this."
"Io solve this equation, let's with what
Backtracking in mathematicss might "I started with the wrong formula. Let's use integration by parts instead."
"If'
find function
derivaative
letss start with
desired result and work buckward.
"This approuch leuds contradiction. Going back the original equation..."
The derivative xf 3x + C' d'oulld give us 2x 3."
prove trinngle a right trinngle start by necuming the Pylhagoroan theurem holds (2" -aa b9 and check if our side lenthss satisfy this condition."
"I see the ertor in my colculation. Let's recoloulate using...
"This alychmic manipulation simplitying as expocted. Let's try factoring differently."
this optimization problem, know maximums value occars when the derivative equals zero. If we set f000 - and solve for x. we can find our critical points."
Count mumber of distinet hacktracking instances provide the owant
between the logss Spounds s/counts. the writer does not backtrack, please proside
"To determine the initial velacity. know the ball reaches height of 20 meters, Working backward from this firal state wing the kinematic equation initial velocity v."
<comm--0-iconnt
0.5gtt, solve
Task Format
Formal your response markdown follows:
Count the number distinet backward-hhainnng instanees and provide count between the tags "<counr"> </count>' If the reasoning does not contain any hickward-chhiinng hchovior, provide count of (1 as <coonnt-Or/emmtt>
ve Thoughts
[Brief descripiion describing what behavior was noticed where backracking sccurval]
Task Format
Format your response in markdown follows:
et Does backtrack? [yesino]
AY Thoughts
[Brief deseription of the observed behavior and where backward chaining may have occureed)
es Number of backtrack steps
<ooumP <icuuii>
the text exhibit backward chaining? [yes/no]
Task evallsate for backtracking (response)
#f Number backward chaining instances
Resposse
<pouni [1/2/... siloumi>
Task to evaluate for bookward chaining (response)
Respouse
Answer:
Anywer:
Hit
Thoughts
Thoughts
The writer initially explores the problem by considering the ponditions given trynng connect them known properties of polynomials. They then realize that thair initial spproach might not leading to solution and start consider alternatvve methods, such as using the method of finite differences, induction, and other propertics polyneminils. reconsidering their approach maltiple times, indicating backtracking behavior.
The provided text does not exhibit backward chaining behavice. The writer attempting prove a statement about sequence of integers satistying certain conditions,
reasoning is forwaré-looking starting from the given conditiens and working towards a conelusion. The writer explores various mathematical concepts and tienrems understand the problem and does start from gosl and work backward.
writer explicilly meniios
Does backtrack?
Does the text exhibit backward chaining?
yes
by
Number of bucktteek steps
Number of backoward chaining instances
Sommtt> 4 Stounnt>
<count- <icount>
Figure 11: Left: Backtracking: The behavior of realizing path won't t work and explicitly going back to try a different approach. We capture this behavior and calculate the number of backtracking steps by finding the content like "This approach leads to a contradiction. Going back to the original cquation..." etc.. Right: Backward Chaining: The behavior of systematic error-checking when performing reasoning. We capture and calculate the number of backward chaining instances by finding the content like "To ensure this solution is valid, I'll check if it satisfies all the given constraints." etc..
16

---

NeurIPS Paper Checklist
Claims
Question: Do the main claims made in the abstract and introduction accurately reflect the paper's contributions and scope?
Answer: [Yes]
Justification: See Section D
Guidelines:
The answer NA means that the abstract and introduction do not include the claims made in the paper.
The abstract and/or introduction should clearly state the claims made, including the contributions made in the paper and important assumptions and limitations. A No or
NA answer to this question will not perceived well by the reviewers.
The claims made should match theoretical and experimental results, and reflect how much the results be expected to generalize other settings.
is fine include aspirational goals as motivation as long is clear that these goals are not attained by the paper.
2. Limitations
Question: Does the paper discuss the limitations of the work performed by the authors?
Answer: [Yes]
Justification: Please check Section S
Guidelines:
The answer NA means that the paper has no limitation while the answer No means that the paper has limitations, but those not discussed in the paper.
The authors are encouraged to create separate "Limitations" section in their paper.
The paper should point out any strong assumptions and how robust the results are to violations of these assumptions (e.g., independence assumptions, noiseless settings, model well-specification. asymptotic approximations only holding locally). The authors should reflect how these assumptions might be violated in practice and what the implications would be.
The authors should reflect on the scope of the claims made, e.g., if the approach was only tested on few datasets or with few runs. In general, empirical results often depend on implicit assumptions, which should be articulated.
The authors should reflect the factors that influence the performance of the approach. For example, facial recognition algorithm may perform poorly when image resolution low images are taken in low lighting. Or speech-to-text system might be used reliably to provide closed captions for online lectures because it fails to handle technical jargon.
The authors should discuss the computational efficiency of the proposed algorithms and how they scale with dataset size.
If applicable, the authors should discuss possible limitations of their approach address problems of privacy and faimess.
While the authors might fear that complete honesty about limitations might be used by reviewers as grounds for rejection, a worse outcome might be that reviewers discover limitations that aren't 't acknowledged in the paper. The authors should use their best judgment and recognize that individual actions in favor of transparency play an impor- tant role in developing norms that preserve the integrity of the community. Reviewers will be specifically instructed to not penalize honesty concerning limitations.
3. Theory assumptions and proofs
Question:
For each theoretical result, does the paper provide the full set of assumptions and complete (and correct) proof?
Answer: [Yes]
17

---

Justification:
Please check Section 3.1 and Appendix A
Guidelines:
The answer NA means that the paper does not include theoretical results.
All the theorems, formulas, and proofs in the paper should be numbered and cross- referenced.
All assumptions should be clearly stated referenced in the statement of any theorems.
The proofs can either appear in the main paper or the supplemental material, but they appear in the supplemental material, the authors are encouraged to provide short proof sketch provide intuition.
Inversely, any informal proof provided in the core of the paper should be complemented by formal proofs provided in appendix or supplemental material.
Theorems and Lemmas that the proof relies upon should be properly referenced.
4. Experimental result reproducibility
Question: Does the paper fully disclose all the information needed to reproduce the main ex- perimental results of the paper to the extent that affects the main claims and/or conclusions of the paper (regardless whether the code and data are provided or not)?
Answer: [Yes]
Justification: Please check the supplemental material.
Guidelines:
The answer NA means that the paper does not include experiments.
If the paper includes experiments, a No answer to this question will not be perceived well by the reviewers: Making the paper reproducible is important, regardless of whether the code and data are provided or not.
If the contribution is dataset and/or model, the authors should describe the steps taken to make their results reproducible or verifiable.
Depending on the contribution, reproducibility can be accomplished in various ways. For example, if the contribution is a novel architecture, describing the architecture fully might suffice, or if the contribution is a specific model and empirical evaluation, it may be necessary to either make possible for others to replicate the model with the same dataset, or provide access to the model. In general. releasing code and data is often one good way accomplish this, but reproducibility can also be provided via detailed instructions for how to replicate the results, access to a hosted model (e.g.. in the case of large language model), releasing of a model checkpoint, or other means that are appropriate to the research performed.
While NeurIPS does not require releasing code, the conference does require all submis- sions to provide some reasonable avenue for reproducibility, which may depend on the nature of the contribution. For example
(a) If the contribution is primarily a new algorithm, the paper should make clear how to reproduce that algorithm. (b) the contribution is primarily a new model architecture, the paper should describe the architccture clearly and fully.
(c) If the contribution is new model (e.g., a large language model), then there should either way to access this model for reproducing the results or way to reproduce the model (e.g., with an open-source dataset instructions for how to construct the dataset).
(d) We recognize that reproducibility may be tricky in some cases, in which case authors are welcome to describe the particular way they provide for reprodueibility. the case of closed-source models, may be that access to the model is limited in some way (e.g., to registered users), but it should be possible for other researchers have some path to reproducing or verifying the results.
5. Open access to data and code
Question: Does the paper provide open access to the data and code, with sufficient instruc- tions to faithfully reproduce the main experimental results, as described in supplemental material?
18

---

Answer: [Yes]
Justification:
We will provide the open access to the data and code in supplemental material.
Guidelines:
The answer NA means that paper does not include experiments requiring code.
Please see the NeurIPS code and data submission guidelines (https://nips.cm cc/
for more details.
While we encourage the release of code and data, we understand that this might not be possible, "No" is an acceptable answer. Papers cannot be rejected simply for not including code, unless this is central to the contribution (c.g., for new open-source benchmark).
The instructions should contain the exact command and environment needed to run to reproduce the results. See the NeurIPS code and data submission guidelines (https guwdes/ddeeeeee Cooeeeoodeesssseeeeee 7/nips.com / swiniiiiicypyyy for more details.
The authors should provide instructions on data access and preparation, including how to access the raw data, preprocessed data, intermediate data, and generated data, etc.
The authors should provide scripts to reproduce all experimental results for the new proposed method and baselines. If only subset of experiments are reproducible, they should state which ones are omitted from the script and why.
At submission time, to preserve anonymity, the authors should release anonymized versions (if applicable).
Providing as much information as possible supplemental material (appended the paper) is recommended, but including URLs to data and code is permitted.
6. Experimental setting/details
Does the paper specify all the training and test details (c.g., data splits, hyper- parameters, how they were chosen, type of optimizer, etc.) necessary understand the results?
Question:
Answer: [Yes]
Justification: Please check Section 4.1
Guidelines:
The answer NA means that the paper does not include experiments.
The experimental setting should be presented in the core the paper to a level of detail that is necessary appreciate the results and make sense of them.
The full details can be provided either with the code, appendix, as supplemental material.
7. Experiment statistical significance
Question: Does the paper report error bars suitably and correctly defined or other appropriate information about the statistical significance of the experiments?
Answer: [No]
Justification: sources.
We just conduct experiment once due to the limited computational re-
Guidelines:
The answer NA means that the paper does not include experiments.
The authors should answer "Yes" if the results are accompanied by error bars, confi- dence intervals, statistical significance tests, least for the experiments that support the main claims of the paper.
The factors of variability that the enror bars are capturing should be clearly stated (for example, train/test split, initialization, random drawing of some parameter, or overall with given experimental conditions).
The method for calculating the error bars should be explained (closed form formula, call to a library function, bootstrap, etc.)
The assumptions made should be given (e.g., Normally distributed errors).
19

---

It should be clear whether the error bar is the standard deviation or the standard error of the mean.
is OK to report 1-sigma error bars, but one should state it. The authors should preferably report a 2-sigma error bar than state that they have 96% CI, if the hypothesis of Normality of errors is not verified.
For asymmetric distributions, the authors should be careful not to show in tables figures symmetric error bars that would yield results that are out range (e.g. negative error rates).
If error bars are reported in tables or plots, The authors should explain the text how they were calculated and reference the corresponding figures tables in the text.
8. Experiments compute resources
For each experiment, does the paper provide sufficient information on the com- puter resources (type of compute workers, memory, time of execution) needed to reproduce the experiments?
Question:
Answer: [Yes]
Justification: See Section
Guidelines:
The answer NA means that the paper does not include experiments.
The paper should indicate the type of compute workers CPU GPU, internal cluster, or cloud provider, including relevant memory and storage.
The paper should provide the amount of compute required for each of the individual experimental runs as well as estimate the total compute.
The paper should disclose whether the full research project required more compute than the experiments reported in the paper (e.g., preliminary or failed experiments that didn't 't make it into the paper).
9. Code of ethics
Does the research conducted in the paper conform, in every respect, with the NeurIPS Code of Ethics
Question:
Answer: [Yes]
Justification:
This work strictly follows the NeurlPS Code of Ethics.
Guidelines:
The answer NA means that the authors have reviewed the NeurIPS Code of Ethics.
If the authors answer No, they should explain the special circumstances that require deviation from the Code of Ethics.
The authors should make sure to preserve anonymity (e.g., there a special consid- eration due to laws or regulations in their jurisdiction).
10. Broader impacts
Question: Does the paper discuss both potential positive societal impacts and negative societal impacts of the work performed?
Answer: [NA]
Justification: There is no societal impact of the work performed.
Guidelines:
The answer NA means that there no societal impact of the work performed.
If the authors answer NA or No. they should explain why their work has no socictal impact why the paper does not address societal impact.
Examples of negative societal impacts include potential malicious or unintended uses (e.g., disinformation, generating fake profiles, surveillance), fairness considerations (e.g., deployment of technologies that could make decisions that unfairly impact specific groups), privacy considerations, and security considerations.
20

---

The conference expects that many papers will be foundational research and not tied to particular applications, let alone deployments. However, if there is direct path to any negative applications, the authors should point it out. For example, it is legitimate to point out that an improvement in the quality of generative models could be used to generate deepfakes for disinformation. On the other hand, it is not needed to point out that a generic algorithm for optimizing neural networks could enable people to train models that generate Deepfakes faster.
The authors should consider possible harms that could arise when the technology is being used as intended and functioning correctly, harms that could arise when the technology being used as intended but gives incorrect results, and harms following from (intentional or unintentional) misuse of the technology.
If there are negative societal impacts, the authors could also discuss possible mitigation strategies (e.g., gated release of models, providing defenses in addition attacks, mechanisms for monitoring misuse, mechanisms to monitor how system learns from feedback over time, improving the efficiency and accessibility ML).
11. Safeguards
Does the paper describe safeguards that have been put in place for responsible release of data or models that have a high risk for misuse (e.g., pretrained language models, image generators, scraped datasets)?
Question:
Answer: [NA]
Justification: The paper poses no such risks.
Guidelines:
The answer NA means that the paper poses no such risks.
Released models that have high risk for misuse or dual-use should be released with necessary safeguards to allow for controlled use of the model, for example by requiring that users adhere to usage guidelines or restrictions to access the model or implementing safety filters.
Datasets that have been scraped from the Internet could pose safety risks. The authors should describe how they avoided releasing unsafe images.
We recognize that providing effective safeguards is challenging, and many papers do not require this, but we encourage authors to take this into account and make best faith effort.
12. Licenses for existing assets
Question: Are the creators or original owners of assets (e.g.. code, data, models), used in the paper. properly credited and are the license and terms of use explicitly mentioned and properly respected?
Answer: [Yes]
Justification: All third- third-party assets used in this work are properly credited, and their licenses and terms of use explicitly cited and followed.
Guidelines:
The answer NA means that the paper does not use existing assets.
The authors should cite the original paper that produced the code package dataset.
The authors should state which version of the asset is used and, if possible, include URL.
The name of the license (c.g., CC-BY 4.0) should be included for each asset.
For scraped data from a particular source (e.g., website), the copyright and terms of service of that source should be provided.
If assets are released, the license, copyright information, and terms of use in the Datasets.papersstt paperswi thcode. cww/ datasets package should be provided. For popular datasets,
has curated licenses for some datasets. Their licensing guide can help determine the license of dataset.
For existing datasets that are re-packaged, both the original license and the license of the derived asset (if it has changed) should be provided.
21

---

If this information is not available online, the authors are encouraged to reach out to the asset's creators.
13. New assets
Question: Are new assets introduced in the paper well documented and is the documentation provided alongside the assets?
Answer: [Yes]
Justification: Please check the supplemental material.
Guidelines:
The answer NA means that the paper does not release new assets.
Researchers should communicate the details of the dataset/code/mmoel as part of their submissions via structured templates. This includes details about training, license, limitations, etc.
The paper should discuss whether and how consent obtained from people whose asset is used.
At submission time, remember to anonymize your assets (if applicable). You can either create an anonymized URL or include an anonymized zip file.
14. Crowdsoureing and research with human subjects
Question: For crowdsourcing experiments and research with human subjects, does the paper include the full text of instructions given to participants and screenshots, if applicable, as well details about compensation (if any)?
Answer: [NA]
Justification: This paper does not involve crowdsourcing nor research with human subjects.
Guidelines:
The answer NA means that the paper does not involve crowdsourcing nor research with human subjects.
Including this information in the supplemental material is fine, but if the main contribu- tion of the paper involves human subjects, then as much detail as possible should be included the main paper.
According the NeurIPS Code of Ethics, workers involved in data collection, curation, or other labor should be paid at least the minimum wage in the country of the data collector.
15. Institutional review board (IRB) approvals or equivalent for research with human subjects
Question:
Does the paper describe potential risks incurred by study participants, whether such risks were disclosed to the subjects, and whether Institutional Review Board (IRB) approvals (or an equivalent approval/review based on the requirements of your country or institution) were obtained?
Answer: [NA]
Justification: This paper does not involve crowdsourcing nor research with human subjects.
Guidelines:
The answer NA means that the paper does not involve crowdsourcing nor research with human subjects.
Depending the country in which research is conducted, IRB approval (or equivalent) may be required for any human subjects research. If you obtained IRB approval, you should clearly state this in the paper.
We recognize that the procedures for this may vary significantly between institutions and locations, and expect authors to adhere to the NeurlPS Code of Ethics and the guidelines for their institution.
For initial submissions, do not include any information that would break anonymity (if applicable), such the institution conducting the review.
16. Declaration of LLM usage
22

---

Question: Does the paper describe the usage of LLMs if it is important, original, or non-standard component of the core methods this research? Note that if the LLM used only for writing, editing, or formatting purposes and does not impact the core methodology, scientific rigorousness, or originality of the research, declaration is not required.
Answer: [Yes]
Justification: Please check Section 3
Guidelines:
The answer NA means that the core method development in this research does not involve LLMs any important, original, non-standard components.
Please refer to our LLM policy hattps://neuripes /ttpaarrpp..cc//oooeeeeeee////// for what should or should not be described.
23


Reviews:
[{"review_id": "mORFdQy2Pc", "reviewer": "Reviewer_x5z4", "summary": "The paper uses influence functions to analyze which SFT examples cause reasoning abilities, focusing on math and coding.  It finds that difficult math examples improve both math and code reasoning, whereas easy code examples improves code reasoning.  This insight is used to re-construct the SFT dataset, to improve AIME and LiveCodeBench performance.  Furthermore, token-level attribution also reveals that \"exploration\" behavior stimulates general reasoning.", "questions": "- what was the reason that token-level attribution used gradients, whereas sequence-level attribution used ablation, and not just the sum of token-level attributions from gradients?\n- was normalizing the influence scores so that magnitude of the gradient is ignored, i.e. RelatIF, considered when doing the analysis?  I wonder if sequence length would correlate with influence, if there is not normalization.", "limitations": "None", "rating": 5, "confidence": 3, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": 3, "clarity": 3, "significance": 3, "originality": 2, "strengths_and_weaknesses": "Strengths\n- The analysis is important in that it fills a gap that needed to be filled, and at the example-level, confirming previous heuristics for constructing reasoning SFT data.\n- The paper does token-level analysis, which provides deeper qualitative insights to guide dataset construction, and at the sequence-level, finding counter-intuitive insight that \"exploration\" behavior can improve reasoning.\n\nWeaknesses\n- Method-wise, my understanding is that there was not significant novel innovation - the Anthropic influence functions paper already proposed token-level influence.", "was_revised": true, "final_justification": "Clarification that novelty is not in methods development, but application of existing methods, which other reviewers noted is of practical importance.", "rebuttal": "Thank you for the positive feedback and useful suggestions! We are glad you think our analysis is important in that it fills a gap that needed to be filled. We address your concerns point by point below.\n\n**Weakness:**  Method-wise, my understanding is that there was not significant novel innovation. \n\nThank you for your feedback. We would like to emphasize that **our main contribution lies in the novel application of influence functions to trace how training data during the SFT phase shapes LLM reasoning for the first time**, presenting key findings with substantial practical value, as acknowledged by Reviewer mqmh. Reviewer AwiZ also notes that we 'target an important problem and uncover multiple interesting findings'.\n\n**Q1:** What was the reason that token-level attribution used gradients, whereas sequence-level attribution used ablation, and not just the sum of token-level attributions from gradients?\n\n**Summing token-level attributions from gradients only treats the sequence in its role as a prediction target and ignores its function as input context** (see Equation 7) due to the AR nature. In contrast, sequence‑level attribution via ablation quantifies the effect of removing the sequence from training data, thereby capturing its contribution both as input and as target. Thank you for this question, and we will add this clarification to the revised version. \n\n**Q2:** Was normalizing the influence scores so that magnitude of the gradient is ignored, i.e. RelatIF, considered when doing the analysis? I wonder if sequence length would correlate with influence, if there is not normalization.\n\nThank you for raising this interesting question. First, we would like to clarify that influence scores, as defined in Equation  3, measure the effect on the model performance when a training sample is removed; accordingly, we do not normalize by gradient norm or sequence length, since the raw gradient magnitude itself may carry information about a sample’s impact. \n\nFurthermore, to investigate whether sequence length would correlate with influence, we compute the Spearman rank correlation between the original influence scores and those obtained after dividing by sequence length of 5000 samples, yielding ρ = 0.48. This indicates moderate correlation, which is consistent with findings in related works[1,2].  \n\n[1] The Impact of Reasoning Step Length on Large Language Models. https://arxiv.org/abs/2401.04925\n\n[2] LIMO: Less is More for Reasoning. https://arxiv.org/abs/2502.03387\n\nWe hope these reclarifications and explanations of our method in response to your initial concerns can convince you to increase your score."}, {"review_id": "al0aa49zsZ", "reviewer": "Reviewer_AwiZ", "summary": "This paper proposes the Infra framework, which uses influence functions to quantify the impact of training data on the mathematical and code reasoning capabilities of large language models (LLMs). The core findings include: high-difficulty mathematical data significantly improves code reasoning, and low-difficulty code data is most beneficial for code tasks; ’ searching for another approach after reaching correct answers’ in math reasoning traces benefits to both math and code reasoning; and Token-wise attribution analysis reveals distinct paradigms in math and code reasoning.", "questions": "First, my major concern is that using the influence function to assign weights to data samples is similar to data selection. Thus, there lacks the comparison (experimentally or just discussion) between this solution with different data selection methods [1, 2].\n\n[1] LESS: Selecting Influential Data for Targeted Instruction Tuning. ICML 24\n[2] SmallToLarge (S2L): Scalable Data Selection for Fine-tuning Large Language Models by Summarizing Training Trajectories of Small Models. NeurIPS 24\n\nThen, the influence function mainly relies on EK-FAC, which is not novel. The limitation of EK-FAC needs to be discussed.\n\nEven though multiple interesting findings have been reported, they come from one-time experiments run. As a study paper, the authors need to run the experiments multiple times and then conduct a statistical analysis for a rigorous results report.", "limitations": "yes", "rating": 4, "confidence": 4, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": 3, "clarity": 3, "significance": 2, "originality": 2, "strengths_and_weaknesses": "Strength:\n\n+ Target an important problem – analyzing how data samples affect the performance of LLMs from different levels, e.g., sequence level and token-level.\n+ Multiple interesting findings\n+ A new data reweighting strategy that can help build better fine-tuning datasets\n\nWeakness:\n\n- Lack of comparison with data selection methods\n- The proposed solution highly relies on EK-FAC, but lacks a limitation discussion of EK-FAC\n- The experimental results are not reported rigorously, and there is no statistical analysis.", "was_revised": true, "final_justification": "The response addressed most of my reviews.", "rebuttal": "Thank you for the feedback and useful suggestions! We are glad you thought our paper 'targeted an important problem and had multiple interesting findings'. We address your concerns point by point below.\n\n**W1 & Q1:** Lack of comparison (experimentally or just discussion) with data selection methods.\n\nThank you for your feedback. We would like to emphasize that our work is not for data selection, which seeks a minimal subset of training examples for efficient domain transfer. Rather, our primary goal is different: we employ influence functions to attribute model performance back to individual training examples, thereby revealing which data types drive cross-domain reasoning improvements, which can in turn inform the design of more effective data curation and mixture strategies. \n\nMoreover, **influence-based sequence/token-level analysis enables us to ask why certain samples or patterns are helpful—e.g., identifying specific reasoning patterns that correlate with high influence—which is difficult to achieve with data selection methods** like LESS[1] and S2L[2]. We argue that this analytical perspective offers complementary insights that could help guide future improvements in training data design.\n\n[1] LESS: Selecting Influential Data for Targeted Instruction Tuning. ICML 24\n\n[2] SmallToLarge (S2L): Scalable Data Selection for Fine-tuning Large Language Models by Summarizing Training Trajectories of Small Models. NeurIPS 24\n\n**W2 & Q2:** The influence function mainly relies on EK-FAC, which is not novel. The limitation of EK-FAC needs to be discussed.\n\nThanks for pointing this out. Computing the exact Hessian is intractable for LLMs due to prohibitive memory and computational requirements. Among available approximations, EK-FAC [1] has been shown to provide a good trade-off between computational efficiency and accuracy. Nevertheless, we acknowledge its limitations and will add this discussion to the revised version.\n  - **Block-Diagonal and Kronecker Factorization Assumptions.** It assumes that different layers are independent, ignoring inter-layer curvature interactions. Moreover, it assumes each layer’s Fisher block is exactly separable as a Kronecker product, which may poorly capture complex curvature. \n  - **Increased computation overhead than K-FAC.** EK‑FAC incurs approximately twice the computational cost compared to K‑FAC by forming and inverting two Kronecker factors and performing their eigendecompositions. \n\n[1] Fast Approximate Natural Gradient Descent in a Kronecker-factored Eigenbasis, NIPS 2018\n\n**W3 & Q3:** As a study paper, the authors need to run the experiments multiple times and then conduct a statistical analysis for a rigorous results report.\n\nWe would like to clarify that **the influence‑score computation (Equation 3) is entirely deterministic, and thus there is no randomness in the results related to influence scores**. For SFT results in Tables 1 and 2(b), we retrain models with two additional random seeds and report the resulting standard deviations (shown in parentheses) for robustness. These new results will be included in the revised version. Thank you for your suggestion. \n| Qwen2.5-Instruct-7B       | AIME24$\\uparrow$     | AIME25$\\uparrow$     | MATH500$\\uparrow$    | LiveCodeBench$\\uparrow$ |\n|---------------------------|------------|------------|------------|----------------|\n| Bespoke–Stratos–17k       | 10.0 (1.1) | 6.7 (0.9)  | 77.2 (0.2) | 33.8 (0.3)     |\n| Difficulty–Flipped        | 20.0 (1.8) | 16.7 (1.1) | 78.2 (0.1) | 35.3 (0.1)     |\n\n|               | MATH500$\\uparrow$    | LiveCodeBench$\\uparrow$ |\n|---------------|------------|----------------|\n| w/ Exp.       | 77.2 (0.2) | 33.8 (0.3)     |\n| w/o Exp.      | 73.8 (0.5) | 32.0 (0.1)     |\n\nGiven these clarifications and improvements to your initial concerns, we hope for your reconsideration in raising your score."}, {"review_id": "Mf5rhsqq40", "reviewer": "Reviewer_mqmh", "summary": "This paper delves into what types of data are beneficial for enhancing mathematical and code reasoning capabilities during the SFT (Supervised Fine-Tuning) stage. Specifically, the authors propose three levels of influence scores and utilize influence functions to investigate the relationship between training data and downstream performance. They arrive at four meaningful conclusions. Overall, the work is logically coherent, and the conclusions are persuasive and potentially of practical value.", "questions": "1. Do the authors offer any preliminary exploration or conclusions regarding the internal mechanisms of large language models (LLMs)?\n\n2. The conclusion of the paper seems somewhat rushed. Are there any additional key experiments or findings that should have been included?\n\n3. How was the design of the influence scores determined? What was the rationale behind this choice?\n\n4. Does replacing the Hessian matrix with the EK-FAC method compromise the reliability of the conclusions? Have the authors compared the impact of other alternatives on the final results?", "limitations": "N/A", "rating": 5, "confidence": 4, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": 3, "clarity": 3, "significance": 3, "originality": 3, "strengths_and_weaknesses": "Strengths:\n\n1. This work explores and explains the underlying mechanisms behind the success of language models and presents key findings with substantial practical value and guiding potential.\n\n2. The relatively comprehensive experiments provide strong support for the reliability of the conclusions.\n\n3. The paper follows a clear line of thought, has a well-structured logic, and is written in a way that is easy to understand.\n\nWeakness:\n\n1. The conclusions of this work are confined to the SFT stage, whereas it is widely acknowledged that the capabilities of large language models primarily stem from the pre-training phase. Merely exploring the sources of capability during the SFT stage may be far from sufficient. That said, I understand this limitation, as investigating the origins of model capabilities during pre-training is extremely complex and resource-intensive.\n\n2. The design of the influence scores appears to be overly intuitive, lacking the necessary theoretical or empirical justification to support the reasonableness of such a formulation.\n\n3. This paper examines the impact of data on model capabilities solely from the perspective of training data → performance, resulting in conclusions that remain relatively superficial. It lacks deeper investigation and understanding of the internal mechanisms of the model.", "was_revised": true, "final_justification": "I will maintain my initial positive rating because the work presents interesting conclusions and solid experiments, and the authors also provided valid rebuttals during the rebuttal.", "rebuttal": "Thank you for the positive feedback and useful suggestions! We address your concerns point by point below.\n\n**W1:** The conclusions of this work are limited to the SFT stage, while model capabilities largely stem from pre-training. Although this focus may be insufficient, the complexity and cost of analyzing pre-training make it understandable.\n\nThank you for your feedback. Indeed, it is widely acknowledged that the capabilities of LLMs are learned during pre‑training. However, it is widely recognized that the SFT phase is indispensable for unlocking and shaping those capabilities [1,2]. Thus, characterizing which properties of SFT data most effectively stimulate reasoning remains highly valuable. We acknowledge that  investigating the pre-training phase would be illuminating, but it is beyond the scope of this work due to its complexity and scale; we therefore propose such an investigation as important future work.\n\n[1] Towards Reasoning in Large Language Models: A Survey, ACL 2023\n\n[2] Octothinker: Mid-training incentivizes reinforcement learning scaling. arXiv:2506.20512\n\n**W2 & Q3:** The design of the influence scores lacks the necessary theoretical or empirical justification to support the reasonableness of such a formulation. What was the rationale behind the design of the influence scores?\n\nThe influence score formulation is grounded in well-established theoretical foundations. It originates from the work [1], which rigorously derives how the removal of a training example affects model parameters and, in turn, model predictions. This approach provides a principled framework for quantifying the impact of individual training samples on model behavior. \n\nIn our work, we design the influence scores by adopting the mean log-probabilities on the correct answers as the response function f, because this metric closely reflects the model's reasoning ability. We appreciate this question and will include these clarifications in the revised version.\n\n[1] Understanding Black-box Predictions via Influence Functions, ICML 2017\n\n**W3 & Q1:** This paper examines the impact of data on model capabilities solely from the perspective of training data → performance, lacking deeper investigation and understanding of the internal mechanisms of the model.\n\nOur primary focus is indeed on understanding how training data influences model performance, which we believe is both scientifically meaningful and practically valuable—especially for guiding data curation and mixture strategies. Reviewer AwiZ also noted that we 'target an important problem and uncover multiple interesting findings'. \n\nWhile we agree that probing the internal mechanisms of LLMs is important, it remains a highly challenging task due to the complexity and scale of these models. Nevertheless, our influence-based approach provides a potential pathway for such analysis. For instance, by decomposing the gradients involved in the influence computation, one could potentially attribute specific layers or modules within the model to reasoning performance. We consider this an interesting direction and leave it as future work.\n\n**Q2:** Are there any additional key experiments or findings that should have been included in the conclusion?\n\nWe would like to clarify that the current conclusion section has systematically summarized our key findings:\n  - Cross-domain examples—particularly high-difficulty math and low-difficulty code—enhance reasoning performance across domains.\n  - Sequence-level analysis reveals that exploratory behaviors in long CoT consistently improve performance, challenging assumptions that such behaviors are merely overthinking.\n  - Token-level analysis further uncovers domain-specific reasoning patterns between math and code.\n\n**Q4:** Does replacing the Hessian matrix with the EK-FAC method compromise the reliability of the conclusions? Have the authors compared the impact of other alternatives on the final results?\n\nThanks for pointing this out. Computing the exact Hessian is intractable for LLMs due to the prohibitive memory and computational costs. While K-FAC is a commonly used approximation, prior work has shown that it is less accurate than EK-FAC [1]. Moreover, EK-FAC has been shown to offer a good trade-off between computational efficiency and accuracy [1,2], which supports the reliability of our conclusions. Additionally, our SFT experiments (Table 1 & Table 2b) further validate the robustness of these findings.\n\n[1] Fast Approximate Natural Gradient Descent in a Kronecker-factored Eigenbasis, NIPS 2018\n\n[2] Studying Large Language Model Generalization with Influence Functions, arXiv:2308.03296"}, {"review_id": "M0XYljx0yg", "reviewer": "Reviewer_PJJ6", "summary": "This paper uses influence functions (EK-FAC) to quantify the influence between math and code training examples on math and code tasks. They find substantial cross-domain influence, where high-difficulty math examples improve both math and code reasoning, while low-difficulty code examples are beneficial for code reasoning. At the token level, logical connectors tend to be the most influential for math reasoning, while syntactic tokens tend to be most influential for code reasoning. They use these insights to tune Qwen models on more high-difficulty math examples (with low-difficulty code examples) to improve math and code reasoning performance.", "questions": "1. Is there a way to distinguish whether the observed influence scores are primarily driven by surface level similarities between examples (e.g. difficult math problems may tend to include similar words or phrases to one another and to coding examples), vs. more abstract \"procedural\" similarities (e.g. https://arxiv.org/abs/2411.12580)?\n2. Could the tuning results on the proposed \"Difficulty Flipped\" dataset be because that data has substantially more \"difficult\" problems overall than all the other comparison datasets (see Weaknesses)?\n3. Is there evidence that the high-difficulty math examples are highly influential because they contain important reasoning strategies that the model relies on for other math and code reasoning problems? Are there ways to characterize or classify these different reasoning strategies? More discussion and results on this point could make the paper more impactful (and improve my scores), because it would help clarify exactly why these types of examples are so important.", "limitations": "Yes", "rating": 4, "confidence": 4, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": 2, "clarity": 3, "significance": 2, "originality": 2, "strengths_and_weaknesses": "Strengths:\n1. Quantifying the relationship between math and code examples using influence functions has direct downstream implications for LLM fine-tuning, as performed in the paper.\n\nWeaknesses:\n1. The new method (\"Infra\") might have somewhat limited novelty. It seems very close to an implementation of previous influence approaches (specifically, EK-FAC; https://arxiv.org/abs/2308.03296, as cited in the paper). The main differences are slightly changing the response function f (although f is still essentially log-probabilities), and applying to new input/output examples.\n2. The tuning results on the proposed \"Difficulty Flipped\" dataset are not entirely convincing, because that data has substantially more \"difficult\" problems overall than all the other comparison datasets (Figure 5, right). It is somewhat expected that including more difficult problems in the last tuning phase would benefit performance.\n3. Other works have applied influence functions to LLMs for reasoning and/or mathematical tasks (e.g. https://arxiv.org/abs/2411.12580, https://arxiv.org/abs/2410.17413). These works have demonstrated that examples with similar semantic patterns (e.g. similar reasoning) are often influential, so cross-domain influence between math and code problems is not entirely surprising. More fine-grained breakdowns (e.g. annotating examples that exhibit similar reasoning strategies) could make the paper more informative, by isolating exactly why specific math and code examples influence one another.", "was_revised": true, "final_justification": "The author response has addressed several of my questions, and I have increased my overall score to 4.", "rebuttal": "Thank you for your attentive comments and useful suggestions! We are glad you thought our paper had direct downstream implications for LLM fine-tuning. We address your concerns point by point below.\n\n**W1:** The new method (\"Infra\") might have somewhat limited novelty. It seems very close to an implementation of previous influence approaches (specifically, EK-FAC; https://arxiv.org/abs/2308.03296, as cited in the paper). \n\nThank you for your feedback. We would like to emphasize that **our main contribution lies in the novel application of influence functions to trace how training data during the SFT phase shapes LLM reasoning for the first time**, presenting key findings with substantial practical value, as acknowledged by Reviewer mqmh.  Reviewer AwiZ also noted that we 'target an important problem and uncover multiple interesting findings', and Reviewer x5z4 praised our work for 'the analysis fills a critical gap that needed to be addressed'.\n\nFurthermore, unlike prior approaches, our work introduces **a fine-grained analysis**: sequence-level analysis reveals the counterintuitive insight that \"exploration\" behavior can enhance reasoning, while token-level analysis provides valuable insights into the interaction mechanisms between math and code training data.\n\n**W2 & Q2:**  It is somewhat expected that including more difficult problems in the last tuning phase would benefit performance. Could the tuning results on the proposed Difficulty Flipped dataset be because that data has substantially more difficult problems overall than all the other comparison datasets?\n\nIndeed, one of our key findings is that high-difficulty math examples improve both math and code reasoning, and therefore, the performance improvements observed in the Difficulty Flipped dataset can partly be attributed to the inclusion of more difficult math problems. \n\nThe reviewer mentioned the intuition that difficult problems may lead to better performance. This can be wrong in practice, e.g., for the code capacities. To validate this, **we conduct an ablation study on Qwen2.5-Instruct-7B, with both high-difficulty math and code samples for training. The results in the table below show a decline in coding performance compared to the proposed Difficulty Flipped dataset.** This may be due to the fact that easier code problems, with their clearer structural formats, are more effective for enhancing code reasoning, especially when integrated with math CoTs that already provide strong reasoning skills. \n\nThank you for pointing this out, and we will add this ablation result to the revised version.\n\n|                    | AIME24$\\uparrow$ | MATH500$\\uparrow$ | LiveCodeBench$\\uparrow$ |\n|--|--|--|--|\n| BS-17k                     | 10.0   | 77.2    | 33.8           |\n| Difficulty-Flipped (Hard Math + Easy Code) | 20.0 | 78.2 | 35.3 |\n| Hard Math + Hard Code      | 20.0   | 78.0    | 34.5           |\n\n**W3:** Other works have applied influence functions to LLMs for reasoning and/or mathematical tasks (e.g. https://arxiv.org/abs/2411.12580, https://arxiv.org/abs/2410.17413). More fine-grained breakdowns could make the paper more informative, by isolating exactly why specific math and code examples influence one another.\n\nThanks for pointing out this valuable direction for deeper interpretability of cross-domain influence. First, we would like to clarify that these works primarily focus on attributing LLM performance to pretraining data, whereas our work targets the SFT phase. We will include citations to these works in the revised version.\n\nRegarding more fine-grained breakdowns, as shown in our paper (Figure 3(a) and Figure 4), we find that **symbolic math problem-answer pairs introducing or solving for x are among the most beneficial for code-related tasks**. This may be because the process of reasoning with symbolic variables in math closely mirrors the patterns used in programming tasks.\n\nTo further explore long-CoT reasoning settings, we conduct a case study analyzing the top 20 math examples with the highest impact on LiveCodeBench performance. Our observations suggest that **the most influential math problems are predominantly symbolic manipulation tasks requiring equation rearrangement and factorization** (see some examples below), likely because they cultivate algebraic reasoning and variable isolation skills that are fundamental for implementing mathematical algorithms and debugging complex code expressions. We will include this in the revised version.\n\n```\nQuestion: If $b>1$, $x>0$, and $(2x)^{\\\\log_b 2}-(3x)^{\\\\log_b 3}=0$, then what is $x$?\nAnswer(partial): So, if I take \\\\( \\\\log_b \\\\) of both sides:\n\\\\( \\\\log_b \\\\left( (2x)^{\\\\log_b 2} \\\\right) = \\\\log_b \\\\left( (3x)^{\\\\log_b 3} \\\\right) \\\\).\nUsing the logarithm power rule, \\\\( \\\\log_b (a^c) = c \\\\cdot \\\\log_b a \\\\), so applying that here, the equation becomes:\n\\\\( \\\\log_b 2 \\\\cdot \\\\log_b (2x) = \\\\log_b 3 \\\\cdot \\\\log_b (3x)\n```\n```\nQuestion: If $x, y, z$ are reals such that $0\\\\le x, y, z \\\\le 1$, show that $\\\\frac{x}{y + z + 1} + \\\\frac{y}{z + x + 1} + \\\\frac{z}{x + y +  1} \\\\le 1 - (1 - x)(1 - y)(1 - z)$\nAnswer(partial): Let's denote S = x + y + z, P = xy + yz + zx, Q = xyz. Then RHS is S - P + Q.\nThe LHS is sum of x\\/(S - x + 1). Wait, because denominator for the term with x is y + z + 1 = (y + z) + 1 = (S - x) + 1. So LHS can be written as: Sum_{x} [x \\/ (S - x + 1)]. \n```\n\n**Q1:** Is there a way to distinguish whether the observed influence scores are primarily driven by surface-level similarities between examples, vs. more abstract \"procedural\" similarities (e.g. https://arxiv.org/abs/2411.12580)?\n\nThank you for raising this insightful question. To assess whether influence scores are primarily driven by surface-level similarities, we compute BERTScore[1] between each of the 100 AIME and MATH500 examples and their top-10 most influential training examples. BERTScore computes semantic similarity between tokens in a candidate sentence and a reference sentence using contextual embeddings, making it suitable for assessing surface-level overlap.\n\nWe report the maximum BERTScore(F1) among the top-10 influential examples for each target question (across 100 total targets) in the table below. Most maximum scores are around 0.65, suggesting that **the influence scores are unlikely to be dominated by superficial lexical overlap**, but more likely reflect abstract procedural patterns--consistent with findings in https://arxiv.org/abs/2411.12580.\n\n[1] BERTScore: Evaluating Text Generation with BERT, ICLR 2020\n|  | 1    | 2    | 3    | 4    | 5    | 6    | 7    | 8    | 9    | 10   |\n|-|-|-|-|-|-|-|-|-|-|-|\n|  max      | 0.62 | 0.65 | 0.58 | 0.7  | 0.68 | 0.6  | 0.55 | 0.61 | 0.68 | 0.63 |\n|  mean |  0.42 | 0.45 | 0.37 | 0.41 | 0.41 | 0.39 | 0.36 | 0.40 | 0.46 | 0.39 |\n\n**Q3:** Is there evidence that the high-difficulty math examples are highly influential because they contain important reasoning strategies that the model relies on for other math and code reasoning problems? Are there ways to characterize or classify these different reasoning strategies? More discussion and results on this point would help clarify exactly why these types of examples are so important.\n\nThank you for this interesting question for the deeper interpretation of why high-difficulty math examples are highly influential. To investigate this, we compare 100 high-difficulty examples with top influence scores and 100 low-difficulty examples with top influence scores. We observe that high‑difficulty samples consistently exhibit (1) **Knowledge Integration**, where solutions draw on concepts from multiple domains, and (2) **Strategy Diversity**, where diverse reasoning patterns are employed within a single solution. We use GPT-4o based annotation (prompt templates are shown below) to quantify these phenomena. As shown in the table below, both knowledge integration and strategy heterogeneity occur significantly more often in high‑difficulty examples, which likely underlies their better transferability and generalization to other reasoning problems.\n\n|     | High difficulty | Low difficulty |\n| - | -| - |\n| Knowledge Integration | 0.78 | 0.34 |\n| Strategy Diversity | 0.91 | 0.76 |\n\n```\n**Task Description**\nYou will be given a piece of text. Please evaluate whether this text exhibits knowledge integration. Knowledge integration occurs when multiple domains or disciplines of knowledge and strategies are combined to solve a problem effectively—for example, blending algebra, geometry, and probability in a single math solution. Look specifically for instances where the text weaves together concepts from different fields.\n**Examples**\n“To solve the variance problem, we first wrote down the expectation and second-moment formulas using probability theory, then applied algebraic manipulation to solve the resulting quadratic equation for p.”\n**Output Format**\n## Thoughts\n[Briefly note what you observed that indicates knowledge integration, and which disciplines or techniques are being combined.]\n\n## Does knowledge integration occur?\n[yes / no]\n```\n\n```\n**Task Description**\nYou will be given a piece of text. Please evaluate whether this text exhibits strategy diversity. Strategy diversity means using three or more distinct problem-solving methods or reasoning paths—such as decomposition, recursion, dynamic programming, greedy selection, etc.—within the same solution. Focus on spotting multiple, clearly different strategies being applied in tandem or in sequence.\n**Examples**\n“First we apply a divide-and-conquer approach to break the problem into subproblems, then we optimize each subproblem via dynamic programming.”\n**Output Format**\n## Thoughts\n[Briefly note what you observed that indicates strategy diversity, and which disciplines or techniques are being combined.]\n\n## Does strategy diversity occur?\n[yes / no]\n```\n\nGiven these improvements and additional experiments to your initial concerns, we hope you would like to raise your score."}]

Author rebuttal:

Meta-review: This paper examines how SFT data influences reasoning in LLMs, using influence functions to study both math and coding tasks. The work provides several interesting findings, such as the benefits of difficult math problems for cross-domain reasoning and the positive impact of exploratory reasoning traces. Reviewers appreciated the clear motivation, practical relevance, and the potential to guide dataset design. Concerns were raised about limited methodological novelty, missing comparisons to alternative data selection strategies, and the absence of stronger statistical validation. The rebuttal helped clarify some points and alleviated part of these concerns, though not all. Overall, despite some limitations, the paper offers timely insights into an important problem and I recommend acceptance.
Decision: Accept (poster)