PruneTIR: Inference-Time Tool Call Pruning for Effective yet Efficient Tool-Integrated Reasoning

📄 arXiv: 2605.09931v1 📥 PDF

作者: Luan Zhang, Dandan Song, Zhijing Wu, Zhengyu Chen, Chen Zhang, Yuhang Tian, Huipeng Ma, Chenhao Li, Changzhi Zhou, Xudong Li, Shuhao Zhang

分类: cs.CL, cs.AI

发布日期: 2026-05-11


💡 一句话要点

提出PruneTIR推理时工具调用剪枝框架,以提升大语言模型工具集成推理的准确性与效率。

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 大语言模型 工具集成推理 推理时优化 轨迹剪枝 智能代理 代码解释器

📋 核心要点

  1. 现有研究多关注工具使用能力的获取,却忽视了推理阶段如何通过策略优化来提升模型处理复杂任务的鲁棒性。
  2. PruneTIR通过动态监控推理轨迹,引入剪枝、重采样和工具挂起机制,主动干预错误的工具调用路径。
  3. 实验表明该方法在不增加训练成本的前提下,显著提升了Pass@1指标,并有效降低了推理延迟与上下文开销。

📝 摘要(中文)

工具集成推理(TIR)使大语言模型(LLM)能够通过与外部工具(如代码解释器)交互来增强能力。目前的研究多集中于赋予模型工具使用能力,但如何通过推理时优化进一步提升已有工具能力模型的推理水平仍未得到充分探索。推理时优化无需额外训练,有助于模型更有效地利用工具解决问题。研究观察到,在推理过程中,错误工具调用的数量和比例与答案正确性呈负相关。此外,错误的工具调用通常在后续几轮内即可解决,若无法解决,模型往往会陷入反复失败的循环。基于此,本文提出了PruneTIR框架,通过成功触发剪枝、卡顿触发剪枝与重采样、以及重试触发工具挂起这三个组件,有效缓解了错误工具调用的负面影响,防止模型陷入无效循环。实验结果表明,PruneTIR显著提升了Pass@1准确率和推理效率,并有效缩短了工作上下文长度。

🔬 方法详解

问题定义:论文旨在解决大语言模型在工具集成推理过程中,因频繁出现错误工具调用而导致推理失败、陷入死循环以及上下文冗余的问题。现有方法缺乏在推理阶段对工具调用轨迹进行实时干预的机制。

核心思路:核心思想是利用推理过程中的反馈信号进行动态剪枝。通过观察发现错误调用若不能在短时间内修正,则后续修正概率极低,因此应及时截断无效路径并尝试替代方案或直接终止工具使用。

技术框架:PruneTIR包含三个核心模块:1. 成功触发剪枝(Success-Triggered Pruning),在工具调用成功后优化轨迹;2. 卡顿触发剪枝与重采样(Stuck-Triggered Pruning and Resampling),识别并处理陷入重复失败的路径;3. 重试触发工具挂起(Retry-Triggered Tool Suspension),在多次重试无效时强制模型停止调用工具,避免资源浪费。

关键创新:该方法实现了推理时的“自适应干预”,将原本被动的推理过程转变为主动的轨迹管理,无需对模型进行微调即可实现性能提升,具有极高的部署灵活性。

关键设计:关键设计在于触发器的阈值设定,通过监控工具调用的状态码、错误类型及连续失败次数,动态调整推理策略,从而在保持模型推理逻辑连贯性的同时,最大限度地减少无效工具调用带来的负面影响。

🖼️ 关键图片

fig_0
fig_1
fig_2

📊 实验亮点

实验在多个基准测试上验证了PruneTIR的有效性。结果显示,该方法在保持甚至提升Pass@1准确率的同时,显著减少了平均推理步数和上下文长度。与基线模型相比,PruneTIR在处理复杂多步推理任务时,能够更高效地规避错误路径,大幅降低了推理过程中的计算资源消耗。

🎯 应用场景

该研究适用于需要高可靠性工具调用的复杂任务场景,如自动化数据分析、科学计算、软件工程辅助及智能代理(Agent)系统。通过在推理层引入PruneTIR,可显著降低Agent在处理复杂任务时的“幻觉”与死循环风险,提升工业级AI应用在复杂环境下的稳定性和响应速度。

📄 摘要(原文)

Tool-integrated reasoning (TIR) enables large language models (LLMs) to enhance their capabilities by interacting with external tools, such as code interpreters (CI). Most recent studies focus on exploring various methods to equip LLMs with the ability to use tools. However, how to further boost the reasoning ability of already tool-capable LLMs at inference time remains underexplored. Improving reasoning at inference time requires no additional training and can help LLMs better leverage tools to solve problems. We observe that, during tool-capable LLM inference, both the number and the proportion of erroneous tool calls are negatively correlated with answer correctness. Moreover, erroneous tool calls are typically resolved successfully within a few subsequent turns. If not, LLMs often struggle to resolve such errors even with many additional turns. Building on the above observations, we propose PruneTIR, a rather effective yet efficient framework that enhances the tool-integrated reasoning at inference time. During LLM inference, PruneTIR prunes trajectories, resamples tool calls, and suspends tool usage through three components: Success-Triggered Pruning, Stuck-Triggered Pruning and Resampling, and Retry-Triggered Tool Suspension. These three components enable PruneTIR to mitigate the negative impact of erroneous tool calls and prevent LLMs from getting stuck in repeated failed resolution attempts, thereby improving overall LLM performance. Extensive experimental results demonstrate the effectiveness of PruneTIR, which significantly improves Pass@1 and efficiency while reducing the working context length for tool-capable LLMs.