AgentDistill: Training-Free Agent Distillation with Generalizable MCP Boxes

Jiahao Qiu, Xinzhe Juan, Yimin Wang, Ling Yang, Xuan Qi, Tongcheng Zhang, Jiacheng Guo, Yifu Lu, Zixin Yao, Hongru Wang, Shilong Liu, xun jiang, Liu Leqi, Mengdi Wang · Submission to ICLR 2026 · Rejected

TL;DR

AgentDistill transfers the problem-solving prowess of frontier models (like Claude-Sonnet-4 and GPT-4o) to compact, open-source models without a single gradient update. Instead of training small language models to imitate fragile step-by-step reasoning trajectories, the framework extracts, consolidates, and packages teacher-generated actions into modular, standardized tools called Model–Context–Protocols (MCPs). By simply mounting this curated "MCP Box" at inference time, small 8B models can match or outperform larger models on complex mathematical and biomedical tasks.

What Problem Does This Paper Address?

Distilling LLM-based agents—systems that combine reasoning, planning, memory, and tool invocation—is substantially harder than distilling pure text generation. Conventional agent distillation approaches typically rely on:

  1. Trajectory Imitation: Supervised fine-tuning of students to mimic interleaved thought-action steps token-by-token.
  2. Structure Distillation: Forcing students to reproduce abstract plans, subgoals, or interaction graphs.

Both paradigms suffer from significant drawbacks: fine-tuning is computationally expensive, long trajectories generalize poorly to novel environments, and smaller models frequently lack the intrinsic capacity or knowledge boundaries required to execute teacher-level plans.

AgentDistill asks: Can we transfer agentic competence by distilling reusable, executable tools rather than updating model weights?

Methods

AgentDistill is a training-free agent distillation framework consisting of two primary stages:

[Teacher Trajectories] ➔ [Abstraction] ➔ [Clustering] ➔ [Consolidation] ➔ [MCP Box] ➔ [Student Agent]
  1. Teacher MCP Creation: A high-capacity teacher agent (Claude-Sonnet-4 manager paired with GPT-4o tool generation) solves tasks by writing, searching, and executing dynamic scripts. Scripts from successful trajectories are collected into a raw protocol pool.
  2. MCP Box Construction: An LLM processes raw code snippets through three refinement steps:
  3. Abstraction: Removes instance-specific constants and rewrites code into parameterized functions.
  4. Clustering: Groups tools by functional semantics (e.g., image manipulation, numerical analysis).
  5. Consolidation: Merges overlapping tools within each cluster into unified, robust, production-ready FastMCP Python tools.
  6. Student Inference: Student agents (such as LLaMA-3.1-8B or Qwen-8B operating within the SmolAgents framework) are directly equipped with the consolidated MCP Box. The student keeps its frozen weights ($\nabla_\theta \pi_S = 0$) and handles high-level planning and parameter selection, bypassing low-level code generation entirely.

Datasets

The authors evaluate AgentDistill on both multi-modal visual question answering and constrained symbolic math:

  • Game of 24: An arithmetic reasoning benchmark of 1,362 puzzles requiring four numbers to be combined using basic operations to total 24.
  • PathVQA: A pathology visual QA dataset (~32,000 questions over 4,998 microscopy images) requiring fine-grained clinical reasoning.
  • SLAKE: A bilingual, knowledge-grounded medical VQA dataset spanning 642 radiology images and over 14,000 QA pairs.

For each dataset, 100 validation examples were sampled to construct the domain-specific MCP Box.

Key Insights and Ideas

  • Decoupling Planning from Code Synthesis: Small models often fail at agents tasks because they cannot reliably synthesize bug-free tool code on the fly. AgentDistill offloads low-level execution logic to teacher-verified MCP modules, freeing the student to focus solely on high-level decision-making.
  • Tools as Reusable Knowledge: Rather than viewing distillation as probability alignment or token imitation, knowledge is treated as modular, parameterized software artifacts that can be shared across agents.
  • Compression Through Consolidation: Without clustering and abstraction, the toolset becomes bloated with brittle, near-duplicate functions. Consolidation produces clean interfaces with high reuse rates across unseen problems.

Key Results

Equipping frozen small models with distilled MCPs consistently yielded large performance gains across benchmarks:

  • Game of 24: Dramatic leaps for weaker baselines—GPT-3.5-turbo surged from 34.3% to 82.7% (+48.4%), and LLaMA-3.1-8B jumped from 21.7% to 64.0% (+42.3%). The student average (75.5%) far surpassed the baseline OctoTools with GPT-4o (45%).
  • SLAKE: LLaMA-3.1-8B improved by +10.0 points (49.3% to 59.3%), and GPT-3.5-turbo rose from 61.0% to 68.3%.
  • PathVQA: Average student performance reached 52.7%, effectively matching the teacher agent's performance (52.0%).
  • High Tool Reusability: Student agents invoked the distilled MCPs frequently—achieving a 100% invocation rate on Game of 24 and up to 94.7% on SLAKE.

Limitations and Future Work

  • Narrow Benchmark Scope: Evaluations are limited to medical VQA and Game of 24 puzzles; broader domains (e.g., web navigation, multi-step software engineering) remain untested.
  • Teacher Dependency: Generating the MCP Box still requires access to proprietary frontier LLMs (Claude-Sonnet-4, GPT-4o) during the offline distillation phase.
  • Ceiling Effects: Models with already strong out-of-the-box arithmetic abilities (such as Qwen3-8B on Game of 24) saw smaller relative gains (+7.0%).
  • Prompt Availability: Full prompt templates were omitted from the initial paper submission, though authors commit to releasing them for full reproducibility.

Summary updated

BibTeX
@misc{qiu2025agentdistill,
  author = {Jiahao Qiu and Xinzhe Juan and Yimin Wang and Ling Yang and Xuan Qi and Tongcheng Zhang and Jiacheng Guo and Yifu Lu and Zixin Yao and Hongru WANG and Shilong Liu and xun jiang and Liu Leqi and Mengdi Wang},
  title = {{AgentDistill: Training-Free Agent Distillation with Generalizable MCP Boxes}},
  year = {2025},
  eprint = {2506.14728},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2506.14728},
}

Loading related content...

Figure