SWITCH: Studying with Teacher for Knowledge Distillation of Large Language Models

Jahyun Koo, Yerin Hwang, Yongil Kim, Taegwan Kang, Hyunkyung Bae, Kyomin Jung

Introduction

Knowledge Distillation (KD) is a critical technique for deploying Large Language Models (LLMs) on resource-constrained devices. By training a smaller "student" model to replicate the behavior of a larger "teacher," we can achieve significant efficiency gains. Recent advancements have shifted toward using Student-Generated Outputs (SGOs) during training to bridge the gap between training and inference distributions. However, SGO-based distillation often suffers from Teacher Misguidance. When a student model generates a low-quality or hallucinated prefix, the teacher's subsequent feedback becomes noisy or irrelevant, leading to compounding errors—a problem that intensifies as sequence length increases.

The SWITCH Framework

To address these challenges, we introduce SWITCH (Studying WIth TeaCHer), a framework designed to prevent students from "learning the wrong lessons." SWITCH employs a selective intervention strategy where the teacher monitors the student's generation process and intervenes when the student begins to drift.

Overview of the SWITCH framework compared to standard SGO, highlighting how selective intervention prevents teacher misguidance.

The core of SWITCH consists of three components:

  1. Distribution Discrepancy Measurement: At each token step, the system calculates the Jensen-Shannon Divergence (JSD) between the teacher's and student's predicted probability distributions. JSD provides a symmetric and bounded metric to identify when the student's output deviates significantly from the teacher's expectations.
  2. Selective Intervention: If the measured discrepancy exceeds a threshold $\tau_t$, the teacher model takes over to generate the current token, grounding the sequence and providing a clean context for subsequent steps.
  3. Exponentially Decaying Threshold: Recognizing that errors accumulate over time in autoregressive generation, SWITCH uses a threshold that decays exponentially with sequence length: $\tau_t = \tau_0 \cdot e^{-\lambda t}$. This makes the teacher increasingly protective as the sequence grows, effectively mitigating the risk of long-range compounding errors.

Experimental Evaluation

We evaluated SWITCH across multiple model families, including GPT-2, OPT, and OpenLLaMA-2, using a variety of instruction-following benchmarks such as Dolly-15k, SelfInst, VicunaEval, and Super-Natural Instructions (S-NI).

Performance on Long Sequences

A key strength of SWITCH is its ability to maintain performance on long-form responses. While traditional SGO methods like MiniLLM and DistiLLM often see performance degradation as sequences lengthen, SWITCH remains robust.

Performance improvement (Δ Rouge-L) of SWITCH compared to other KD methods across different ground truth length ranges.

As shown in Figure 1, the performance gap between SWITCH and competing methods is most pronounced in the $11 \sim \infty$ token range. On the Dolly dataset, SWITCH achieved a Rouge-L of 26.2 for a 120M GPT-2 student, outperforming MiniLLM (23.8) and DistiLLM (25.6). Similar trends were observed for OPT and OpenLLaMA-2 models, where SWITCH consistently set new state-of-the-art results for student models of various sizes.

Discussion and Conclusion

SWITCH effectively bridges the capacity gap between large teachers and small students by "holding the student's hand" during difficult generation phases. Ablation studies indicate that the exponentially decaying threshold is vital; it balances student exploration with teacher guidance, typically resulting in the teacher generating approximately 53% of the training tokens.

While SWITCH introduces a computational overhead during training (approximately 1.84x slower than standard GKD due to the active teacher model), this cost is a one-time investment. The resulting student model maintains standard inference efficiency while exhibiting significantly higher instruction-following accuracy and reduced hallucination rates. Future work will explore more sophisticated intervention triggers beyond distribution discrepancy to further refine the distillation process.

Summary updated

BibTeX
@inproceedings{koo2025switch,
  author = {Jahyun Koo and Yerin Hwang and Yongil Kim and Taegwan Kang and Hyunkyung Bae and Kyomin Jung},
  title = {{SWITCH: Studying with Teacher for Knowledge Distillation of Large Language Models}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2025},
  doi = {10.18653/v1/2025.findings-naacl.206},
}
Figure