Tool-integrated reasoning (TIR) has become a key approach for improving large reasoning models (LRMs) on complex problems. Prior work has mainly studied when to invoke tools, while overlooking how tools are applied. We identify two common patterns: a calculator pattern that uses code for direct computation, and an algorithmic pattern that encodes problems as programs. Misaligned choices often cause failures even when reasoning is sound. We propose a two-stage framework that first builds code competence from both patterns and then aligns pattern selection with teacher preferences. Across challenging math datasets, our pattern-aware method substantially improves both code usage and accuracy, for instance raising Code@1 on MATH500 from 64.0% to 70.5% and on AIME24 from 26.7% to 50.0%. These gains highlight the effectiveness of a pattern-aware approach for tool-integrated reasoning.
翻译:工具集成推理已成为提升大型推理模型在复杂问题上性能的关键方法。先前的研究主要关注何时调用工具,而忽略了工具如何被应用。我们识别出两种常见模式:一种是使用代码进行直接计算的“计算器模式”,另一种是将问题编码为程序的“算法模式”。即使推理过程正确,模式选择不当也常常导致失败。我们提出了一个两阶段框架:首先从两种模式中构建代码能力,然后将模式选择与教师偏好对齐。在多个具有挑战性的数学数据集上,我们的模式感知方法显著提升了代码使用效率和准确性,例如将MATH500上的Code@1从64.0%提升至70.5%,将AIME24上的Code@1从26.7%提升至50.0%。这些成果突显了模式感知方法在工具集成推理中的有效性。