自适应混合精度量化让大模型在任意内存预算下都保持高精度。
MixQuant: Adaptive Mixed-Precision Quantization for Large Language Models

- 通过考虑上游层量化位宽影响,动态评估各层敏感度。
- 在最紧预算下将困惑度从12.43降至10.70,平均准确率提升8点。
- 无需重校准,单次计算即可适配任意部署预算,适合实际部署场景。
混合精度量化通过为敏感层分配更高位宽提升后训练量化精度,但现有方法仅针对单一固定内存预算进行分配。实际部署中预算多变且校准阶段未知。自适应量化虽可实现一次离线校准适配任意预算,但当前方法对层敏感度的评估未考虑其他层量化位宽的影响。我们发现层敏感度强烈依赖于上游层的位宽,这一依赖会改变最优位宽分配。为此提出MixQuant,一种与技术无关的自适应框架,可封装任何基础量化器。MixQuant通过对随机上游量化配置下的层失真进行边缘化,获得预算无关的评分;在分配器生成的方案上校准量化参数,并惩罚处于最低位宽的层。单次贪心遍历即可在部署时适配任意预算。在Llama-3.2-3B、Llama-2-7B和Mistral-7B上,采用AWQ和GPTQ,MixQuant在所有设置中均优于自适应及混合精度基线,平均准确率最高提升8个百分点,最紧预算下困惑度由12.43降至10.70,且以极低开销达到与整数线性规划求解器相当的效果。
原文摘要 · Abstract (English)
Mixed-precision quantization improves the accuracy of post-training quantization by allocating higher bitwidths to sensitive layers, but existing methods solve the allocation for a single fixed memory budget. In practice the budget varies across deployments and is unknown at calibration time. Adaptive quantization addresses this with one offline calibration that serves any budget, yet current methods score layer sensitivity in a manner that does not consider its dependency on quantization levels of other layers. We show that a layer's sensitivity depends strongly on the bitwidths of its upstream layers and that this dependence shifts the resulting preferred bit allocation. We propose MixQuant, a technique-agnostic adaptive framework that wraps any base quantizer. MixQuant marginalizes each layer's distortion over random quantized upstream configurations to obtain budget-agnostic scores, calibrates the quantizer's parameters on plans the allocator itself produces, and penalizes allocations that leave layers at the lowest bitwidths. A single greedy pass then serves any budget at deployment. Across Llama-3.2-3B, Llama-2-7B, and Mistral-7B under AWQ and GPTQ, MixQuant outperforms adaptive and mixed-precision baselines in every setting, improving average accuracy by up to 8 points and reducing perplexity from 12.43 to 10.70 at the tightest budget, while matching an ILP solver at negligible deployment cost.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。