Introduction
In traditional machine learning, model pruning is often viewed as a regularization technique. By removing redundant weights, a model becomes simpler and, theoretically, less prone to overfitting. However, as deep learning has shifted toward the pretrain-and-finetune paradigm (exemplified by models like BERT), this "conventional wisdom" is being challenged.
This paper demonstrates that for Transformer-based models, pruning during the fine-tuning phase actually increases the risk of overfitting. To address this, the authors propose Sparse Progressive Distillation (SPD), a novel framework that achieves high performance even at extreme sparsity levels by preserving essential pre-trained knowledge.
The Overfitting Paradox in Transfer Learning
The authors argue that pruning in modern NLP is fundamentally different from pruning a model trained from scratch. When a pre-trained model is fine-tuned on a specific task, it possesses two layers of information: general-purpose linguistic knowledge from pre-training and task-specific knowledge from the downstream data.
As shown in the figure above, pruning a fine-tuned model doesn't just remove noise; it discards the "knowledge buffer" that helps the model generalize. Because downstream datasets are often small, removing these parameters makes the model more likely to memorize training noise rather than learn robust features. This leads to a significant performance drop and a high risk of overfitting.
Empirical Evidence of Overfitting
To validate this hypothesis, the authors tracked the accuracy of models on both training and development sets across various sparsity levels. The results confirm a striking trend: as sparsity increases, the gap between training performance and validation performance widens dramatically.
At 95% sparsity, the model achieves near-perfect training accuracy while development accuracy plummets, indicating that the sparse sub-network has effectively lost its ability to generalize from its pre-trained foundations.
Sparse Progressive Distillation (SPD)
To mitigate this, the authors introduced Sparse Progressive Distillation (SPD), which rests on three pillars:
- Layer-wise Knowledge Distillation (KD): Instead of only mimicking the final output, the sparse "student" model is forced to replicate the hidden states and attention matrices of the dense "teacher" model at every layer. This ensures the student retains the internal representations of the pre-trained teacher.
- Progressive Module Grafting: This technique treats the teacher as a "rootstock" and the sparse student modules as "scions." During training, teacher layers are progressively replaced by student layers with an increasing probability. This gradual transition allows the student modules to learn to coordinate with the rest of the network before the teacher is fully removed.
- Error-bound Analysis: The paper provides theoretical grounding, showing that a sparse sub-network can achieve accuracy comparable to the dense teacher if the weight distribution is carefully managed.
Key Results and Insights
The SPD method was evaluated on the GLUE benchmark, yielding several significant findings:
- Superiority over the Teacher: At 50% sparsity, SPD actually outperformed the original dense teacher model by an average of 1.1% across GLUE tasks.
- Resilience at Extreme Sparsity: At 90% and 95% sparsity, SPD significantly outperformed existing methods like TinyBERT and SparseBERT. For instance, on the CoLA dataset at 90% sparsity, SPD achieved an MCC of 48.7, whereas SparseBERT trailed at 18.1.
- Data Efficiency: Unlike many distillation methods, SPD does not require massive data augmentation to achieve these results, making it more practical for tasks with limited data.
Conclusion
The "overfitting paradox" identified in this paper highlights a critical challenge in compressing modern NLP models. By recognizing that pruning discards essential pre-trained knowledge, the authors' Sparse Progressive Distillation framework provides a robust path forward for creating efficient, high-performing sparse models without sacrificing the generalization power of the pretrain-and-finetune paradigm.
Summary updated