MiniDisc: Minimal Distillation Schedule for Language Model Compression

Chen Zhang, Yang Yang, Qifan Wang, Jiahao Liu, Jingang Wang, Wei Wu, Dawei SongarXiv 2022

TL;DR

Distilling massive language models directly into tiny student models often fails due to a massive capacity gap. While using an intermediate "Teacher Assistant" (TA) helps bridge this gap, finding the right TA size typically requires an expensive, brute-force trial-and-error search. This paper introduces MINIDISC, a framework that identifies and optimizes the perfect Teacher Assistant in just a single training run, delivering a 10x efficiency boost without sacrificing student performance.

What Problem Does This Paper Address?

Knowledge Distillation (KD) is a popular strategy for compressing large pretrained language models into smaller, production-friendly versions. However, when trying to achieve extreme compression (e.g., shrinking a model down to 5% or 10% of its original size), the massive capacity gap between the teacher and the student causes standard distillation to break down.

To fix this, researchers use a "Teacher Assistant" (TA)—an intermediate-sized model that learns from the teacher and then teaches the student. The catch? The student's final performance is highly sensitive to the scale and structure of this TA. Finding the optimal TA has traditionally required an exhaustive search (dubbed MAXIDISC by the authors), where researchers train dozens of different TA candidates and distill each one to a student model to see which one wins. This process is computationally prohibitive for large-scale models.

Figure 1: The impact of teacher assistants of different scales and performance on the performance of students. In the study, a BERTbase model is used as the teacher and distilled to a pruned student (10% parameters of the teacher) via different teacher assistants (Mirzadeh et al., 2020) on MRPC and QQP. There are several observa- tions: (1) The blue curve shows that the performance of the teacher assistant degrades with the decreasing of its scale, which is obvious. (2) The green curve vali- dates that the performance of the student varies with different teacher assistants. (3) The red curve represents λ-tradeoff of the teacher assistant, which is positively correlated with the performance of the student.

Methods

The authors propose MINIDISC (Minimal Distillation Schedule), which finds the optimal TA in a single trial using a three-stage Sandwich Framework:

  1. Specification (Gridding & Pruning): The continuous scale space between the teacher and student is discretized into $n$ intervals (gridding). To give these scales a physical structure, the authors use global structural pruning on the teacher model, removing the least important attention heads and feed-forward network (FFN) neurons.
  2. Optimization (Parameter-Sharing & Sandwiching): Instead of training each TA candidate separately, MINIDISC exploits the Incremental Property: because of how pruning works, smaller candidates are exact structural subsets of larger candidates. This allows all candidates to be packed into a single, parameter-sharing model. To save compute, they use sandwich-optimization, sub-sampling only a few candidates ($\eta$) during each training step.
  3. Selection ($\lambda$-tradeoff Metric): To avoid having to distill every candidate to a student, the authors introduce the $\lambda$-tradeoff metric: $$t_a = m_a + \lambda \cdot (1 - s_a)$$ where $m_a$ is the TA's performance and $s_a$ is its scale. They empirically prove that the TA maximizing this metric yields the best student performance. A simple linear scan selects the winning TA, which is then distilled into the final student.
Figure 2: An overview of MINIDISC by contrasting it to MAXIDISC, where one arrow denotes a distillation step. MINIDISC uses only one trial while MAXIDISC uses many trials to schedule the optimal teacher assistant.

Datasets

The framework was evaluated on:

  • GLUE Benchmark: Specifically evaluating on seven core tasks: SST-2, MRPC, STS-B, QQP, MNLI, QNLI, and RTE. (CoLA and WNLI were excluded due to known evaluation inconsistencies common in pruned models).
  • Wikipedia: Used as the corpus for task-agnostic (pretraining-stage) distillation experiments.
  • Alpaca Dataset: Used as distillation data for the LLaMA2 experiments.

Key Insights and Ideas

  • The Non-Monotonic Tradeoff: Student performance does not scale linearly with TA size. As shown in Figure 1, making a TA larger eventually hurts the student because the capacity gap widens again. There is a distinct "sweet spot" turning point.
  • Nested Architectures Enable Single-Run Training: Because the pruned structures are perfectly nested (Candidate $A \subset$ Candidate $B$), an entire spectrum of TAs can be optimized simultaneously within the memory footprint of just the largest candidate.
  • One TA is Enough: The authors experimented with scheduling multiple sequential TAs (e.g., Teacher $\rightarrow$ TA1 $\rightarrow$ TA2 $\rightarrow$ Student). Surprisingly, adding more TAs yielded no noticeable performance gains over a single, optimally selected TA, confirming that a single well-chosen intermediary is sufficient.

Key Results

  • 10x Efficiency Boost: MINIDISC consistently matched or outperformed the exhaustive brute-force search (MAXIDISC) while requiring only 4x GPU hours compared to MAXIDISC's 40x GPU hours.
  • Superior Extreme Compression: When compressing $\text{BERT}_{\text{base}}$ down to a tiny 5% student model on GLUE, MINIDISC achieved an average score of 80.1, outperforming standard TA distillation (79.2) and conventional direct distillation (78.7).
  • Excellent Scalability: The method scales seamlessly to billion-parameter models. Compressing the 1.5-billion-parameter $\text{EncT5}_{\text{xl}}$ model down to 10% scale, MINIDISC achieved a GLUE average of 86.9, beating the standard TA baseline (86.3). It also demonstrated strong performance when compressing $\text{LLaMA2}_{\text{7B}}$.

Limitations and Future Work

  • $\lambda$ Hyperparameter Dependency: The $\lambda$-tradeoff metric relies on a weighting hyperparameter ($\lambda$), which was fixed to 0.2 across their main experiments. While results are stable across a reasonable range ($0.1$ to $0.3$), it still requires manual calibration. The authors proposed a hyperparameter-free variant ("Negative Derivative-Tradeoff") in the appendix, but note that it suffers from high estimation variance and needs further research.
  • Sub-optimal Pruned Structures: Using rigid gridding and magnitude-based pruning to define the TA structures ensures the parameter-sharing property holds, but it might miss more optimal, non-nested model architectures that a full Neural Architecture Search (NAS) could discover.

Summary updated

BibTeX
@misc{zhang2022minidisc,
  author = {Chen Zhang and Yang Yang and Qifan Wang and Jiahao Liu and Jingang Wang and Wei Wu and Dawei Song},
  title = {{MiniDisc: Minimal Distillation Schedule for Language Model Compression}},
  year = {2022},
  eprint = {2205.14570},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2205.14570},
}

Loading related content...

Figure