ToolFormer
Toolformer is a language-model training approach in which a model learns when and how to invoke external tools or application programming interfaces during generation.
LLMs in Production
Toolformer is a language-model training approach in which models learn to decide when and how to call external tools.
- How it is used
- Extends language models with external capabilities such as search, calculation, translation, calendars, and current-information retrieval.
- How deep it goes
- Explains tagged API calls and interpreter execution, but does not detail the fine-tuning procedure or tool-call reliability.
- Examples
- Uses GPT-J with five tools and a Guidance arithmetic example covering addition, subtraction, multiplication, and division.
- What you can do after
- Apply via Guidance by defining callable tools, recognizing generated calls, executing them, and continuing model generation.
Introduction to Generative AI, Second Edition
Toolformer is a language model trained to decide when and how to invoke external tools through generated API calls.
- How it is used
- Trains language models to choose and invoke external tools while retaining general-purpose language behavior.
- How deep it goes
- Explains dataset generation, API execution, and token associations, but stops short of implementation-level detail.
- Examples
- Uses question answering, Wikipedia search, a calculator, a calendar, and machine translation as concrete API examples.
- What you can do after
- Evaluate and understand how language models can learn flexible tool invocation from limited annotated examples.
Read how Introduction to Generative AI, Second Edition explains ToolFormer →
Related concepts
- contractuses · An API contract is a specification of the operations, data, and behavioral expectations that govern interactions between software components.
- fine-tuninguses · Fine-tuning is adapting a pretrained machine-learning model by training it further on targeted data or objectives for a task, domain, or behavior.
- interpolationequivalent to · Interpolation is the construction of text by inserting evaluated values or expressions into designated placeholders in a string or template.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

