Ankit Patel
WritingPapersLabsAboutContact
Paper Reviews··1 min read·80 views

Did the Call Help?

Toolformer · Schick et al., NeurIPS 2023

Propose calls, run them, keep only the ones whose result made the next words easier to predict, then train on what is left

To my eye, Toolformer's sharpest move is a self-supervised filter that manufactures API training examples from plain text. In Timo Schick and colleagues' February 2023 paper, a language model proposes tool calls inside an existing corpus and keeps only the ones whose returned output reduces loss on the tokens that follow.

A handful of human demonstrations can seed thousands of tool examples without anyone labeling every sentence where a calculator or search API belongs.

The training filter runs in four steps:

  1. Propose. From a few API demonstrations, the model samples candidate calls across positions in plain text.
  2. Execute. Run those candidate calls and capture the returned strings.
  3. Compare. Score next-token prediction with the call and its result against both no call at all and the call string without its result. Retain only calls that clear a loss-reduction threshold.
  4. Train. Fine-tune the model on the corpus with the surviving calls spliced in.

Scoring against the bare call without its result is the control that makes the experiment honest. Writing out Calculator(1000 / 1600) before the text "62.5%" already gives the model a formatting hint. Requiring the returned 0.625 to beat that bare call proves the external execution contributed real information.

Still, lower next-token loss is a narrow definition of useful. As the authors note in their limitations section, the filter ignores tool latency, dollar cost, and downstream side effects.

Borrow the counterfactual check before borrowing the training loop. On an application retrieval call, run the same evaluation cases with and without the returned payload, including minority edge cases like suspended accounts that rarely move an average score. How do you credit a tool call whose payoff only shows up four steps later when the workflow commits?

Continue in Paper Reviews