提升低比特量化大模型生成质量,关键在优化最后层的输出分布
LFQ: Logit-aware Final-block Quantization for Boosting the Generation Quality of Low-Bit Quantized LLMs

- 在最后的Transformer块中最小化原始与量化模型之间的交叉熵
- 在长文本生成任务上显著优于当前最佳的分块量化方法
- 适合追求高生成质量的低比特部署场景
随着大语言模型持续扩大规模,仅权重的低比特后训练量化(PTQ)为内存高效部署提供了实用方案。尽管分块式PTQ在基础语言建模与理解任务上可媲美全精度(FP)基线,但在生成任务中性能下降——尤其在长文本响应和复杂推理链上,这对提升任务准确性至关重要。我们归因于两点:(i) 分块优化中忽略了未嵌入层(LM头);(ii) 依赖均方误差(MSE)目标。两者均导致量化模型的词元概率分布与原模型不一致,造成生成基准测试中的明显准确率下降。为此,我们提出日志感知的最终块量化(LFQ),一种简单有效的分块量化增强方法:通过最小化原始模型与量化模型在最终块的对数几率(logits)间的交叉熵,实现输出分布对齐。该方法在多个模型族上,持续提升复杂生成任务的准确性,同时在语言建模与理解任务上保持与全精度基线相当的性能。
原文摘要 · Abstract (English)
As large language models continue to scale, low-bit weight-only post-training quantization (PTQ) offers a practical solution to their memory-efficient deployment. Although block-wise PTQ is capable of matching the full-precision (FP) baseline on basic language modeling and understanding, its quality is degraded for generative tasks -- especially at longer responses and extended chains of thought, which is critical in boosting task accuracy. We attribute this shortfall to two factors: (i) the omission of the unembedding layer (the LM head) in block-wise optimization and (ii) the reliance on the mean squared error (MSE) objective. Both factors cause the token probability distribution of the quantized model to misalign with that of the FP model, yielding notable accuracy drops on text generation benchmarks. To rectify the discrepancy, we introduce Logit-aware Final-block Quantization (LFQ), a simple yet effective enhancement to block-wise PTQ that quantizes the final Transformer block by minimizing the cross-entropy between the logits of the FP model and those of its quantized counterpart. By aligning token probabilities at the logit level in the final block, LFQ consistently improves the accuracy of complex generation tasks over state-of-the-art block-wise PTQ across diverse model families, while maintaining parity with FP baselines on language modeling and understanding.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。