English

TernaryBERT: Distillation-aware Ultra-low Bit BERT

Computation and Language 2020-10-13 v3 Machine Learning Sound Audio and Speech Processing

Abstract

Transformer-based pre-training models like BERT have achieved remarkable performance in many natural language processing tasks.However, these models are both computation and memory expensive, hindering their deployment to resource-constrained devices. In this work, we propose TernaryBERT, which ternarizes the weights in a fine-tuned BERT model. Specifically, we use both approximation-based and loss-aware ternarization methods and empirically investigate the ternarization granularity of different parts of BERT. Moreover, to reduce the accuracy degradation caused by the lower capacity of low bits, we leverage the knowledge distillation technique in the training process. Experiments on the GLUE benchmark and SQuAD show that our proposed TernaryBERT outperforms the other BERT quantization methods, and even achieves comparable performance as the full-precision model while being 14.9x smaller.

Keywords

Cite

@article{arxiv.2009.12812,
  title  = {TernaryBERT: Distillation-aware Ultra-low Bit BERT},
  author = {Wei Zhang and Lu Hou and Yichun Yin and Lifeng Shang and Xiao Chen and Xin Jiang and Qun Liu},
  journal= {arXiv preprint arXiv:2009.12812},
  year   = {2020}
}

Comments

Accepted by EMNLP 2020

R2 v1 2026-06-23T18:49:26.869Z