Toolformer is a language model trained to decide when and how to invoke external tools through generated application programming interface (API) calls. It emerged as models moved beyond producing text alone toward retrieving information, calculating answers, checking dates, and translating language. section 8.11
The approach starts with a pretrained open-source language model and a small set of examples for each tool. Generated API calls are executed, their results are formatted alongside the input, and the model learns associations between special tokens and useful tools. The design aims to preserve general-purpose behavior rather than restrict the model to predefined tasks. section 8.11
The demonstrated tool set includes:
- Question answering for straightforward factual questions. section 8.11
- Wikipedia search, calculation, calendar lookup, and machine translation. section 8.11
Table 8.1 Sample API tool calls and output formats [49]
| API name |
Example input |
Example output |
| Question answering |
“Where was the Knights of Columbus founded?” |
“New Haven, Connecticut” |
| Wikipedia search |
“Fishing Reel Types” |
“Spin fishing > Spin fishing is distinguished between fly fishing and bait cast fishing by the type of rod and reel used. There are two types of reels used when spin fishing, the open-faced reel and the closed-faced reel.” |
| Calculator |
“27 + 4 * 2” |
“35” |
| Calendar |
(none) |
Today is Monday, June 30, 2025. |
| Machine translation |
“sûreté nucléaire” |
“nuclear safety” |
Sample inputs and outputs make the model’s tool calls concrete, from arithmetic and factual lookup to date retrieval and translation. section 8.11

