arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2009.12812cs.CLcs.LGcs.SDeess.AS
收藏

TernaryBERT:蒸馏感知超低位BERT

TernaryBERT: Distillation-aware Ultra-low Bit BERT

Huawei Noah’s Ark Lab(华为诺亚方舟实验室)

Wei Zhang, Lu Hou, Yichun Yin, Lifeng Shang, Xiao Chen, Xin Jiang, Qun Liu

摘要:

基于transformer的预训练模型如BERT在许多自然语言处理任务中取得了显著的性能,但是这些模型的计算量和存储量都很大,阻碍了它们在资源受限的设备上的部署。在这项工作中,我们提出了Ternary BERT,它trinarizes在微调BERT模型的权重。具体来说,我们使用基于近似和损失感知的三端化方法和经验调查的三端化粒度的不同部分的BERT。此外,为了减少由于低比特容量较低而导致的精度下降,我们在训练过程中利用了知识蒸馏技术。在GLUE基准测试和SQuAD上的实验表明,我们提出的Ternary BERT优于其他BERT量化方法,甚至达到了与全精度模型相当的性能,同时比全精度模型小14.9倍。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑