通过分层拆分提升低比特量化精度,保留关键信号不丢失
SplitQuant: Layer Splitting for Low-Bit Neural Network Quantization
- 将每层拆成三部分,用不同缩放因子降低参数范围
- 在两个BERT-Tiny上实现INT2量化精度提升3.3%和2.1%
- 适合追求高精度低比特部署的模型压缩场景
深度神经网络(DNN)量化是将参数从原始数据类型映射到低精度数据类型以减小模型尺寸并加速推理的过程。由于原始值范围大于量化值范围,常导致多个原始值映射到同一量化值,从而降低模型精度。异常值是造成量化分辨率下降的主要原因,因其扩大了原始值范围。传统方法采用百分位数裁剪异常值,但会误删重要信号。本文提出SplitQuant,通过将每个可量化的层拆分为三个数学等价子层,并施加不同缩放因子,缩小原始值范围,缓解异常值影响。权重和偏置被聚类为低、中、高三组以优化分割。对BERT-Tiny模型预处理后,INT2量化精度分别提升3.3%和2.1%,达到接近原始FP32模型的水平。
原文摘要 · Abstract (English)
Quantization for deep neural networks (DNNs) is the process of mapping the parameter values of DNNs from original data types to other data types of lower precision to reduce model sizes and make inference faster. Quantization often maps different original values to a single quantized value because the range of the original values is larger than the range of the quantized values. This leads to the degradation of the accuracy of the quantized DNNs. Outliers are a main cause of the degradation of quantization resolution because they enlarge the range of original values. To solve the problem, the percentile method is often used to clip outliers. However, clipping the outliers has another problem of removing the important and strong signals in the DNNs. This paper proposes SplitQuant to keep the outliers and improve the quantization resolution at the same time. SplitQuant narrows down the range of the original values and mitigates the effect of outliers by splitting each quantizable layer into three mathematically equivalent layers and applies different scaling factors. Especially, weights and biases are clustered into lower, middle and upper clusters for optimized split. By preprocessing DNNs with SplitQuant, quantization algorithms can achieve better results. SplitQuant was applied on two BERT-Tiny models and improved the accuracy of INT2 quantization by 3.3%p and 2.1%p, achieving accuracies comparable to those of the original FP32 models.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。