TL;DR
SeTPO (Selective Teacher-guided Policy Optimization) enables small language models (SLMs) to master complex tool-use tasks by combining selective online teacher feedback with persistent demonstration supervision. By balancing these "bidirectional KL constraints," SLMs can overcome the limitations of standard reinforcement learning and even surpass the performance of their larger teacher models.
What Problem Does This Paper Address?
Small Language Models (SLMs) are ideal for edge deployment, but they often lack the inherent reasoning capabilities to use external tools effectively. Teaching them tool-use typically follows two paths, both of which have flaws:
- Supervised Fine-Tuning (SFT): Models learn from static demonstrations, leading to a "distribution mismatch" where the model struggles when its own generated text at inference time deviates from the training data.
- Reinforcement Learning (RL): Models explore on their own to maximize rewards. However, SLMs are often so limited that they fail to discover any successful behaviors during exploration, leaving them with no positive signals to learn from (the "struggle to obtain rewards" shown in Figure 1).
While on-policy distillation (OPD) attempts to bridge this by having a teacher score student attempts, it can inadvertently pass on teacher errors or fail to improve the student beyond the teacher's own biases.
Methods
The authors introduce SeTPO, which coordinates two types of supervision through bidirectional Kullback–Leibler (KL) constraints:
- Selective Teacher Guidance (Reverse-KL): Instead of micromanaging every student attempt, SeTPO only triggers teacher intervention when the student produces a low-reward trajectory. A frozen teacher model scores the student's generated tokens based on the student's own prefixes. This provides a fine-grained, token-level signal to refine the RL advantage, helping the student understand exactly where their tool call went wrong.
- Auxiliary Demonstration Supervision (Forward-KL): To ensure the model doesn't "forget" the basic structure of tool calls (like specific XML tags or JSON formats) during RL, a standard SFT loss remains active throughout training using high-quality teacher demonstrations.
The interplay is shown in Figure 2: the online guidance refines current exploration, while the demonstration supervision retains core behaviors.
Datasets
The researchers evaluated SeTPO using:
- ToolRL: A dataset comprising 400 expert examples for initial "cold-start" SFT and 4,000 examples for main training.
- BFCL-v4 (Berkeley Function Calling Leaderboard): A rigorous benchmark for evaluating how well models can call functions.
- API-Bank: A comprehensive benchmark for tool-augmented LLMs.
- GSM8K & HotpotQA: Used to ensure that tool-use training doesn't degrade the model's general mathematical and multi-hop reasoning abilities.
Key Insights and Ideas
- The "Goldilocks" Teacher: Bigger isn't always better. The authors found that a 1.5B teacher often provided better guidance for a 0.5B student than a 7B teacher did (see Figure 4). This suggests that a manageable "capacity gap" facilitates better knowledge transfer; if the teacher is too advanced, its reasoning might be too alien for the tiny student to replicate.
- Selective Intervention is Efficient: By only intervening on failures, the teacher intervention rate naturally drops as the student improves (Figure 3). This "adaptive" guidance focuses computational resources where the student is most confused.
- Format vs. Logic: Reinforcement learning alone often causes SLMs to lose their "formatting" grip—they might get the logic right but fail to output the required tags. The auxiliary SFT loss is crucial for maintaining stable output formats (Figure 6).
Key Results
- Superior Performance: Across 0.5B, 1.5B, and 3B scales, SeTPO consistently outperformed SFT, standard RL (GRPO), and pure distillation (OPD).
- Surpassing the Teacher: Remarkably, the Qwen2.5-3B student trained with SeTPO achieved 63.82% on API-Bank, outperforming its own 14B teacher (62.48%).
- Error Reduction: SeTPO significantly slashed errors in tool selection and argument construction. For the 0.5B model on BFCL-v4, it reduced parameter value/type errors by more than half compared to the baseline (Figure 5).
Limitations and Future Work
- Deterministic Rewards: The current system relies on a deterministic checker that requires reference calls. Extending this to open-ended environments where no "ground truth" call exists would require more complex reward modeling.
- Computational Overhead: Running a frozen teacher model to score student tokens during the RL loop increases the training cost compared to vanilla RL.
- Model Diversity: The study focused on the Qwen2.5 family. Future work could explore if these bidirectional constraints hold up as effectively across other architectures like Llama or Mistral.
Summary updated