On-policy agent distillation lands in TRL: Qwen3.5-9B distilled to 2B agent

SergioPaniego · x · 2026-12-01

Hugging Face TRL now ships an on-policy distillation example for agents: a small student agent practices in the same environments used for RL, while a larger self-hosted model scores every step it takes.

The example distills Qwen3.5-9B into Qwen3.5-2B as a data-analysis agent: the student works over up to 10 turns on real CSV/TSV/JSON files in a live Python session, and the teacher scores every token. On 61 checked tasks, accuracy rises from 0.19 to 0.29 with first-turn-only distillation and 0.35 with whole-episode distillation, consistent across three seeds.

Motivation: most distillation recipes target single answers, but an agent's answer is an episode—what it writes on turn three depends on the session history—hence on-policy scoring over full trajectories.

Original post →

More from coding & agent

coding & agent channel →