SOTAVerified

Prune Once for All: Sparse Pre-Trained Language Models

2021-11-10Unverified0· sign in to hype

Ofir Zafrir, Ariel Larey, Guy Boudoukh, Haihao Shen, Moshe Wasserblat

Unverified — Be the first to reproduce this paper.

Reproduce

Abstract

Transformer-based language models are applied to a wide range of applications in natural language processing. However, they are inefficient and difficult to deploy. In recent years, many compression algorithms have been proposed to increase the implementation efficiency of large Transformer-based models on target hardware. In this work we present a new method for training sparse pre-trained Transformer language models by integrating weight pruning and model distillation. These sparse pre-trained models can be used to transfer learning for a wide range of tasks while maintaining their sparsity pattern. We demonstrate our method with three known architectures to create sparse pre-trained BERT-Base, BERT-Large and DistilBERT. We show how the compressed sparse pre-trained models we trained transfer their knowledge to five different downstream natural language tasks with minimal accuracy loss. Moreover, we show how to further compress the sparse models' weights to 8bit precision using quantization-aware training. For example, with our sparse pre-trained BERT-Large fine-tuned on SQuADv1.1 and quantized to 8bit we achieve a compression ratio of 40X for the encoder with less than 1\% accuracy loss. To the best of our knowledge, our results show the best compression-to-accuracy ratio for BERT-Base, BERT-Large, and DistilBERT.

Tasks

Benchmark Results

DatasetModelMetricClaimedVerifiedStatus
MultiNLI DevDistilBERT-uncased-PruneOFA (90% unstruct sparse, QAT Int8)Matched78.8Unverified
MultiNLI DevBERT-Large-uncased-PruneOFA (90% unstruct sparse)Matched83.74Unverified
MultiNLI DevBERT-Large-uncased-PruneOFA (90% unstruct sparse, QAT Int8)Matched83.47Unverified
MultiNLI DevBERT-Base-uncased-PruneOFA (85% unstruct sparse)Matched82.71Unverified
MultiNLI DevBERT-Base-uncased-PruneOFA (90% unstruct sparse)Matched81.45Unverified
MultiNLI DevBERT-Base-uncased-PruneOFA (85% unstruct sparse, QAT Int8)Matched81.4Unverified
MultiNLI DevDistilBERT-uncased-PruneOFA (85% unstruct sparse)Matched81.35Unverified
MultiNLI DevDistilBERT-uncased-PruneOFA (90% unstruct sparse)Matched80.68Unverified
MultiNLI DevDistilBERT-uncased-PruneOFA (85% unstruct sparse, QAT Int8)Matched80.66Unverified

Reproductions