Distilling LLM Agent into Small Models with Retrieval and Code Tools
Minki Kang, Jongwon Jeong, Seanie Lee, Jaewoong Cho, Sung Ju Hwang
Abstract
Large language models (LLMs) excel at complex reasoning tasks but remain computationally expensive, limiting their practical deployment. To address this, recent works have focused on distilling reasoning capabilities into smaller language models (sLMs) using chain-of-thought (CoT) traces from teacher LLMs. However, this approach struggles in scenarios requiring rare factual knowledge or precise computation, where sLMs often hallucinate due to limited capability. In this work, we propose Agent Distillation, a framework for transferring not only reasoning capability but full task-solving behavior from LLM-based agents into sLMs with retrieval and code tools. We improve agent distillation along two complementary axes: (1) we introduce a prompting method called first-thought prefix to enhance the quality of teacher-generated trajectories; and (2) we propose a self-consistent action generation for improving test-time robustness of small agents. We evaluate our method on eight reasoning tasks across factual and mathematical domains, covering both in-domain and out-of-domain generalization. Our results show that sLMs as small as 0.5B, 1.5B, 3B parameters can achieve performance competitive with next-tier larger 1.5B, 3B, 7B models fine-tuned using CoT distillation, demonstrating the potential of agent distillation for building practical, tool-using small agents. Our code is available at https://github.com/Nardien/agent-distillation.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
5 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- Student-Centered Distillation Narrows the Agentic Gap Between Small and Large LLMs cites Toolformer: Language Models Can Teach Themselves to Use Tools
- Autonomous Knowledge Graph Exploration with Adaptive Breadth-Depth Retrieval cites LoRA: Low-Rank Adaptation of Large Language Models
- Autonomous Knowledge Graph Exploration with Adaptive Breadth-Depth Retrieval cites Toolformer: Language Models Can Teach Themselves to Use Tools
- Autonomous Knowledge Graph Exploration with Adaptive Breadth-Depth Retrieval cites Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks
- Large Language Models are Zero-Shot Reasoners cites Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
Cited by top-tier papers5
- Student-Centered Distillation Narrows the Agentic Gap Between Small and Large LLMsYuanjie Lyu, Chengyu Wang, Jun Huang, Tong XuICML 2026 · 9 citations
- Scaling Small Agents Through Strategy AuctionsLisa Alazraki, Shen, Yoram Bachrach, Akhil MathurICML 2026 · 2 citations
- Autonomous Knowledge Graph Exploration with Adaptive Breadth-Depth RetrievalJoaquín Polonuer, Lucas Vittor, Iñaki Arango, Ayush Noori et al.ACL 2026 · 1 citation
- When Agents Look the Same: Quantifying Distillation-Induced Similarity in Tool-Use BehaviorsChenghao Yang, Yuning Zhang, Zhoufutu Wen, Tao Gong et al.ACL 2026 · 1 citation
- CIRAG: Construction-Integration Retrieval and Adaptive Generation for Multi-hop Question AnsweringZili Wei, Yilin Wang, Xiaocui Yang, Shi Feng et al.ACL 2026
Builds on37
- Chain-of-Thought Prompting Elicits Reasoning in Large Language ModelsJason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma et al.NeurIPS 2022 · 22,562 citations
- Retrieval-Augmented Generation for Knowledge-Intensive NLP TasksPatrick Lewis, Ethan Perez, Aleksandra Piktus, Fabio Petroni et al.NeurIPS 2020 · 19,162 citations
- LoRA: Low-Rank Adaptation of Large Language ModelsEdward J. Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu et al.ICLR 2022 · 18,833 citations
- Large Language Models are Zero-Shot ReasonersTakeshi Kojima, Shixiang Shane Gu, Machel Reid, Yutaka Matsuo et al.NeurIPS 2022 · 8,168 citations
- Toolformer: Language Models Can Teach Themselves to Use ToolsTimo Schick, Jane Dwivedi-Yu, Roberto Dessì, Roberta Raileanu et al.NeurIPS 2023 · 5,989 citations
Related papers
- Unveiling the Key Factors for Distilling Chain-of-Thought ReasoningXinghao Chen, Zhijing Sun, Wenjin Guo, Miaoran Zhang et al.ACL Findings 2025 · 7 citations
- Small Models Struggle to Learn from Strong ReasonersYuetai Li, Xiang Yue, Zhangchen Xu, Fengqing Jiang et al.ACL Findings 2025 · 5 citations
- Mentor-KD: Making Small Language Models Better Multi-step ReasonersHojae Lee, Junho Kim, SangKeun LeeEMNLP 2024
- Long-Chain Reasoning Distillation via Adaptive Prefix AlignmentZhenghao Liu, Zhuoyang Wu, Xinze Li, Yukun Yan et al.ACL 2026 · 4 citations
- SmartAD: Capacity-Aligned Agent Distillation for Small Language ModelsGuokai Tang, Feng ZhaoACL Findings 2026
