AIAny

Toolformer: Language Models Can Teach Themselves to Use Tools

Teaches a language model when and how to call external APIs using a few demonstrations and self-generated training data. Calls are retained only when their results improve prediction of subsequent text.

Introduction

Tool use can be learned from the language model’s own prediction errors. The useful signal is whether an API response makes subsequent text easier to predict, allowing ordinary text to supply supervision for choosing tools and arguments.

Key Findings
  • A few demonstrations seed candidate calls; execution and loss-based filtering create the fine-tuning data without extensive manual annotation.
  • On ASDiv, the GPT-J-based model scores 40.4 versus 14.8 with its APIs disabled, showing the contribution of calculator access.
  • Experiments cover question answering, search, arithmetic, translation, and dates while retaining general language modeling ability.
Who Should Read It

Great fit if you study how to generate tool-use training data. Look elsewhere if you need chained calls or interactive search: the method does not teach either, and useful examples for some tools are costly to obtain.

Information

  • Websitearxiv.org
  • OrganizationsMeta AI Research, Universitat Pompeu Fabra
  • AuthorsTimo Schick, Jane Dwivedi-Yu, Roberto Dessì, Roberta Raileanu, Maria Lomeli, Luke Zettlemoyer, Nicola Cancedda, Thomas Scialom
  • Published date2023/02/09

More Items

Lets language models move information between their context window and external storage. Memory editing, retrieval, and function chaining support conversations and document analysis beyond a single prompt's capacity.

Measures whether reusable skills improve agent task completion through paired tests. Across 87 tasks and 18 model–harness configurations, curated skills raise average pass rate by 16.6 percentage points; compact skill bundles work best.

Enforces output grammars during LLM decoding while reducing CPU validation overhead. Precomputed token masks and persistent stacks support nested formats without checking the full vocabulary at every step.