SQuAT:针对BERT的共享和Quantization意识培训
SQuAT: Sharpness- and Quantization-Aware Training for BERT
摘要:
量化是减少深度学习模型的内存占用、推理延迟和功耗的有效技术。然而,现有的量化方法相比于全精度(FP)模型,由于通过不可微量化层的粗梯度估计引入的误差而遭受精度降级。过度参数化模型的损失景观中存在尖锐的局部极小值(例如,Transformers)在低位(2、4位)设置中倾向于加重这种性能损失。在这项工作中,我们提出了清晰度和量化感知训练(SQuAT),这将鼓励模型在执行量化感知训练的同时收敛到更平坦的最小值。我们提出的方法在锐度目标和步长目标之间交替训练,这可能会让模型学习最合适的参数更新幅度,以达到收敛接近平坦的最小值。大量的实验表明,我们的方法可以始终优于国家的最先进的量化BERT模型下的2,3,和4位设置GLUE基准的1%,有时甚至可以优于全精度(32位)模型。我们对锐度的经验测量的实验也表明,与其他量化方法相比,我们的方法将导致更平坦的最小值。
英文摘要:
Quantization is an effective technique to reduce memory footprint, inference latency, and power consumption of deep learning models. However, existing quantization methods suffer from accuracy degradation compared to full-precision (FP) models due to the errors introduced by coarse gradient estimation through non-differentiable quantization layers. The existence of sharp local minima in the loss landscapes of overparameterized models (e.g., Transformers) tends to aggravate such performance penalty in low-bit (2, 4 bits) settings. In this work, we propose sharpness- and quantization-aware training (SQuAT), which would encourage the model to converge to flatter minima while performing quantization-aware training. Our proposed method alternates training between sharpness objective and step-size objective, which could potentially let the model learn the most suitable parameter update magnitude to reach convergence near-flat minima. Extensive experiments show that our method can consistently outperform state-of-the-art quantized BERT models under 2, 3, and 4-bit settings on GLUE benchmarks by 1%, and can sometimes even outperform full precision (32-bit) models. Our experiments on empirical measurement of sharpness also suggest that our method would lead to flatter minima compared to other quantization methods.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。