Training Agents 2: Live tutorial on model distillation for training custom agents.
Summary
This live session will cover how to transfer capability from a teacher model to a smaller student through distillation. It details supervised fine-tuning on teacher-generated data (off-policy), on-policy and online methods where the teacher scores the student live, and self-distillation where the model teaches itself. The tutorial will explore distillation's four organizing axes: signal, data source, timing, and teacher identity, alongside white-box versus black-box approaches. It also frames distillation as reinforcement learning, utilizing Kullback-Leibler (KD) distance as a dense, token-level reward. All discussed methods are implemented within the TRL framework, part of the Training Agents series.
Key takeaway
For AI Engineers developing custom agents, understanding model distillation is crucial for optimizing performance and resource usage. You should explore off-policy, on-policy, and self-distillation techniques within frameworks like TRL to transfer capabilities from larger models to more efficient student agents. Consider self-distillation when aiming to improve agent performance without relying on external, stronger teachers.
Key insights
Model distillation transfers capabilities from large teacher models to smaller student models using various on-policy, off-policy, and self-distillation techniques.
Principles
- Distillation has four axes: signal, data source, timing, teacher identity.
- Self-distillation can outperform stronger teacher models.
- KD distance can serve as a token-level reward in RL.
Method
Distillation involves supervised fine-tuning on teacher-generated data (off-policy), or on-policy scoring by a teacher in a live loop, or self-distillation where the model teaches itself, all implementable in TRL.
In practice
- Use TRL for implementing distillation methods.
- Apply off-policy SFT with teacher outputs.
- Explore self-distillation for agent training.
Topics
- Model Distillation
- Agent Training
- Reinforcement Learning
- Supervised Fine-tuning
- TRL Framework
- HuggingFace
Code references
Best for: Machine Learning Engineer, AI Engineer, AI Scientist
Related on AIssential
Editorial summary, takeaway, and curation by AIssential. Original article published by HuggingFace.