Toolformer:语言模型可以自学使用工具
Toolformer: Language Models Can Teach Themselves to Use Tools
摘要:
语言模型(LM)表现出非凡的能力,解决新的任务,从几个例子或文本指令,特别是在规模。矛盾的是,它们还在基本功能上苦苦挣扎,比如算术或事实查找,在这些功能上,更简单、更小的模型表现出色。在本文中,我们展示了LM可以通过简单的API自学使用外部工具,并实现两全其美。我们介绍了Toolformer,这是一个经过训练的模型,用于决定调用哪些API,何时调用它们,传递什么参数,以及如何将结果最好地纳入未来的令牌预测。这是以自我监督的方式完成的,只需要对每个API进行少量的演示。我们整合了一系列工具,包括计算器,问答系统,两个不同的搜索引擎,翻译系统和日历。Toolformer在各种下游任务中实现了显著改进的zero-shot性能,通常与更大的模型竞争,而不会牺牲其核心语言建模能力。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。