atlas

Research map / Large language models / Reasoning and chain of thought

Distilling LLM Agent into Small Models with Retrieval and Code Tools

NeurIPS 2025 · Large language models › Reasoning and chain of thought · approach: Search and self-correction in reasoning · 1 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Distills LLM agent trajectories (thought-code-observation with retrieval and code tools) into small Qwen2.5 models using a first-thought prefix for teacher trajectories and self-consistent action generation at test time, matching next-tier larger CoT-distilled models.

Problem

Small language models hallucinate on rare factual knowledge and precise computation; CoT distillation does not teach them to use tools, so they fail on out-of-distribution knowledge and calculation tasks.

Approach

Distill full agent trajectories (reason-act-observe with Wikipedia retrieval and Python code execution, CodeAct style) from a 32B teacher into 0.5B-7B students, improve teacher trajectories by prefixing the agent's first thought with a CoT first step, and at test time sample multiple actions per step, filter failed code, and pick the majority-consistent observation.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
distill reason-act-observe agent trajectories instead of static CoT tracesQwen2.5-1.5B-Instruct · Average across 8 tasksaverage score: 21.28 -> 30.55Helped
add first-thought prefix to teacher agent trajectories (ablation)Qwen2.5-1.5B-Instruct agent distillation · Average across 8 tasksaverage score: 28.06 -> 29.11Helped
add self-consistent action generation (ablation)Qwen2.5-1.5B-Instruct agent distillation · Average across 8 tasksaverage score: 28.06 -> 30.29Helped
add both first-thought prefix and self-consistent action generation (ablation)Qwen2.5-1.5B-Instruct agent distillation · Average across 8 tasksaverage score: 28.06 -> 30.55Helped
add first-thought prefix to teacher agent trajectories (ablation)Qwen2.5-3B agent distillation · MATH500exact match: 54.0 -> 54.4Helped
add self-consistent action generation (ablation)Qwen2.5-3B agent distillation · MATH500exact match: 54.0 -> 57.4Helped
add first-thought prefix to teacher agent trajectories (ablation)Qwen2.5-0.5B agent distillation · BamboogleLLM-as-a-judge score: 17.6 -> 24.0Helped
add first-thought prefix to teacher agent trajectories (ablation)Qwen2.5-1.5B agent distillation · MuSiQueLLM-as-a-judge score: 9.0 -> 8.0Hurt
use Qwen2.5-Coder-32B-Instruct as the teacher instead of the general 32B model (ablation)Qwen2.5-1.5B agent distillation · Average across 8 tasksaverage score: 30.55 -> 30.91Helped
use a code-specific student instead of a general student (ablation)Qwen2.5-1.5B agent distillation · Average across 8 tasksaverage score: 30.55 -> 29.52Hurt
set SAG temperature to 1.0 instead of 0.4 (ablation)Qwen2.5-1.5B-Instruct agent · Average across math benchmarksaverage score: 30.59 -> 31.24Helped
replace LoRA with full fine-tuning (ablation)Qwen2.5-1.5B-Instruct agent distillation · Average across 8 tasksaverage score: 29.11 -> 26.24Hurt

Surprising findings

Limitations

Experimental setup

Datasets: HotPotQA MATH Bamboogle MuSiQue 2WikiMultiHopQA GSM-Hard AIME OlymMATH Wikipedia 2018

Benchmarks: HotPotQA MATH500 MuSiQue Bamboogle 2WikiMultiHopQA GSM-Hard AIME OlymMATH

Metrics: accuracy exact match average accuracy code parse error rate code execution error rate retrieval call count token count

Baselines: CoT prompting CoT distillation CoT distillation + RAG agent prompting self-consistency CoT FireAct

Builds on: CodeAct ReAct reasoning distillation (CoT distillation) self-consistency smolagents

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy