Toolformer:语言模型可以自学使用工具

Toolformer: Language Models Can Teach Themselves to Use Tools

蒂莫·席克 Timo Schick · Meta AI · 2023-02-09 · arXiv:2302.04761 ↗ · 被引 4518

打开互动全文版(逐段中英对照 + 图/公式 + 论文问答)→

摘要 · Abstract

语言模型(LM)在仅凭少量示例或文本指令解决新任务方面表现出色,尤其是在规模扩大时。然而,它们却在算术或事实查找等基本功能上表现不佳,而这些功能更简单、更小的模型却擅长。在本文中,我们展示了 LM 可以通过简单的 API 自学使用外部工具,从而两全其美。我们引入了 Toolformer,这是一个经过训练的模型,能够决定调用哪些 API、何时调用、传递什么参数以及如何最好地将结果整合到未来的令牌预测中。这是以自监督方式完成的,每个 API 仅需少量演示。我们整合了一系列工具,包括计算器、问答系统、两种不同的搜索引擎、翻译系统和日历。Toolformer 在多种下游任务中实现了显著改进的零样本性能,通常与更大的模型竞争,且不牺牲其核心语言建模能力。

Language models (LMs) exhibit remarkable abilities to solve new tasks from just a few examples or textual instructions, especially at scale. They also, paradoxically, struggle with basic functionality, such as arithmetic or factual lookup, where much simpler and smaller models excel. In this paper, we show that LMs can teach themselves to use external tools via simple APIs and achieve the best of both worlds. We introduce Toolformer, a model trained to decide which APIs to call, when to call them, what arguments to pass, and how to best incorporate the results into future token prediction. This is done in a self-supervised way, requiring nothing more than a handful of demonstrations for each API. We incorporate a range of tools, including a calculator, a Q\&A system, two different search engines, a translation system, and a calendar. Toolformer achieves substantially improved zero-shot performance across a variety of downstream tasks, often competitive with much larger models, without sacrificing its core language modeling abilities.

核心贡献 · Key contributions

局限 · Limitations

论文章节 · Sections(共 13)

阅读逐段中英对照全文 →