Reasoning with a Code Interpreter (CI) has emerged as an effective paradigm for enhancing the reasoning capabilities of large language models (LLMs) through executable computation and iterative verification. Despite its growing adoption, the behavioral properties underlying effective code reasoning remain largely underexplored. In this work, we investigate code reasoning from two distinct perspectives inspired by prior studies of natural language reasoning: extrinsic properties, represented by crucial tokens, and intrinsic properties, represented by code-specific cognitive behaviors. Across multiple LLMs, we find that stronger CI reasoning models consistently exhibit a higher prevalence of crucial tokens and cognitive behaviors, particularly verification, backtracking, and backward chaining. Building on these observations, we examine how these properties can be leveraged during both inference and training. At inference time, appending code-specific crucial tokens improves performance on several reasoning capabilities, including mathematical, ordering, and optimization, while yielding limited benefits elsewhere. At training time, augmenting a state-of-the-art framework with code-specific cognitive behaviors improves supervised fine-tuning and reinforcement learning performance in two of three evaluated models. Further analysis shows that these behaviors reduce overthinking in incorrect responses and improve token efficiency, while also revealing factors that limit gains in a certain model. Our findings provide the first systematic characterization of effective reasoning with CI and demonstrate both the potential and limitations of leveraging key properties to improve CI-based reasoning.


翻译:借助代码解释器进行推理已成为一种有效范式,通过可执行计算和迭代验证增强大型语言模型的推理能力。尽管该技术被广泛采用,但有效代码推理背后的行为属性仍鲜有探索。受自然语言推理相关研究的启发,本文从两个不同视角研究代码推理:外在属性(以关键标记为代表)与内在属性(以代码特有的认知行为为代表)。跨多个大型语言模型的实验表明,更强的代码解释器推理模型始终展现出更高频率的关键标记和认知行为,尤其是验证、回溯和反向链。基于这些发现,我们进一步研究了如何在推理和训练过程中利用这些属性。在推理阶段,附加代码特有认知标记在数学、排序和优化等多项推理能力上提升了性能,但在其他场景收益有限。在训练阶段,将代码特有认知行为注入最先进的框架后,三个评估模型中有两个在监督微调和强化学习上的表现得到提升。进一步分析表明,这些行为能减少错误回答中的过度思考并提高标记效率,同时也揭示了限制特定模型增益的因素。本研究首次系统刻画了代码解释器有效推理的特征,并展示了利用关键属性改进代码推理的潜力与局限性。

0
下载
关闭预览

相关内容

代码(Code)是专知网的一个重要知识资料文档板块,旨在整理收录论文源代码、复现代码,经典工程代码等,便于用户查阅下载使用。
大语言模型的智能体化推理
专知会员服务
35+阅读 · 1月21日
知识图谱可解释推理研究综述
专知会员服务
178+阅读 · 2021年12月31日
专知会员服务
101+阅读 · 2021年3月20日
【机器推理可解释性】Machine Reasoning Explainability
专知会员服务
35+阅读 · 2020年9月3日
机器学习的可解释性
专知会员服务
180+阅读 · 2020年8月27日
「因果推理」概述论文,13页pdf
专知
16+阅读 · 2021年3月20日
深度学习可解释性研究进展
专知
19+阅读 · 2020年6月26日
因果推理学习算法资源大列表
专知
27+阅读 · 2019年3月3日
【干货】深入理解自编码器(附代码实现)
关系推理:基于表示学习和语义要素
计算机研究与发展
19+阅读 · 2017年8月22日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
8+阅读 · 2014年12月31日
国家自然科学基金
21+阅读 · 2013年12月31日
Arxiv
10+阅读 · 2023年5月4日
VIP会员
最新内容
学习数据的几何:形状空间分析数学综述
专知会员服务
6+阅读 · 6月17日
定向能反无人机系统最新发展动态
专知会员服务
7+阅读 · 6月17日
从燃煤战舰到算法战争:水面指挥的永恒要求
专知会员服务
4+阅读 · 6月17日
相关VIP内容
大语言模型的智能体化推理
专知会员服务
35+阅读 · 1月21日
知识图谱可解释推理研究综述
专知会员服务
178+阅读 · 2021年12月31日
专知会员服务
101+阅读 · 2021年3月20日
【机器推理可解释性】Machine Reasoning Explainability
专知会员服务
35+阅读 · 2020年9月3日
机器学习的可解释性
专知会员服务
180+阅读 · 2020年8月27日
相关基金
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
8+阅读 · 2014年12月31日
国家自然科学基金
21+阅读 · 2013年12月31日
Top
微信扫码咨询专知VIP会员