arXiv:2603.08068cs.AI2026-03被引 2

让大模型通过少量示例学会调用外部工具,无需大量标注数据。

In-Context Reinforcement Learning for Tool Use in Large Language Models

  • 用少量示例嵌入提示词,教会模型调用外部工具。
  • 训练中逐步减少示例,最终实现零样本自主调用工具。
  • 无需预训练微调,适合数据稀缺的复杂任务场景。

尽管大语言模型具备强大的推理能力,但其在复杂任务上的表现常受限于内部知识的不足。一种有效解决方案是引入外部工具,如用于数学计算的Python解释器或用于获取事实信息的搜索引擎。然而,如何让模型有效使用这些工具仍是挑战。现有方法通常依赖冷启动流程:先进行监督微调(SFT),再进行强化学习(RL),而SFT需要大量标注数据,成本高昂。本文提出一种仅基于强化学习的框架——上下文强化学习(ICRL),通过在强化学习的推理阶段采用少样本提示,消除对SFT的依赖。具体而言,ICRL在推理提示中引入上下文示例,指导模型如何调用外部工具;随着训练推进,示例数量逐渐减少,最终达到零样本设置,使模型学会自主调用工具。我们在多个推理与工具使用基准上进行了广泛实验,结果表明ICRL达到当前最优性能,验证了其作为可扩展、数据高效替代方案的有效性。

原文摘要 · Abstract (English)

While large language models (LLMs) exhibit strong reasoning abilities, their performance on complex tasks is often constrained by the limitations of their internal knowledge. A compelling approach to overcome this challenge is to augment these models with external tools -- such as Python interpreters for mathematical computations or search engines for retrieving factual information. However, enabling models to use these tools effectively remains a significant challenge. Existing methods typically rely on cold-start pipelines that begin with supervised fine-tuning (SFT), followed by reinforcement learning (RL). These approaches often require substantial amounts of labeled data for SFT, which is expensive to annotate or synthesize. In this work, we propose In-Context Reinforcement Learning (ICRL), an RL-only framework that eliminates the need for SFT by leveraging few-shot prompting during the rollout stage of RL. Specifically, ICRL introduces in-context examples within the rollout prompts to teach the model how to invoke external tools. Furthermore, as training progresses, the number of in-context examples is gradually reduced, eventually reaching a zero-shot setting where the model learns to call tools independently. We conduct extensive experiments across a range of reasoning and tool-use benchmarks. Results show that ICRL achieves state-of-the-art performance, demonstrating its effectiveness as a scalable, data-efficient alternative to traditional SFT-based pipelines.

强化学习工具调用少样本学习

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。