Tool Use and Function Calling

Toolformer (Schick et al., 2023) started self-supervised tool annotation. Berkeley Function Calling Leaderboard V4 (Patil et al., 2025) sets the 2026 bar: 40% agentic, 30% multi-turn, 10% live, 10% non-live, 10% hallucination. Single-turn is solved. Memory, dynamic decision-making, and long-horizon tool chains are not.

Build 1 hr Python (stdlib)

Prerequisites: Phase 14 · 01 (Agent Loop), Phase 13 · 01 (Function Calling Deep Dive)

#Learning Objectives

  • Explain Toolformer's self-supervised training signal: keep tool annotations only when execution reduces next-token loss.
  • Name BFCL V4's five evaluation categories and what each measures.
  • Implement a stdlib tool registry with schema validation, argument coercion, and execution sandboxing.
  • Diagnose the three 2026 open problems: long-horizon tool chaining, dynamic decision-making, and memory.
Full Access lesson

Keep going. The rest of this lesson is one step away.

Unlock all 503 lessons, video, code, quizzes and every future update. Pay in your own currency with Paystack.

The text and code of this lesson are based on AI Engineering from Scratch by Rohit Ghumare, MIT licensed.