Tools serve as pivotal interfaces that enable humans to understand and reshape the world. With the advent of foundational models, AI systems can utilize tools to expand their capabilities and interact with the world. Existing tool learning methodologies, encompassing supervised fine-tuning and prompt engineering approaches, often induce language models to utilize tools indiscriminately, as complex problems often exceed their own competencies. However, introducing tools for simple tasks, which the models themselves can readily resolve, can inadvertently propagate errors rather than enhance performance. This leads to the research question: can we teach language models when and how to use tools? To meet this need, we propose Tool leaRning wIth exeCution fEedback (TRICE), a two-stage end-to-end framework that enables the model to continually learn through feedback derived from tool execution, thereby learning when and how to use tools effectively. Experimental results, backed by further analysis, show that TRICE can make the language model to selectively use tools by decreasing the model's dependency on tools while enhancing the performance. Code and datasets will be available in https://github.com/zjunlp/trice.
翻译:工具作为关键接口,使人类能够理解和重塑世界。随着基础模型的出现,人工智能系统可以利用工具扩展自身能力并与世界交互。现有的工具学习方法,包括有监督微调和提示工程技术,通常会导致语言模型不加区分地使用工具,因为复杂问题往往超出模型自身能力。然而,对于模型本身可以轻松解决的简单任务引入工具,反而可能意外传播错误而非提升性能。这引出了一个研究问题:我们能否教会语言模型何时以及如何使用工具?为满足这一需求,我们提出了TRICE(Tool leaRning wIth exeCution fEedback),这是一个两阶段端到端框架,使模型能够通过从工具执行中获得的反馈持续学习,从而有效掌握何时以及如何使用工具。实验结果表明,TRICE能够通过降低模型对工具的依赖性同时提升性能,使语言模型有选择性地使用工具。代码和数据集将在https://github.com/zjunlp/trice 公开。