arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2505.19949cs.LG
收藏

哪些数据属性激发数学和代码推理?基于影响函数的研究

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

Shanghai Jiao Tong University(上海交通大学)

Siqi Kou, Qingyuan Tian, Hanwen Xu, Zihao Zeng, Zhijie Deng

AI总结:

本研究利用影响函数归因LLM在数学和代码推理中的数据属性,发现高难度数学示例提升双领域推理,低难度代码任务利于代码推理,并通过翻转难度重加权数据,显著提升AIME24和LiveCodeBench准确率。

摘要:

大型语言模型(LLMs)在数学和编码方面展现了卓越的推理能力,这通常得益于在由更强模型生成的思维链(CoTs)上进行后训练。然而,现有的此类训练数据策展策略主要依赖启发式方法,限制了泛化能力,且未能捕捉数据中潜在的细微差别。为解决这些局限,我们利用影响函数系统地将LLMs在数学和编码上的推理能力归因于单个训练示例、序列和标记,从而深入洞察有效数据的特征。我们基于影响的推理归因(Infra)方法揭示了数学和编码任务间非平凡的跨领域效应:高难度数学示例同时提升数学和代码推理,而低难度代码任务最有效地促进代码推理。基于这些发现,我们引入了一种简单而有效的数据重加权策略,通过翻转任务难度,将Qwen2.5-7B-Instruct的AIME24准确率从10%翻倍至20%,并将LiveCodeBench准确率从33.8%提升至35.3%。此外,我们的细粒度归因揭示,序列级探索行为能增强数学和代码的推理性能,而标记级影响模式在数学和代码推理中有所不同:前者偏好自然语言逻辑连接词,后者强调结构语法。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑