[Paper Review] Rethinking Network Pruning -- under the Pre-train and Fine-tune Paradigm
This paper proposes SparseBERT, a knowledge-aware sparse pruning method that applies pruning during the fine-tuning phase of BERT, using knowledge distillation from a fine-tuned teacher model to preserve both general and task-specific knowledge. It achieves 20× parameter and FLOPs compression with only 1.4% average accuracy drop on GLUE, outperforming prior methods including structural pruning and distillation-based models.
Transformer-based pre-trained language models have significantly improved the performance of various natural language processing (NLP) tasks in the recent years. While effective and prevalent, these models are usually prohibitively large for resource-limited deployment scenarios. A thread of research has thus been working on applying network pruning techniques under the pretrain-then-finetune paradigm widely adopted in NLP. However, the existing pruning results on benchmark transformers, such as BERT, are not as remarkable as the pruning results in the literature of convolutional neural networks (CNNs). In particular, common wisdom in pruning CNN states that sparse pruning technique compresses a model more than that obtained by reducing number of channels and layers (Elsen et al., 2020; Zhu and Gupta, 2017), while existing works on sparse pruning of BERT yields inferior results than its small-dense counterparts such as TinyBERT (Jiao et al., 2020). In this work, we aim to fill this gap by studying how knowledge are transferred and lost during the pre-train, fine-tune, and pruning process, and proposing a knowledge-aware sparse pruning process that achieves significantly superior results than existing literature. We show for the first time that sparse pruning compresses a BERT model significantly more than reducing its number of channels and layers. Experiments on multiple data sets of GLUE benchmark show that our method outperforms the leading competitors with a 20-times weight/FLOPs compression and neglectable loss in prediction accuracy.
Motivation & Objective
- To address the gap in sparse pruning effectiveness for pre-trained language models like BERT, where sparse pruning underperforms structural pruning.
- To preserve both general-purpose language knowledge from pre-training and task-specific knowledge from fine-tuning during pruning.
- To demonstrate that sparse pruning can achieve significantly higher compression than channel/layer reduction in BERT.
- To develop a pruning strategy that maintains high performance under extreme sparsity, especially in resource-limited settings.
- To validate the method on standard benchmarks (GLUE, SQuAD) and hardware platforms supporting sparse inference.
Proposed method
- Pruning is applied during the fine-tuning stage, using the pre-trained BERT as the student model and the fine-tuned BERT as the teacher.
- Knowledge distillation is used to transfer task-specific knowledge from the teacher to the pruned student model via logit distillation and loss minimization.
- Sparsity is applied to linear transformations in self-attention and feed-forward layers, which are identified as overparameterized and computation-heavy components.
- The method avoids pruning attention heads or embedding layers to preserve structural and representational integrity.
- The pruning process is integrated into the fine-tuning loop, allowing joint optimization of sparsity and performance.
- Hardware evaluation is conducted on Moffett AI’s ANTOM platform with native sparse tensor support to measure real-world inference speedup.
Experimental results
Research questions
- RQ1Can sparse pruning achieve higher compression than structural pruning (e.g., channel reduction) in BERT under the pre-train and fine-tune paradigm?
- RQ2How can knowledge from both pre-training and fine-tuning be preserved during pruning to avoid performance degradation?
- RQ3Does knowledge distillation during fine-tuning enable effective sparse pruning while maintaining high accuracy at extreme sparsity?
- RQ4How does the performance of sparse pruning compare to pruning at pre-training or at fine-tuning without distillation?
- RQ5What is the real hardware inference speedup of sparse BERT models on platforms with native sparse tensor support?
Key findings
- SparseBERT achieves 20× compression (5% remaining parameters) on BERT-base with only 1.4% average accuracy drop across GLUE dev sets.
- On the MRPC dataset, SparseBERT reduces parameters from 85.53M to 4.84M and FLOPs from 10.87 GFLOPs to 0.54 GFLOPs, achieving 20× compression.
- SparseBERT outperforms all leading competitors, including TinyBERT, DistilBERT, and BERT-of-Theseus, on GLUE benchmarks at comparable or lower sparsity.
- On SQuAD v1.1 and v2.0, SparseBERT consistently outperforms pruning applied at the downstream fine-tuning stage, especially at high sparsity levels.
- On Moffett AI’s ANTOM hardware, SparseBERT achieves over 10× inference speedup at 20× compression, with near-linear speedup up to 4× compression.
- SparseBERT shows better fitting ability than pruning at pre-training, as evidenced by lower training loss and higher dev set accuracy on RTE at equivalent sparsity.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.