arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2106.13035stat.MLcs.LG
收藏

量化感知训练、ERNIE和峰度正则化:一个简短的实证研究

Quantization Aware Training, ERNIE and Kurtosis Regularizer: a short empirical study

Intel Technology Poland(英特尔波兰技术公司)

Andrea Zanetti

摘要:

像Ernie或BERT这样的预训练语言模型目前在许多应用中使用。这些模型带有一组预先训练的权重,通常是在大量数据的无监督/自监督模式中获得的。在此之后,它们会在特定任务上进行微调。然后应用程序使用这些模型进行推理,并且通常会应用一些额外的约束,例如低功耗预算或输入和输出之间的低延迟。满足推理设置的这些额外要求的主要途径是使用低精度计算(例如INT 8而不是FP 32),但这会降低模型的功能性能(例如准确性)。已经开发了一些方法来解决这个问题,并且超越了PTO(训练后量化)的限制,更具体地说,QAT(量化感知训练,参见[4])是一种干扰训练过程的过程,以便使其在训练本身期间受到量化阶段的影响(或简单地干扰)。除了QAT之外,最近Intel-Habana Labs还提出了一种额外的更直接的方法,使训练结果对随后的量化更加鲁棒,该方法使用正则化器,从而改变了驱动训练过程的损失函数。但是他们的建议并不适用于像Ernie这样的预先训练的模型。在这篇简短的论文中,我们展示了为什么这种情况不会发生(对于Ernie的情况),我们提出了一种非常基本的方法来处理它,并分享了一些初步结果(最终INT 8精度的增加),这些结果可能会让愿意在低精度状态下使用Ernie的从业者感兴趣。

英文摘要:

Pre-trained language models like Ernie or Bert are currently used in many applications. These models come with a set of pre-trained weights typically obtained in unsupervised/self-supervised modality on a huge amount of data. After that, they are fine-tuned on a specific task. Applications then use these models for inference, and often some additional constraints apply, like low power-budget or low latency between input and output. The main avenue to meet these additional requirements for the inference settings, is to use low precision computation (e.g. INT8 rather than FP32), but this comes with a cost of deteriorating the functional performance (e.g. accuracy) of the model. Some approaches have been developed to tackle the problem and go beyond the limitations of the PTO (Post-Training Quantization), more specifically the QAT (Quantization Aware Training, see [4]) is a procedure that interferes with the training process in order to make it affected (or simply disturbed) by the quantization phase during the training itself. Besides QAT, recently Intel-Habana Labs have proposed an additional and more direct way to make the training results more robust to subsequent quantization which uses a regularizer, therefore changing the loss function that drives the training procedure. But their proposal does not work out-of-the-box for pre-trained models like Ernie, for example. In this short paper we show why this is not happening (for the Ernie case) and we propose a very basic way to deal with it, sharing as well some initial results (increase in final INT8 accuracy) that might be of interest to practitioners willing to use Ernie in their applications, in low precision regime.

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

↑