Post-training quantization (PTQ) for vision transformers (ViTs) has garnered significant attention due to its efficiency in compressing models. However, existing methods typically overlook the intricate interdependence between quantized weight and activation, leading to considerable quantization error. In this paper, we propose ERQ, a two-step PTQ approach meticulously crafted to sequentially reduce the quantization error arising from activation and weight quantization. ERQ first introduces Activation quantization error reduction (Aqer) that strategically formulates the minimization of activation quantization error as a Ridge Regression problem, tackling it by updating weights with full-precision. Subsequently, ERQ introduces Weight quantization error reduction (Wqer) that adopts an iterative approach to mitigate the quantization error induced by weight quantization. In each iteration, an empirically derived, efficient proxy is employed to refine the rounding directions of quantized weights, coupled with a Ridge Regression solver to curtail weight quantization error. Experimental results attest to the effectiveness of our approach. Notably, ERQ surpasses the state-of-the-art GPTQ by 22.36% in accuracy for W3A4 ViT-S.
翻译:视觉Transformer(ViT)的后训练量化(PTQ)因其在模型压缩方面的效率而受到广泛关注。然而,现有方法通常忽视了量化权重与激活之间复杂的相互依赖关系,从而导致显著的量化误差。本文提出ERQ,一种精心设计的两步PTQ方法,旨在顺序地削减由激活量化和权重量化产生的量化误差。ERQ首先提出**激活量化误差削减(Aqer)**,其策略性地将激活量化误差的最小化表述为一个岭回归问题,并通过更新全精度权重来解决该问题。随后,ERQ引入**权重量化误差削减(Wqer)**,该方法采用一种迭代方式来缓解由权重量化引起的量化误差。在每次迭代中,使用一个根据经验推导出的高效代理来优化量化权重的舍入方向,并结合一个岭回归求解器来削减权重量化误差。实验结果证明了我们方法的有效性。值得注意的是,对于W3A4配置的ViT-S模型,ERQ的准确率超越了当前最先进的GPTQ方法,优势达22.36%。