Transformer based architectures have become de-facto models used for a range of Natural Language Processing tasks. In particular, the BERT based models achieved significant accuracy gain for GLUE tasks, CoNLL-03 and SQuAD. However, BERT based models have a prohibitive memory footprint and latency. As a result, deploying BERT based models in resource constrained environments has become a challenging task. In this work, we perform an extensive analysis of fine-tuned BERT models using second order Hessian information, and we use our results to propose a novel method for quantizing BERT models to ultra low precision. In particular, we propose a new group-wise quantization scheme, and we use a Hessian based mix-precision method to compress the model further. We extensively test our proposed method on BERT downstream tasks of SST-2, MNLI, CoNLL-03, and SQuAD. We can achieve comparable performance to baseline with at most $2.3\%$ performance degradation, even with ultra-low precision quantization down to 2 bits, corresponding up to $13\times$ compression of the model parameters, and up to $4\times$ compression of the embedding table as well as activations. Among all tasks, we observed the highest performance loss for BERT fine-tuned on SQuAD. By probing into the Hessian based analysis as well as visualization, we show that this is related to the fact that current training/fine-tuning strategy of BERT does not converge for SQuAD.


翻译:在一系列自然语言处理任务中,基于变压器的建筑结构已成为用于一系列自然语言处理任务的脱法模型。特别是,基于BERT的模型在GLUE任务、CONLL-03和SQUAD中取得了显著的准确性增益。然而,基于BERT的模型具有令人望而却步的内存足迹和延缓性。因此,在资源受限的环境中部署基于BERT的模型已成为一项具有挑战性的任务。在这项工作中,我们使用第二顺序的Hessian信息对微调的BERT模型进行了广泛的分析,我们用我们的结果提出了一种新颖的方法,将BERT模型量化到极低的精确度。特别是,我们提出了一个新的基于集团的量化计划,我们用基于 Hesian 的混合精度方法来压缩模型模型。在SST-2、 MLI、 CoNLLLL-03和SQADAD等下游任务中,我们可以达到最多23美分的性能与基线相比较,即使超低精度的量化为2位,在13元的当前精度的精度的精度的精度的精度的精度调整中,作为SADRIMLADAD的精度的精度分析,我们所观察到的SBADADADAD的精度,作为SB的精度的精度的精度的精度的精度的精度,我们所观察到的精度, 的精度,作为SMA的精度的精度的精度的精度的精度的精度,作为所有的精度的精度的精度的精度的精度的精度分析的精度的精度的精度的精度, 。

3
下载
关闭预览

相关内容

【Google论文】ALBERT:自我监督学习语言表达的精简BERT
专知会员服务
22+阅读 · 2019年11月4日
ExBert — 可视化分析Transformer学到的表示
专知会员服务
30+阅读 · 2019年10月16日
最新BERT相关论文清单,BERT-related Papers
专知会员服务
52+阅读 · 2019年9月29日
RoBERTa中文预训练模型:RoBERTa for Chinese
PaperWeekly
57+阅读 · 2019年9月16日
一文详解Google最新NLP模型XLNet
PaperWeekly
17+阅读 · 2019年7月1日
从 one-hot 到 BERT,带你一步步理解 BERT
数说工作室
21+阅读 · 2019年6月25日
Hierarchically Structured Meta-learning
CreateAMind
23+阅读 · 2019年5月22日
Transferring Knowledge across Learning Processes
CreateAMind
24+阅读 · 2019年5月18日
BERT相关论文、文章和代码资源汇总
AINLP
19+阅读 · 2018年11月17日
Auto-Encoding GAN
CreateAMind
7+阅读 · 2017年8月4日
Arxiv
5+阅读 · 2019年10月31日
Revealing the Dark Secrets of BERT
Arxiv
4+阅读 · 2019年9月11日
Arxiv
6+阅读 · 2019年9月4日
How to Fine-Tune BERT for Text Classification?
Arxiv
13+阅读 · 2019年5月14日
Arxiv
8+阅读 · 2019年3月21日
Arxiv
5+阅读 · 2017年12月14日
VIP会员
相关资讯
RoBERTa中文预训练模型:RoBERTa for Chinese
PaperWeekly
57+阅读 · 2019年9月16日
一文详解Google最新NLP模型XLNet
PaperWeekly
17+阅读 · 2019年7月1日
从 one-hot 到 BERT,带你一步步理解 BERT
数说工作室
21+阅读 · 2019年6月25日
Hierarchically Structured Meta-learning
CreateAMind
23+阅读 · 2019年5月22日
Transferring Knowledge across Learning Processes
CreateAMind
24+阅读 · 2019年5月18日
BERT相关论文、文章和代码资源汇总
AINLP
19+阅读 · 2018年11月17日
Auto-Encoding GAN
CreateAMind
7+阅读 · 2017年8月4日
相关论文
Arxiv
5+阅读 · 2019年10月31日
Revealing the Dark Secrets of BERT
Arxiv
4+阅读 · 2019年9月11日
Arxiv
6+阅读 · 2019年9月4日
How to Fine-Tune BERT for Text Classification?
Arxiv
13+阅读 · 2019年5月14日
Arxiv
8+阅读 · 2019年3月21日
Arxiv
5+阅读 · 2017年12月14日
Top
微信扫码咨询专知VIP会员