Reweighted Proximal Pruning for Large-Scale Language Representation

Fu-Ming Guo, Sijia Liu, Finlay S. Mungall, Xue Lin, Yanzhi WangarXiv 2019

Abstract

Large-scale pre-trained language models like BERT have revolutionized natural language processing but present significant deployment challenges due to their immense size. Traditional weight pruning techniques often lead to non-convergence or substantial accuracy drops in deep architectures. This paper proposes Reweighted Proximal Pruning (RPP), a novel compression technique that decouples the sparsity-promoting operation from the gradient calculation of the training loss. RPP achieves approximately 60% weight sparsity in BERT-Base with zero performance degradation, maintaining the model's transfer learning capabilities across diverse downstream tasks.

Introduction

The advent of massive pre-trained models such as BERT, GPT, and XLNet has set new benchmarks in NLP. However, these models typically contain hundreds of millions of parameters, making them impractical for resource-constrained environments like mobile devices or edge hardware.

Standard pruning methods often employ $\ell_1$ or $\ell_2$ regularization, adding a penalty term directly to the loss function. In "super-deep" networks, this penalty interferes with complex gradient updates, frequently resulting in training failure or significant performance loss. The challenge lies in compressing these models while preserving their ability to be fine-tuned effectively for various downstream applications.

Methodology: Reweighted Proximal Pruning (RPP)

To address the limitations of traditional regularization, the authors introduce RPP, which integrates two primary components into the AdamW optimizer:

  1. Reweighted $\ell_1$ Minimization: Unlike standard $\ell_1$ pruning that penalizes all weights uniformly, RPP applies a weighting factor inversely proportional to weight magnitude. This ensures that large, critical weights are preserved while smaller, less significant weights are aggressively pushed toward zero.
  2. The Proximal Operator: This mathematical step decouples the search for sparsity from the model's training gradients. By applying the proximal operator separately from the backpropagation update, RPP prevents the sparsity penalty from "polluting" the gradients essential for learning robust language representations.
Overview of the RPP workflow, illustrating the transition from pre-training to universal sparsity and subsequent fine-tuning.

This approach allows the model to identify a "universal sparsity pattern" during pre-training that remains effective across multiple fine-tuning tasks.

Experimental Setup

The effectiveness of RPP was evaluated using standard large-scale NLP benchmarks:

  • Pre-training: Conducted on BooksCorpus (800M words) and English Wikipedia (2,500M words).
  • Downstream Evaluation: Performance was measured on the SQuAD (v1.1 and v2.0) question-answering datasets and the GLUE benchmark, which includes tasks such as MNLI (Inference), SST-2 (Sentiment), and CoLA (Linguistic Acceptability).

Results and Discussion

RPP demonstrates a significant advantage over traditional iterative pruning methods, particularly at high compression ratios.

Performance and Compression

The method achieved 59.3% weight sparsity in BERT-Base with virtually no loss in performance on either pre-training or downstream tasks. As shown in the performance analysis, RPP consistently outperforms the "New Iterative Pruning" (NIP) baseline. For instance, on SQuAD 1.1 at a 40% prune ratio, RPP maintained an F1 score of 88.5, whereas the NIP baseline dropped to 84.6.

Comparison of Accuracy/F1 scores between RPP and the NIP baseline across various tasks and prune ratios.

Emergent Structured Sparsity

An intriguing finding was that although RPP is an unstructured pruning method, it naturally produced structured patterns within the attention matrices. Specifically, column-wise sparsity emerged in Query matrices and row-wise sparsity in Key matrices. This suggests that BERT's internal representations are inherently structured, which could be leveraged for hardware-specific acceleration.

Task Sensitivity

The impact of pruning varied by task complexity. SQuAD proved to be the most sensitive to parameter reduction, likely due to its higher difficulty. Conversely, simpler classification tasks within the GLUE benchmark could withstand up to 80% pruning while retaining over 80% of their original performance.

Conclusion

Reweighted Proximal Pruning offers a robust solution for compressing large-scale language models without sacrificing accuracy. By decoupling sparsity search from gradient updates, RPP overcomes the convergence issues typical of deep network pruning. While the current work focuses on algorithmic efficiency and identifies hardware-friendly sparsity patterns, future research will explore specialized hardware kernels to translate these theoretical gains into real-world speedups on mobile and edge devices.

Summary updated

BibTeX
@misc{guo2019reweighted,
  author = {Fu-Ming Guo and Sijia Liu and Finlay S. Mungall and Xue Lin and Yanzhi Wang},
  title = {{Reweighted Proximal Pruning for Large-Scale Language Representation}},
  year = {2019},
  eprint = {1909.12486},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1909.12486},
}
Figure