Q8BERT: Quantized 8Bit BERT
Ofir Zafrir, Guy Boudoukh, Peter Izsak et al. · 2019
Recently, pre-trained Transformer [1] based language models such as BERT [2] and GPT [3], have shown great improvement in many Natural Language Processing (NLP) tasks. However, these models contain a large amount of parameters. The emergence of even larger and more accurate models such as GPT2 [4] and Megatron11https://github.com/NVIDIA/Megatron-LM, suggest a trend of large pre-trained Transformer models. However, using these large models in production environments is a complex task requiring a large amount of compute, memory and power resources. In this work we show how to perform quantization-aware training during the fine-tuning phase of BERT in order to compress BERT by 4x with minimal accuracy loss. Furthermore, the produced quantized model can accelerate inference speed if it is optimized for 8bit Integer supporting hardware.
Cited by 441 works. doi:10.1109/emc2-nips53020.2019.00016 Open-access PDF
Authors
References
- Very Deep Convolutional Networks for Large-Scale Image Recognition
- Attention Is All You Need
- BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
- SQuAD: 100,000+ Questions for Machine Comprehension of Text
- Improving the speed of neural networks on CPUs
- Deep Compression: Compressing Deep Neural Networks with Pruning, Trained Quantization and Huffman Coding
- GLUE: A Multi-Task Benchmark and Analysis Platform for Natural Language Understanding
- GLUE: A Multi-Task Benchmark and Analysis Platform for Natural Language Understanding
- Quantization and Training of Neural Networks for Efficient Integer-Arithmetic-Only Inference
- Cross-lingual Language Model Pretraining