针对视觉语言模型量化精度下降问题,提出按模态平衡的量化方法
MBQ: Modality-Balanced Quantization for Large Vision-Language Models
- 根据语言与视觉模态敏感度差异,在校准中动态调整量化参数
- 在W3和W4A8下最高提升11.6%准确率,70B模型仍保持高精度
- 适用于大模型部署,尤其适合视觉语言任务的轻量化应用
视觉语言模型(VLMs)已广泛应用于实际场景。然而,其庞大的参数量带来巨大的内存与计算开销,制约了部署。后训练量化(PTQ)是降低开销的有效手段,但现有方法主要针对大语言模型(LLMs),忽视了不同模态间的差异。本文发现,大VLM中语言与视觉令牌的敏感度存在显著差异。若对所有模态一视同仁,会导致对不敏感模态过度压缩,引发严重精度损失。为此,我们提出一种简单而有效的方法——模态平衡量化(MBQ),在校准过程中融合各模态敏感度,以最小化重建误差,获得更优量化参数。大量实验表明,相较于当前最优基线,MBQ在W3和W4A8量化下,对7B至70B VLM的性能提升分别达4.4%和11.6%。此外,我们实现了基于W3的GPU核函数,融合反量化与GEMV操作,在RTX 4090上使LLaVA-onevision-7B推理速度提升1.4倍。代码已开源:https://github.com/thu-nics/MBQ。
原文摘要 · Abstract (English)
Vision-Language Models (VLMs) have enabled a variety of real-world applications. The large parameter size of VLMs brings large memory and computation overhead which poses significant challenges for deployment. Post-Training Quantization (PTQ) is an effective technique to reduce the memory and computation overhead. Existing PTQ methods mainly focus on large language models (LLMs), without considering the differences across other modalities. In this paper, we discover that there is a significant difference in sensitivity between language and vision tokens in large VLMs. Therefore, treating tokens from different modalities equally, as in existing PTQ methods, may over-emphasize the insensitive modalities, leading to significant accuracy loss. To deal with the above issue, we propose a simple yet effective method, Modality-Balanced Quantization (MBQ), for large VLMs. Specifically, MBQ incorporates the different sensitivities across modalities during the calibration process to minimize the reconstruction loss for better quantization parameters. Extensive experiments show that MBQ can significantly improve task accuracy by up to 4.4% and 11.6% under W3 and W4A8 quantization for 7B to 70B VLMs, compared to SOTA baselines. Additionally, we implement a W3 GPU kernel that fuses the dequantization and GEMV operators, achieving a 1.4x speedup on LLaVA-onevision-7B on the RTX 4090. The code is available at https://github.com/thu-nics/MBQ.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。