arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2305.11554cs.CLcs.LG
收藏

ToolkenGPT:通过工具嵌入为冻结语言模型增强大规模工具

ToolkenGPT: Augmenting Frozen Language Models with Massive Tools via Tool Embeddings

UC San Diego(加州大学圣迭戈分校);Mohamed bin Zayed University of Artificial Intelligence(穆罕默德·本·扎耶德人工智能大学)

Shibo Hao, Tianyang Liu, Zhen Wang, Zhiting Hu

AI总结:

ToolkenGPT将每个工具表示为可学习的toolken嵌入,使冻结大语言模型像生成普通token一样调用工具,无需微调即可动态扩展任意数量工具,并在数值推理、知识问答和具身规划等任务上显著优于现有基线。

摘要:

用外部工具增强大语言模型(LLMs)已成为解决复杂问题的一种有前景的方法。然而,传统方法使用工具演示数据对LLMs进行微调,既成本高昂,又受限于预定义的工具集。最近的上下文学习范式缓解了这些问题,但有限的上下文长度只允许少量演示,导致对工具的理解不够理想。此外,当有大量工具可供选择时,上下文学习可能完全失效。在本文中,我们提出了一种替代方法,$\ extbf{ToolkenGPT}$,它结合了双方的优势。我们的方法将每个$\underline{tool}$表示为一个to$\underline{ken}$($\ extit{toolken}$),并为其学习一个嵌入,从而能够像生成普通单词token一样进行工具调用。一旦触发某个toolken,LLM就会被提示补全参数以供该工具执行。ToolkenGPT通过动态扩展toolken集合,提供了灵活插入任意数量工具的能力。此外,它通过允许大量演示数据来学习toolken嵌入,从而改善工具使用。在包括数值推理、基于知识的问答和具身计划生成在内的多个领域中,我们的方法有效地用工具增强了LLMs,并大幅优于各种最新基线。ToolkenGPT展示了在复杂场景中从大型工具集中使用相关工具的有前景的能力。

英文摘要:

Augmenting large language models (LLMs) with external tools has emerged as a promising approach to solving complex problems. However, traditional methods, which finetune LLMs with tool demonstration data, can be both costly and restricted to a predefined set of tools. Recent in-context learning paradigm alleviates these issues, but the limited context length only allows for a few shots of demonstrations, leading to suboptimal understandings of the tools. Moreover, when there are numerous tools to choose from, in-context learning could completely fail to work. In this paper, we propose an alternative approach, $\textbf{ToolkenGPT}$, which combines the benefits of both sides. Our approach represents each $\underline{tool}$ as a to$\underline{ken}$ ($\textit{toolken}$) and learns an embedding for it, enabling tool calls in the same way as generating a regular word token. Once a toolken is triggered, the LLM is prompted to complete arguments for the tool to execute. ToolkenGPT offers the flexibility to plug in an arbitrary number of tools by expanding the set of toolkens on the fly. In addition, it improves tool use by allowing extensive demonstration data for learning the toolken embeddings. In diverse domains, including numerical reasoning, knowledge-based question answering, and embodied plan generation, our approach effectively augments LLMs with tools and substantially outperforms various latest baselines. ToolkenGPT demonstrates the promising ability to use relevant tools from a large tool set in complex scenarios.

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

↑