IN THIS BREAKDOWN · 10 SECTIONS
You can read 18% of this breakdown.
The paper in one minute
Language models are oddly bad at things that simple programs do perfectly: dividing two numbers, looking up a fact that changed last year, knowing today's date. The obvious fix is to let the model call tools. The question in early 2023 was how to teach a model when to call which tool, with what input, and how to use the answer, without a large hand-labeled dataset of tool use.
Timo Schick, Thomas Scialom and colleagues at Meta AI Research answer with a self-supervised trick. Write a short prompt with a few examples per tool, then let the model annotate a large slice of web text with candidate calls, such as [Calculator(400/1400) → 0.29] placed just before "29%". Execute each candidate call. Then keep a call only if putting the call and its result in front of the text makes the model better at predicting the next few words than having no call, or the call without its result. Fine-tune the model on the text with the surviving calls. Because the text is ordinary pretraining-style data, the model keeps its general abilities.
The tools were a question-answering model, a Wikipedia search engine, a calculator, a calendar and a translation model. The base model, GPT-J with 6.7 billion parameters, became much stronger zero-shot on fact completion, arithmetic word problems and date questions, often beating GPT-3 with 175 billion parameters. It still lagged on open question answering and could neither chain tools nor search interactively.
Research notes: the problem, approach and results
ASDiv math accuracy, Toolformer 6.7B versus GPT-3 175B, zero-shot
of math examples where Toolformer chose to call the calculator
parameters below which models gained nothing from the tools
Large language models handle open-ended text well but fail at exact arithmetic, current facts and dates, which a calculator or search engine solves trivially. Teaching tool use usually needed lots of human-annotated examples or task-specific prompts.
Show the model a few examples per tool, let it insert candidate calls into a large text corpus, execute them, and keep only calls whose results reduce the model's loss on the words that follow. Fine-tune on the result.
GPT-J 6.7B trained this way more than doubled its zero-shot scores on math word problems, beat GPT-3 175B on fact completion and arithmetic, and kept its language-modeling quality. It did not catch up on open question answering, and could not chain tools.
Why it matters to an FDE
Modern models arrive already trained to call functions, so few teams will reproduce Toolformer. The ideas in it still decide whether a customer's tool-using system works.
Tools fix what models are structurally bad at. Exact arithmetic, current facts and dates are the cases where tools gave the largest gains. If a customer workflow depends on any of them, route it to a tool rather than hoping the model computes or remembers.
"Did the tool help?" is measurable. Toolformer's filter asks whether the tool's result made the following text more predictable. In evaluation you can ask the same question: does the call change the outcome, or is it ceremony that adds latency?
Placement matters. A call helps most right before its result is needed. In agents, fetch information close to where it is used, rather than front-loading everything into the context.
Small models may not benefit. Below roughly 775M parameters, the models did no better with tools than without. When a customer insists on a very small model, test whether tool calls help at all.
Single calls are not enough for real work. Toolformer makes at most one call per output and cannot chain tools. Most business tasks need several calls and decisions between them, which is where agent loops and code actions come in.
Understand the mechanism. Try it on a real problem.
Unlock this breakdown and 99 more papers.
Premium opens every paper in full, plus every answer, concept, course and guide on the site. One payment for six months of access.
6 months · One payment · No auto-renewal
- ◇1 architecture diagram
- </>1 runnable code experiment
- ▦2 results tables
- ?5 interview questions with answers
- 03Key takeaways
The filter, the tools, the decoding tweak, each result, scaling, and the misreadings to avoid
Free account - 04How it works
Sampling positions and calls, the filtering loss, merging tools, and the evaluation setup
Premium - 05The numbers that matter
Every benchmark family, the controls, the scaling study and the multilingual exception
Premium - 06Try it yourself
Implement Toolformer's loss-reduction filter and watch it sort useful calls from useless ones
Premium - 07Where it breaks
The limits the authors list, and what has changed since
Premium - 08Using it on a deployment
Applying the paper's ideas to tool design and evaluation in a customer system
Premium - 09Interview angles
Five questions this paper prepares you for, with answer hints
Premium - 10Read next
Where to go from here on this site
Premium
