Toolformer (Meta's self-supervised tool-learning framework) is a training methodology that enables language models to autonomously discover where, when, and how to invoke external APIs without manual annotations; the pipeline consists of: 1) Automated Candidate Generation (prompting the model to sample candidate API calls like `[Calculator(3+5)]` across raw text); 2) API Execution; 3) Loss Filtering (computing cross-entropy loss deltas, filtering strictly for samples satisfying
Lcall<min(Lno_call,Lsame)−τ, where API outputs significantly reduce next-token perplexity past threshold
τ), followed by standard autoregressive fine-tuning.