PN-Mix:面向高效长输出LLM推理的配对范数引导混合精度键缓存量化
研究论文 · 2026/10/16
长输出推理中,大语言模型的KV缓存面临严重的内存和带宽瓶颈。KV缓存量化可缓解此问题,但低比特量化(如2比特)会严重降低模型精度。近期混合精度键缓存量化方法通过为重要键通道分配更高精度来缓解精度下降,但仅使用键统计量估计通道显著性。通过RoPE通道对级别的注意力logit扰动分析,我们发现查询-键对范数乘积较大的通道对中的量化误差对logit变化贡献显著。基于此,我们提出PN-Mix,一种针对基于RoPE的仅解码器大语言模型的混合精度键缓存量化方法,它在预填充阶段一次性识别显著通道对并在整个解码过程中复用,为其分配更高精度。在标准推理、代码生成和AIME基准测试中,PN-Mix以平均2.26比特的精度达到了与先前使用2.32-2.39比特的混合精度方法相当或更好的平均准确率。此外,在我们的帕累托扫描中,PN-Mix在低至1.5比特时仍能优雅降级,而对比基线在低于2.25比特时表现出更陡峭的性能下降。
该研究通过RoPE通道对级别的注意力logit扰动分析,揭示了查询-键对范数乘积与量化误差影响的关系,提出了更高效的混合精度键缓存量化方法,在更低比特下保持模型精度,对长输出LLM推理的部署有重要价值。
Long-output inference in large language models suffers from severe KV cache memory and bandwidth bottlenecks. While KV cache quantization alleviates this issue, low-bit quantization (e.g., 2-bit) severely degrades model accuracy. Recent mixed-precision key-cache quantization methods mitigate this degradation by allocating higher precision to important key channels, but estimate channel saliency using only key statistics. Through attention logit perturbation analysis at the RoPE channel-pair level, we show that quantization errors in channel pairs with large query--key pair-norm products contribute significantly to logit variation. Based on this insight, we propose PN-Mix, a mixed-precision key-cache quantization method for RoPE-based decoder-only LLMs, which allocates higher precision to salient channel pairs identified once during the prefill stage and reused throughout decoding. Across standard reasoning, code-generation, and AIME benchmarks, PN-Mix with 2.26-bit average precision achieves comparable or better average accuracy than prior mixed-precision methods using 2.32--2.39 bits. Furthermore, in our Pareto sweep, PN-Mix degrades gracefully down to 1.5 bits, whereas the compared baselines exhibit sharper performance drops below 2.25 bits.