arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2506.09820cs.CLcs.AIcs.LG
收藏

CoRT: 思考过程中代码集成的推理

CoRT: Code-integrated Reasoning within Thinking

University of Science and Technology of China(中国科学技术大学);Alibaba Inc.(阿里巴巴);The Chinese University of Hong Kong, Shenzhen(香港中文大学(深圳));Shenzhen Research Institute of Big Data(深圳大数据研究院)

Chengpeng Li, Zhengyang Tang, Ziniu Li, Mingfeng Xue, Keqin Bao, Tian Ding, Ruoyu Sun, Benyou Wang, Xiang Wang, Junyang Lin, Dayiheng Liu

AI总结:

针对大型推理模型处理复杂数学运算效率低、准确率不足的问题,提出CoRT后训练框架,通过提示工程合成代码集成推理数据优化模型与代码解释器的交互,在多个数学推理数据集上实现准确率提升与token用量降低。

摘要:

o1、DeepSeek-R1等大型推理模型(LRM)凭借长思维链(CoT)在自然语言推理中取得了显著进展,但在处理复杂数学运算时仍存在效率低下或准确率不足的问题。通过计算工具(如计算库、符号求解器)解决这些局限颇具前景,但也带来了技术挑战:代码解释器(CI)引入了模型内部文本表示之外的外部知识,因此直接结合的效率并不高。本文提出CoRT,一种用于指导LRM高效、有效利用CI的后训练框架。作为第一步,我们通过提示工程(Hint-Engineering)合成代码集成推理数据,解决数据稀缺问题——该方法会在恰当位置策略性插入不同提示,优化LRM与CI的交互。我们手动创建了30个高质量样本,在此基础上对1.5B到32B参数规模的模型进行后训练,训练方式包括监督微调、拒绝微调和强化学习。实验结果表明,在5个具有挑战性的数学推理数据集上,提示工程优化的模型在DeepSeek-R1-Distill-Qwen-32B和DeepSeek-R1-Distill-Qwen-1.5B上分别取得了4%和8%的绝对提升。此外,与自然语言模型相比,32B规模的提示工程模型token用量减少约30%,1.5B规模的模型token用量减少约50%。模型和代码可在https://github.com/ChengpengLi1003/CoRT获取。

英文摘要:

Large Reasoning Models (LRMs) like o1 and DeepSeek-R1 have shown remarkable progress in natural language reasoning with long chain-of-thought (CoT), yet they remain inefficient or inaccurate when handling complex mathematical operations. Addressing these limitations through computational tools (e.g., computation libraries and symbolic solvers) is promising, but it introduces a technical challenge: Code Interpreter (CI) brings external knowledge beyond the model's internal text representations, thus the direct combination is not efficient. This paper introduces CoRT, a post-training framework for teaching LRMs to leverage CI effectively and efficiently. As a first step, we address the data scarcity issue by synthesizing code-integrated reasoning data through Hint-Engineering, which strategically inserts different hints at appropriate positions to optimize LRM-CI interaction. We manually create 30 high-quality samples, upon which we post-train models ranging from 1.5B to 32B parameters, with supervised fine-tuning, rejection fine-tuning and reinforcement learning. Our experimental results demonstrate that Hint-Engineering models achieve 4\% and 8\% absolute improvements on DeepSeek-R1-Distill-Qwen-32B and DeepSeek-R1-Distill-Qwen-1.5B respectively, across five challenging mathematical reasoning datasets. Furthermore, Hint-Engineering models use about 30\% fewer tokens for the 32B model and 50\% fewer tokens for the 1.5B model compared with the natural language models. The models and code are available at https://github.com/ChengpengLi1003/CoRT.

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

↑