Extreme Compression for Pre-trained Transformers Made Simple and Efficient

Xiaoxia Wu, Zhewei Yao, Minjia Zhang, Conglong Li, Yuxiong He
6/4/2022
cs.CLcs.LG
transformer-attentiondistillation

Official code: deepspeedai/DeepSpeed (43,323 stars, Python, Apache-2.0, PyTorch, last commit 2026-04-29).

Abstract

Extreme compression, particularly ultra-low bit precision (binary/ternary) quantization, has been proposed to fit large NLP models on resource-constraint devices. However, to preserve the accuracy for such aggressive compression schemes, cutting-edge methods usually introduce complicated compression pipelines, e.g., multi-stage expensive knowledge distillation with extensive hyperparameter tuning.

Show full abstract

Also, they oftentimes focus less on smaller transformer models that have already been heavily compressed via knowledge distillation and lack a systematic study to show the effectiveness of their methods. In this paper, we perform a very comprehensive systematic study to measure the impact of many key hyperparameters and training strategies from previous works. As a result, we find out that previous baselines for ultra-low bit precision quantization are significantly under-trained. Based on our study, we propose a simple yet effective compression pipeline for extreme compression, named XTC. XTC demonstrates that (1) we can skip the pre-training knowledge distillation to obtain a 5-layer BERT while achieving better performance than previous state-of-the-art methods, e.g., the 6-layer TinyBERT; (2) extreme quantization plus layer reduction is able to reduce the model size by 50x, resulting in new state-of-the-art results on GLUE tasks.

View on arXivView PDF

Code Implementations(1)

PyTorchApache-2.0

DeepSpeed is a deep learning optimization library that makes distributed training and inference easy, efficient, and effective.

43,3235,074Python, C++Jan 23, 20207 months agoApache-2.0
billion-parameterscompressiondata-parallelismdeep-learninggpu+8 more

Similar Papers

Cite this paper

@article{wu2022extreme,
  title  = {Extreme Compression for Pre-trained Transformers Made Simple and Efficient},
  author = {Xiaoxia Wu and Zhewei Yao and Minjia Zhang and Conglong Li and Yuxiong He},
  year   = {2022},
  eprint = {2206.01859},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2206.01859}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2206.01859.svg)](https://codeofpaper.com/paper/2206.01859)

Discussion