arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2405.16533cs.CL
收藏

野生环境下的工具学习:赋能语言模型作为自动工具智能体

Tool Learning in the Wild: Empowering Language Models as Automatic Tool Agents

Shandong University(山东大学);University of Electronic Science and Technology of China(电子科技大学);Baidu Inc.(百度公司);University of Birmingham(伯明翰大学);Leiden University(莱顿大学)

Zhengliang Shi, Shen Gao, Lingyong Yan, Yue Feng, Xiuyi Chen, Zhumin Chen, Dawei Yin, Suzan Verberne, Zhaochun Ren

AI总结:

本文提出AutoTools框架,使LLMs自动将工具文档转换为可调用函数并集成到可执行程序中解决实际任务,并通过AutoTools-learning方法在34k合成数据上训练LLMs,显著提升了其工具使用能力。

摘要:

使用外部工具增强大型语言模型(LLMs)已成为扩展其效用的一种有前景的方法,使其能够解决实际任务。以往的方法手动解析工具文档并创建上下文演示,将工具转换为结构化格式供LLMs在逐步推理中使用。然而,这种手动过程需要领域专业知识,且难以扩展到大型工具集。此外,这些方法严重依赖临时推理技术或特殊标记,将自由形式的LLM生成与工具调用动作集成,限制了LLM在处理多样化工具规范和集成多个工具时的灵活性。在这项工作中,我们提出了AutoTools,一个使LLMs自动化工具使用工作流的框架。具体而言,LLM自动将工具文档转换为可调用函数,验证语法和运行时正确性。然后,LLM将这些函数集成到可执行程序中以解决实际任务,灵活地将工具使用动作锚定到其推理过程中。在现有和新收集的更具挑战性的基准上的广泛实验说明了我们框架的优越性。受这些有前景的结果启发,我们进一步研究如何在AutoTools中提高LLMs(尤其是参数较少的开源LLMs)的专业能力。因此,我们提出了AutoTools学习方法,在34k个高质量合成数据实例上训练LLMs完成三项学习任务,包括文档理解、相关性学习和函数编程。细粒度结果验证了我们整体训练方法及每个单独任务的有效性。我们的方法是迈向使用LLMs通过外部工具解决现实世界任务的重要一步。

英文摘要:

Augmenting large language models (LLMs) with external tools has emerged as a promising approach to extend their utility, enabling them to solve practical tasks. Previous methods manually parse tool documentation and create in-context demonstrations, transforming tools into structured formats for LLMs to use in their step-by-step reasoning. However, this manual process requires domain expertise and struggles to scale to large toolsets. Additionally, these methods rely heavily on ad-hoc inference techniques or special tokens to integrate free-form LLM generation with tool-calling actions, limiting the LLM's flexibility in handling diverse tool specifications and integrating multiple tools. In this work, we propose AutoTools, a framework that enables LLMs to automate the tool-use workflow. Specifically, the LLM automatically transforms tool documentation into callable functions, verifying syntax and runtime correctness. Then, the LLM integrates these functions into executable programs to solve practical tasks, flexibly grounding tool-use actions into its reasoning processes. Extensive experiments on existing and newly collected, more challenging benchmarks illustrate the superiority of our framework. Inspired by these promising results, we further investigate how to improve the expertise of LLMs, especially open-source LLMs with fewer parameters, within AutoTools. Thus, we propose the AutoTools-learning approach, training the LLMs with three learning tasks on 34k instances of high-quality synthetic data, including documentation understanding, relevance learning, and function programming. Fine-grained results validate the effectiveness of our overall training approach and each individual task. Our methods are an important step towards the use of LLMs for solving real-world tasks with external tools.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑