Our new X account is live! Follow @wizwand_team for updates
WorkDL logo mark

Structured Pruning Learns Compact and Accurate Models

About

The growing size of neural language models has led to increased attention in model compression. The two predominant approaches are pruning, which gradually removes weights from a pre-trained model, and distillation, which trains a smaller compact model to match a larger one. Pruning methods can significantly reduce the model size but hardly achieve large speedups as distillation. However, distillation methods require large amounts of unlabeled data and are expensive to train. In this work, we propose a task-specific structured pruning method CoFi (Coarse- and Fine-grained Pruning), which delivers highly parallelizable subnetworks and matches the distillation methods in both accuracy and latency, without resorting to any unlabeled data. Our key insight is to jointly prune coarse-grained (e.g., layers) and fine-grained (e.g., heads and hidden units) modules, which controls the pruning decision of each parameter with masks of different granularity. We also devise a layerwise distillation strategy to transfer knowledge from unpruned to pruned models during optimization. Our experiments on GLUE and SQuAD datasets show that CoFi yields models with over 10x speedups with a small accuracy drop, showing its effectiveness and efficiency compared to previous pruning and distillation approaches.

Mengzhou Xia, Zexuan Zhong, Danqi Chen• 2022

Related benchmarks

TaskDatasetResultRank
Natural Language UnderstandingGLUE (dev)
SST-2 (Acc)90.4
504
Natural Language UnderstandingGLUE (test)
SST-2 Accuracy88.2
416
Question AnsweringSQuAD v1.1 (dev)
F1 Score82.6
375
Natural Language UnderstandingGLUE (val)
SST-293
170
Question AnsweringSQuAD v1.1 (val)--
70
Natural Language InferenceMNLI (test)
Accuracy0.849
38
Question AnsweringSQuAD (val)
F1 Score89.1
26
PruningMNLI
Epochs40
5
Natural Language UnderstandingGLUE (val test)
SST-2 Accuracy86.8
3
Showing 9 of 9 rows

Other info

Code

Follow for update