arXiv:2608.27875cs.AI2026-08

通过混合精度量化提升大模型注意力模块效率,几乎无损性能。

HyQuant: Hybrid-Precision Quantization for LLM Attention

论文配图:HyQuant: Hybrid-Precision Quantization for LLM Attention
图 1 · 摘自论文原文
  • 关键区域保留高精度,其余低比特量化,减少误差。
  • 预填充和解码阶段均保持近似无损精度,支持高效推理。
  • 设计简洁实用,适合部署在资源受限的硬件上。

量化已被广泛用于大语言模型训练与推理,以降低计算成本并提升效率。然而,在极低比特宽度下对注意力模块进行量化常引入较大误差,导致性能下降。现有方法主要依赖平滑技术处理异常值,而本文提出一种混合量化设计,更好地平衡精度与效率。具体而言,提出 HyQuant——一种面向大模型注意力的高效混合量化框架。该框架将大部分注意力状态量化为低比特格式,同时保留少量关键的垂直线标记和局部窗口状态为高精度。这些关键区域通过轻量级的垂直线感知注意力模式信号选择,以有限开销显著降低量化误差。在预填充阶段,使用混合精度量化注意力算子,保留垂直线标记和局部滑动窗口的全精度,其余上下文则被量化;在解码阶段,采用相同原则进行 KV 缓存压缩,并将 KV 反量化与注意力计算融合,提升内存与硬件效率。在多种任务、模型和数据集上,HyQuant 均实现近乎无损精度,验证了混合量化在大模型注意力中的高效性与实用性。代码已开源:https://github.com/jerrysfls/HyQuant。

原文摘要 · Abstract (English)

Quantization has been widely adopted in LLM training and inference to reduce cost and improve efficiency. However, low-bit quantization of the \emph{attention} module often introduces large errors at very low bit-widths, causing performance degradation. Existing methods mainly rely on smoothing techniques to handle outliers, while we propose a hybrid quantization design to better balance accuracy and efficiency. Specifically, we propose \textbf{HyQuant}, an efficient hybrid quantization framework for LLM attention. HyQuant quantizes most attention states into low-bit formats while retaining a small set of vertical-line tokens and local-window states in high precision. These accuracy-critical regions are selected using lightweight vertical-line-aware attention-pattern signals, reducing quantization error with limited overhead. In the Prefill stage, HyQuant uses a hybrid-precision quantized attention operator that preserves vertical-line tokens and a local sliding window in full precision while quantizing the remaining context. In the Decode stage, HyQuant applies the same principle to KV-cache compression and fuses KV dequantization with attention computation to improve memory and hardware efficiency. Across diverse tasks, models, and datasets, HyQuant maintains nearly lossless accuracy with an extremely simple design, demonstrating the efficiency and practical feasibility of hybrid quantization for LLM attention. Code is available at: https://github.com/jerrysfls/HyQuant .

量化注意力机制大模型

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