Timeline

Toolformer teaches models to call APIs

The model taught itself, from only a handful of examples per tool, when to call a calculator, search engine, translator or calendar and how to use the result.

  • Ideas & essays
  • Minor

Researchers at Meta AI published Toolformer, a model that learned on its own when to call an external tool while generating text, rather than being explicitly trained end-to-end to use any one of them. Given only a handful of demonstrations per tool, the model learned to insert calls to a calculator, a question-answering system, two search engines, a translator and a calendar function into its own output, decide what arguments to pass, and fold the returned result back into its answer.

The training method was self-supervised: the model generated candidate API calls at plausible points in ordinary text, executed them, and kept only the calls that measurably improved its ability to predict the following text — filtering out ones that were unhelpful or redundant — before fine-tuning on the resulting annotated examples. This let the model acquire tool use without hand-labelled data showing exactly when and how to call each API.

The paper reported that Toolformer substantially improved zero-shot performance on tasks like arithmetic and factual question-answering compared with the same base model without tool access, in some cases becoming competitive with much larger language models, while leaving its general language-modelling ability largely intact. The result addressed a specific and well-known weakness of large language models — their unreliability at exact computation and up-to-date factual lookup — and became one of the most-cited early demonstrations that a model could decide for itself when to step outside pure text generation, a capability that later agent frameworks and function-calling APIs built on directly.