arXiv:2409.17634cs.CVcs.AI2024-09被引 8

用可学习提示提升低比特量化模型性能,让视觉语言模型更轻更快。

P4Q: Learning to Prompt for Quantization in Visual-language Models

  • 设计轻量提示结构,通过对比损失优化文本表示
  • 8比特量化下图像文本特征对齐,ImageNet上达66.94%准确率
  • 无需大幅增加参数,效果媲美全精度模型,适合部署场景

大规模预训练视觉语言模型(VLMs)在多模态任务中表现突出,但其在下游平台部署受限于高昂的训练样本与算力需求。微调与量化可显著降低资源消耗,亟待突破。现有量化方法中,感知量化训练(QAT)虽能有效压缩大模型但训练成本高;而低比特后训练量化(PTQ)则存在明显性能下降。本文提出「提示量化」(P4Q)方法,在平衡微调与量化的基础上,设计轻量结构,利用对比损失监督提升PTQ模型识别能力。通过可学习提示重新组织文本表示,并引入低比特适配器对齐图像与文本特征分布。同时基于余弦相似度预测设计蒸馏损失,使用全精度教师模型指导量化模型。大量实验表明,所提P4Q方法优于现有方法,甚至达到与全精度模型相当的效果。例如,8比特P4Q可将CLIP-ViT/B-32理论压缩4倍,同时在ImageNet上实现66.94%的Top-1准确率,较可学习提示微调的全精度模型高出2.24%,且附加参数极少。

原文摘要 · Abstract (English)

Large-scale pre-trained Vision-Language Models (VLMs) have gained prominence in various visual and multimodal tasks, yet the deployment of VLMs on downstream application platforms remains challenging due to their prohibitive requirements of training samples and computing resources. Fine-tuning and quantization of VLMs can substantially reduce the sample and computation costs, which are in urgent need. There are two prevailing paradigms in quantization, Quantization-Aware Training (QAT) can effectively quantize large-scale VLMs but incur a huge training cost, while low-bit Post-Training Quantization (PTQ) suffers from a notable performance drop. We propose a method that balances fine-tuning and quantization named ``Prompt for Quantization'' (P4Q), in which we design a lightweight architecture to leverage contrastive loss supervision to enhance the recognition performance of a PTQ model. Our method can effectively reduce the gap between image features and text features caused by low-bit quantization, based on learnable prompts to reorganize textual representations and a low-bit adapter to realign the distributions of image and text features. We also introduce a distillation loss based on cosine similarity predictions to distill the quantized model using a full-precision teacher. Extensive experimental results demonstrate that our P4Q method outperforms prior arts, even achieving comparable results to its full-precision counterparts. For instance, our 8-bit P4Q can theoretically compress the CLIP-ViT/B-32 by 4 $\times$ while achieving 66.94\% Top-1 accuracy, outperforming the learnable prompt fine-tuned full-precision model by 2.24\% with negligible additional parameters on the ImageNet dataset.

量化视觉语言模型提示学习轻量化

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。