LeapQuant: Efficient Linear Attention with Accurate Recurrent State Quantization

📄 arXiv: 2609.38166v1 📥 PDF

作者: Yi Pan, Haocheng Xi, Kan Zhu, Xingyang Li, Yibo Wu, Mayank Mishra, Hongtao Zhang, William X. Zheng, Baris Kasikci, Song Han, Kurt Keutzer, Rishabh Iyer, Ion Stoica

分类: cs.LG, cs.AI

发布日期: 2026-09-29

备注: 17 pages, 11 figures


💡 一句话要点

提出LeapQuant以解决长上下文处理中的量化问题

🎯 匹配领域: 支柱二:RL算法与架构 (RL & Architecture)

关键词: 线性注意力 量化技术 长上下文处理 模型压缩 推理优化 自然语言处理 深度学习

📋 核心要点

  1. 现有的线性注意力模型在长上下文处理时,反复更新固定状态导致推理效率低下。
  2. LeapQuant通过每窗口量化和补偿标记的引入,减少了量化带来的误差积累。
  3. 实验表明,LeapQuant在NVIDIA多款GPU上实现了2.05至3.70倍的速度提升,同时保持与FP32基线相当的准确性。

📝 摘要(中文)

近年来,越来越多的大型语言模型采用混合设计,使用线性注意力替代标准注意力。尽管这种方法显著降低了长上下文处理的成本,但在推理过程中,反复读取和更新固定大小的状态仍然是一个主要瓶颈。为了解决这一问题,本文提出了LeapQuant,一种无训练的方法,能够在8位递归状态量化下实现近乎无损的性能。通过每窗口量化和保留高精度补偿标记,LeapQuant有效减少了误差积累,显著降低了内存和计算成本,同时在准确性上与FP32基线相当。

🔬 方法详解

问题定义:本文旨在解决在长上下文处理中的量化问题,现有方法在推理时反复读取和更新固定状态,导致效率低下和误差积累。

核心思路:LeapQuant提出了一种无训练的量化方法,通过每窗口量化和高精度补偿标记来减少误差,从而在保持模型性能的同时降低计算成本。

技术框架:LeapQuant的整体架构包括两个主要模块:每窗口量化模块和补偿标记模块。每窗口量化模块在窗口结束时对状态进行量化,而补偿标记模块则保留状态中的最大异常值以进行高精度更新。

关键创新:LeapQuant的核心创新在于引入了每窗口量化和补偿标记的概念,这与传统的逐步量化方法本质上不同,能够有效减少量化误差。

关键设计:在设计上,LeapQuant对量化过程进行了优化,采用了固定低位状态与高精度缓冲更新相结合的方式,并在量化前对残差进行平滑处理,以进一步降低误差。

🖼️ 关键图片

fig_0
img_1
img_2

📊 实验亮点

实验结果显示,LeapQuant在NVIDIA B200、RTX PRO 6000和RTX 5090 GPU上实现了2.05至3.70倍的速度提升,且在端到端推理中平均提升为1.47倍,准确性与FP32基线相当,展示了其在实际应用中的优越性能。

🎯 应用场景

LeapQuant的研究成果在自然语言处理、图像处理等领域具有广泛的应用潜力,尤其是在需要处理长上下文的任务中,如文本生成、对话系统等。其高效的量化方法能够显著提升推理速度,降低计算资源消耗,具有重要的实际价值和未来影响。

📄 摘要(原文)

Recent LLMs increasingly adopt hybrid designs that replace standard attention with linear attention, such as Gated DeltaNet (GDN) and Kimi Delta Attention (KDA). Although they compress the context into a fixed-size recurrent state and substantially reduce the cost of long-context processing, repeatedly reading and updating that state remains a major inference bottleneck. Quantization offers a natural way to reduce this cost, but can significantly degrade model quality, due to the accumulation of rounding errors and the presence of outlier rows and columns in the state. To address these challenges, we propose LeapQuant, a training-free method that achieves near-lossless performance under 8-bit recurrent-state quantization. First, to mitigate error accumulation, we propose per-window quantization, which leaps over a window of tokens and quantizes the state only once at its end. Within a window, outputs are computed from the fixed low-bit state together with high-precision buffered updates. Second, to reduce the error introduced by each quantization, LeapQuant retains the state's largest outliers as a few high-precision Compensator Tokens, which share the update path of real tokens. We then smooth the remaining residual before quantization to further reduce the error. Comprehensive experiments across the Qwen, Kimi, and GLM model families show that LeapQuant substantially reduces memory and compute costs during inference. With accuracy comparable to the FP32 baseline, it achieves average speedups of 2.05--3.70$\times$ at the kernel level and 1.47$\times$ for end-to-end inference on NVIDIA B200, RTX PRO 6000, and RTX 5090 GPUs.