arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2404.01892cs.CV
收藏

通过偏差补偿最小化量化输出误差

Minimize Quantization Output Error with Bias Compensation

College of Software, Nankai University(南开大学软件学院);College of Computer Science, Nankai University(南开大学计算机学院)

Cheng Gong, Haoshuai Zheng, Mengting Hu, Zheng Lin, Deng-Ping Fan, Yuzhi Zhang, Tao Li

AI总结:

本文提出偏差补偿(BC)方法,通过寻找补偿偏差向量直接最小化量化输出误差,将其建模为凸问题并高效求解,无需训练或微调,在ViT和大语言模型上显著降低误差并提升超低精度训练后量化性能。

摘要:

量化是一种很有前景的方法,能够降低深度神经网络(DNNs)的内存使用和计算强度,但往往会导致严重的输出误差,阻碍模型部署。在本文中,我们提出偏差补偿(BC)来最小化输出误差,从而实现无需模型微调的超低精度量化。与以往大多数优化非凸量化过程的方法不同,提出的BC绕过这一步骤,通过寻找补偿偏差向量直接最小化量化输出误差。我们已证明通过BC最小化输出误差是一个凸问题,并提供了一种高效策略来获取与最小输出误差相关的最优解,无需训练或微调。我们在Vision Transformer模型和大语言模型上进行了广泛实验,结果表明我们的方法显著降低了量化输出误差,从而允许超低精度的训练后量化并提升模型的任务性能。特别是,BC在ImageNet-1k任务上将采用4-bit PTQ4ViT的ViT-B的准确率提高了36.89%,并在WikiText2上将采用3-bit GPTQ的OPT-350M的困惑度降低了5.97。代码位于 https://github.com/GongCheng1919/bias-compensation。

英文摘要:

Quantization is a promising method that reduces memory usage and computational intensity of Deep Neural Networks (DNNs), but it often leads to significant output error that hinder model deployment. In this paper, we propose Bias Compensation (BC) to minimize the output error, thus realizing ultra-low-precision quantization without model fine-tuning. Instead of optimizing the non-convex quantization process as in most previous methods, the proposed BC bypasses the step to directly minimize the quantizing output error by identifying a bias vector for compensation. We have established that the minimization of output error through BC is a convex problem and provides an efficient strategy to procure optimal solutions associated with minimal output error,without the need for training or fine-tuning. We conduct extensive experiments on Vision Transformer models and Large Language Models, and the results show that our method notably reduces quantization output error, thereby permitting ultra-low-precision post-training quantization and enhancing the task performance of models. Especially, BC improves the accuracy of ViT-B with 4-bit PTQ4ViT by 36.89% on the ImageNet-1k task, and decreases the perplexity of OPT-350M with 3-bit GPTQ by 5.97 on WikiText2.The code is in https://github.com/GongCheng1919/bias-compensation.

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

↑