Abstract
While knowledge distillation has become a mature field for compressing large language models (LLMs) into smaller ones by aligning their outputs or internal representations, the distillation of LLM-based agents, which involve planning, memory, and tool use, remains relatively underexplored. Existing agent distillation methods typically replay full teacher trajectories or imitate step-by-step teacher tool usage, but they often struggle to train student agents to dynamically plan and act in novel environments. We propose AgentDistill, a novel, training-free agent distillation framework that enables efficient and scalable knowledge transfer via direct reuse of Model-Context-Protocols (MCPs), which are structured and reusable task-solving modules autonomously generated by teacher agents. The reuse of these distilled MCPs enables student agents to generalize their capabilities across domains and solve new problems with minimal supervision or human intervention. Experiments on biomedical and mathematical benchmarks demonstrate that our distilled student agents, built on small language models, can achieve performance comparable to advanced systems using large LLMs such as OctoTools (GPT-4o), highlighting the effectiveness of our framework in building scalable and cost-efficient intelligent agents.
Introduction
Large Language Model (LLM) distillation has traditionally focused on transferring static knowledge from a large "teacher" model to a smaller "student" model. This process typically involves generating rationales and labels via Chain-of-Thought (CoT) prompting, followed by a computationally expensive fine-tuning phase. While effective for linguistic tasks, this paradigm struggles to capture agentic behavior—the ability to plan, utilize tools, and interact dynamically with complex environments.
Current agent distillation methods often rely on "trajectory imitation," where a small model is fine-tuned to mimic every step a larger model takes. This approach is not only costly but also results in poor generalization, as students often learn to replicate specific paths rather than general problem-solving logic. Furthermore, a capacity mismatch often prevents small models from following the complex reasoning chains of frontier models like GPT-4o.
The AgentDistill Framework
To address these limitations, we introduce AgentDistill, a training-free framework that shifts the focus from trajectory imitation to modular knowledge transfer. Instead of updating model weights, AgentDistill extracts and refines Model-Context-Protocols (MCPs)—structured, parameterized toolboxes—that can be directly integrated into student agents.
MCP-Box Construction
The pipeline consists of three primary stages:
- Creation: A powerful teacher agent (e.g., Claude-3.5-Sonnet) generates raw Python snippets and tool-use protocols while solving domain-specific tasks.
- Refinement: These snippets undergo Abstraction (making code task-agnostic), Clustering (grouping by functionality), and Consolidation (merging into robust Python modules called MCP-Boxes).
- Inference: At test time, a small student model (e.g., Llama-3-8B) is "mounted" with the distilled MCP-Box. The student uses its existing reasoning capabilities to call these high-quality tools, allowing it to focus on high-level planning while the MCP-Box handles execution.
Experimental Evaluation
We evaluated AgentDistill across three diverse benchmarks: PathVQA (pathology visual QA), SLAKE (radiology visual QA), and Game of 24 (mathematical reasoning).
Key Results
- Performance Gains: On the Game of 24 benchmark, GPT-3.5-turbo’s accuracy increased from 34.3% to 82.7% (+48.4 points) when equipped with an MCP-Box. Similarly, Llama-3-8B improved from 21.7% to 64.0%.
- Teacher Parity: In the PathVQA benchmark, distilled student agents achieved an average performance of 52.7%, matching the 52% performance of the teacher agent. This suggests that distilled tools can be more efficient than the teacher's original ad-hoc reasoning.
- High Generalization: Student agents utilized MCP-Box tools in up to 94.7% of test cases on the SLAKE dataset, demonstrating the high relevance and portability of the distilled modules.
Discussion and Conclusion
AgentDistill demonstrates that agentic capability is often a matter of interface and context rather than raw parameter count. By eliminating gradient updates, we provide a scalable and cost-efficient path toward building intelligent agents.
Future work will address the "teacher bottleneck," as the quality of the MCP-Box remains dependent on the teacher's initial problem-solving ability. Additionally, we aim to explore the creation of "Universal MCP-Boxes" to extend these capabilities beyond specific domains into general-purpose task solving.
Summary updated