Skip to main content
QUICK REVIEW

[论文解读] ToolkenGPT: Augmenting Frozen Language Models with Massive Tools via Tool Embeddings

Shibo Hao, Tianyang Liu|arXiv (Cornell University)|May 19, 2023
Topic Modeling被引用 19
一句话总结

ToolkenGPT 通过将每个工具视为可嵌入的令牌(toolken),使冻结的 LLMs 掌握大量工具,从而在不微调 LLM 的情况下实现即时工具调用,并具备用于嵌入的丰富示例数据。

ABSTRACT

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, $ extbf{ToolkenGPT}$, which combines the benefits of both sides. Our approach represents each $\underline{tool}$ as a to$\underline{ken}$ ($ extit{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.

研究动机与目标

  • 使 LLM 能在不对模型进行微调的情况下调用大量外部工具。
  • 将工具表示为令牌(toolkens),并具备可学习的嵌入。
  • 通过扩展 toolken 词汇表实现对新工具的即时扩展。
  • 利用大量工具示例来学习嵌入。
  • 在数值推理、知识问答和具体现实规划方面展示性能提升。

提出的方法

  • 将每个工具表示为一个令牌(toolken),并学习一个 toolken 嵌入矩阵 W_tau。
  • 将 toolken 嵌入与标准词嵌入连接起来,以实现对 V ∪ T 的下一个词预测。
  • 引入模式切换:当预测出一个 toolken 时,切换到工具模式,通过示例完成工具参数。
  • 执行工具调用并将输出反馈到推理流中以继续生成。
  • 仅训练 toolken 嵌入,保持 LLM 冻结,从而高效适应新工具。
  • 可能合成示范或使用真实工具调用来创建成对的监督训练数据。

实验结果

研究问题

  • RQ1ToolkenGPT 是否能在不微调 LLM 的情况下掌握大量工具集?
  • RQ2从大量工具示例中能多有效地学习 toolken 嵌入?
  • RQ3 ToolkenGPT 是否在就地工具学习方面胜过并且在大量工具下显示出更好的可扩展性?
  • RQ4该方法是否能处理覆盖数值推理、知识问答和具体现实规划领域的工具?

主要发现

  • ToolkenGPT 在仅使用一个小型算术工具包的情况下与就地工具学习相匹配或超越,并可扩展到更大的工具集。
  • 该方法通过扩展 toolken 词汇表,且训练成本极低,来支持插入任意新工具。
  • 从大量示范学习到的 toolken 嵌入提升了跨领域的工具使用和问题解决能力。
  • 该方法在 tool mode 期间利用针对特定工具的示范来生成有效的工具参数。
  • 实验表明在数值推理、基于知识的问答和具体现实计划生成方面优于基线。

更好的研究,从现在开始

从论文设计到论文写作,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。