Lifting the Curse of Capacity Gap in Distilling Language Models

Chen Zhang, Yang Yang, Jiahao Liu, Jingang Wang, Yunsen Xian, Benyou Wang, Dawei Song

Abstract

Knowledge Distillation (KD) is the primary technique for compressing large-scale Pretrained Language Models (LMs) into efficient student models. However, recent research identifies a "Curse of Capacity Gap": when the architectural disparity between a massive teacher and a tiny student is too large, the student's performance often degrades compared to when it is trained by a smaller teacher. This paper introduces MiniMoE (Mixture of Minimal Experts), a method that increases a student's parameter capacity through sparse activation while keeping inference compute (FLOPs) nearly constant. By decoupling model size from computational cost, MiniMoE effectively "lifts" the capacity gap curse, allowing small models to finally benefit from giant teachers.

1. Introduction: The Curse of Capacity Gap

In the paradigm of Knowledge Distillation, the prevailing assumption is that a more capable teacher will inevitably produce a more capable student. However, as teacher models scale into the hundreds of billions of parameters, researchers have observed a counter-intuitive phenomenon. When a student model is significantly smaller (e.g., a 3-layer transformer) than its teacher (e.g., BERT-large), the student lacks the "expressive power" to approximate the teacher's complex knowledge.

This "Curse of Capacity Gap" creates a performance ceiling for model compression. Instead of learning more effectively from a superior source, the student's performance often regresses. This suggests that the bottleneck in distillation is not the quality of the teacher's signal, but the student's inability to store and process that signal within its limited parameter budget.

2. Methodology: MiniMoE

To address this, the authors propose MiniMoE (Mixture of Minimal Experts). The core philosophy is to provide the student with more "room" to learn without increasing the time it takes to process a token.

2.1 Sparse Activation and Minimal Experts

MiniMoE replaces standard Feed-Forward Network (FFN) blocks with a Mixture of Experts (MoE) structure. Unlike traditional MoE, which often uses large experts, MiniMoE utilizes "minimal experts" to keep the overall architecture lightweight.

2.2 Top-One Gating and Load Balancing

To maintain inference efficiency, MiniMoE employs a Top-One Gating mechanism. For every token, a routing algorithm selects only the single most relevant expert to activate. This ensures that while the total parameter count of the model increases (allowing for higher capacity), the inference FLOPs (Floating Point Operations) remain identical to a dense model of the same depth and width. To prevent "expert collapse"—where the model relies on only a few experts—a differentiable load-balancing loss is applied during training to ensure all experts are utilized equally.

2.3 Task-Agnostic Distillation

MiniMoE is designed to be distilled during the pre-training phase on large corpora like Wikipedia. This makes the resulting model a general-purpose backbone that can be fine-tuned for various downstream tasks, rather than a task-specific solution.

3. Theoretical Framework

The paper justifies MiniMoE using the lens of VC dimension theory. In distillation, the total error can be decomposed into approximation error (how well the student can fit the teacher) and estimation error (how well the student does fit the teacher given finite data).

Increasing teacher capacity typically reduces the approximation error but can inadvertently spike the estimation error if the student is too small to handle the complexity. MiniMoE effectively lowers the estimation error by expanding the student's hypothesis space (capacity) without the computational penalty usually associated with larger models.

4. Experimental Evaluation

4.1 Datasets and Setup

The authors evaluated MiniMoE across several benchmarks:

  • GLUE Benchmark: A suite of diverse natural language understanding tasks (SST-2, MRPC, STS-B, QQP, MNLI, QNLI, and RTE).
  • CoNLL-2003: A standard task for Named Entity Recognition (NER).
  • CLUE: Used to validate the findings on Chinese language models (Chinese BERT-base vs. BERT-xlarge).

4.2 Key Results

  • Lifting the Curse: On the GLUE benchmark, a standard 3-layer dense MiniLM actually performs worse when distilled from BERT-large compared to BERT-base (a drop of -0.5 points). MiniMoE reverses this trend, achieving a +0.5 point increase when moving to the larger teacher.
  • State-of-the-Art Efficiency: MiniMoE achieves SOTA performance at small FLOP scales. Even at a 50x compression ratio relative to the teacher, MiniMoE preserves approximately 95% of the teacher's GLUE score.
  • Practical Throughput: Despite the increased parameter count, MiniMoE maintains high throughput. On GPU hardware, a 3-layer MiniMoE achieved ~433 tokens/ms, compared to ~485 tokens/ms for its dense counterpart, demonstrating that the sparse routing overhead is minimal in practice.

5. Discussion and Limitations

While MiniMoE successfully addresses the capacity gap, it introduces a new tradeoff: Memory Footprint. Because the model contains multiple experts, it requires more VRAM to store parameters than a dense model with the same FLOP count.

Furthermore, the authors note that while MiniMoE helps bridge the gap, it still faces challenges at "extreme" compression ratios (e.g., 1000x). This suggests that there is a fundamental limit to how much knowledge can be distilled into a single model, even with sparse architectures. Future work may explore combining MiniMoE with techniques like Singular Value Decomposition (SVD) to compress the experts themselves, potentially reducing the memory overhead while retaining the capacity benefits.

Summary updated

BibTeX
@inproceedings{zhang2023lifting,
  author = {Chen Zhang and Yang Yang and Jiahao Liu and Jingang Wang and Yunsen Xian and Benyou Wang and Dawei Song},
  title = {{Lifting the Curse of Capacity Gap in Distilling Language Models}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2023},
  doi = {10.18653/v1/2023.acl-long.249},
}
Figure