Teacher Intervention: Improving Convergence of Quantization Aware Training for Ultra-Low Precision Transformers

Minsoo Kim, Kyuhong Shim, Seongmin Park, Wonyong Sung, Jungwook Choi
2/23/2023
cs.CLcs.AI

No official code found. Best implementation: MarsJacobs/ti-kd-qat (7 stars, PyTorch, last commit 2023-04-08).

Abstract

Pre-trained Transformer models such as BERT have shown great success in a wide range of applications, but at the cost of substantial increases in model complexity. Quantization-aware training (QAT) is a promising method to lower the implementation cost and energy consumption. However, aggressive quantization below 2-bit causes considerable accuracy degradation due to unstable convergence, especially when the downstream dataset is not abundant. This work proposes a proactive knowledge distillation method called Teacher Intervention (TI) for fast converging QAT of ultra-low precision pre-trained Transformers. TI intervenes layer-wise signal propagation with the intact signal from the teacher to remove the interference of propagated quantization errors, smoothing loss surface of QAT and expediting the convergence. Furthermore, we propose a gradual intervention mechanism to stabilize the recovery of subsections of Transformer layers from quantization. The proposed schemes enable fast convergence of QAT and improve the model accuracy regardless of the diverse characteristics of downstream fine-tuning tasks. We demonstrate that TI consistently achieves superior accuracy with significantly lower fine-tuning iterations on well-known Transformers of natural language processing as well as computer vision compared to the state-of-the-art QAT methods.

View on arXivView PDF

Code Implementations(1)

PyTorch

[EACL 2023 main] This Repository provides a Pytorch implementation of Teacher Intervention: Improving Convergence of Quantization Aware Training for Ultra-Low Precision Transformers

70Shell, PythonFeb 3, 20233 years ago
bertpytorchquantizationtransformers

Similar Papers

Cite this paper

@article{kim2023teacher,
  title  = {Teacher Intervention: Improving Convergence of Quantization Aware Training for Ultra-Low Precision Transformers},
  author = {Minsoo Kim and Kyuhong Shim and Seongmin Park and Wonyong Sung and Jungwook Choi},
  year   = {2023},
  eprint = {2302.11812},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2302.11812v1}
}

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/2302.11812.svg)](https://codeofpaper.com/paper/2302.11812)

Discussion