arXiv(opens in a new tab)cs.LGSep 2026Cited by 4 papers on PaperVantage

Manuscript Offprint

arXiv:2609.38166

LeapQuant: Efficient Linear Attention with Accurate Recurrent State Quantization

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

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

ABSTRACT

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×2.05-3.70\times at the kernel level and 1.47×1.47\times for end-to-end inference on NVIDIA B200, RTX PRO 6000, and RTX 5090 GPUs.

1 INTRODUCTION

Linear attention, which compresses the token history into a fixed-size recurrent state, is now widely used in long-context large language models. For instance, recent hybrid architectures in the Qwen, Kimi, and GLM model families replace many standard attention layers with recurrent linear attention layers such as Gated DeltaNet (GDN) and Kimi Delta Attention (KDA) (Qwen Team, 2025; Yang et al., 2025; Team et al., 2025). By compressing the token history, these layers reduce the computation and memory growth associated with long context, making inference more efficient.

However, the recurrent state in linear attention still imposes substantial memory bandwidth and capacity costs during inference. For each generated token, a linear-attention layer loads its state matrix from HBM, applies a lightweight update, computes the token output, and writes the updated matrix back to HBM. This full-state transfer repeats at every decoding step. Since the update and readout perform little arithmetic relative to the bytes transferred, inference throughput is bottlenecked by HBM bandwidth (Williams et al., 2009). Consequently, reading and writing the recurrent states across many linear attention layers and concurrent requests accounts for a significant fraction of decoding time, as shown in Figure 1(a). Additionally, the recurrent state consumes substantial GPU memory when prefix caching is enabled, as serving systems retain separate states for each cached prefix (Figure 1(b)) (Pan et al., 2025).

∗^{*}Equal contribution

Figure

(a)

Figure

(b)

Figure 1: Recurrent-state access is a major cost of LLM serving. (a) Decode-time breakdown for GLM-5.3-Flash-NVFP4 on the B200 GPU at batch size 256. The share spent on linear attention stays roughly constant as context length grows. (b) GPU memory footprint for Qwen3.5-9B with prefix caching, assuming one linear attention state per 1,024 cached tokens.

Quantizing the recurrent state is a natural way to reduce both memory traffic and footprint, but doing so in a way that preserves model accuracy is challenging. In particular, a naive approach that stores the state in a standard low-bit format and re-quantizes it after every token can substantially degrade accuracy, especially over long thinking traces. We find that accuracy degradation arises from two sources of error. First, quantization error accumulates recurrently: each update starts from an already quantized state, and quantizing the result introduces another rounding error, causing the state to deviate progressively from the FP32 trajectory over a long generation (Figure 3). Second, large outliers are often concentrated in a few rows and columns of the state. These outliers widen the quantization range and force smaller values onto coarse quantization levels, amplifying the error introduced each time the state is quantized. Accurate low-bit quantization therefore requires reducing both how often error is introduced and how much error each quantization introduces.

We propose LeapQuant, a training-free method for recurrent-state quantization that achieves near-lossless model quality. LeapQuant introduces two key ideas that directly address the above sources of error. First, per-window quantization limits error accumulation by allowing LeapQuant to leap over a window of tokens before quantizing the state again (Figure 2). At the beginning of each window, LeapQuant stores the recurrent state in low precision. Within the window, it holds this state fixed, buffers higher-precision token updates, and computes each output from the fixed state and buffered updates. Only at the end of the window does it reconstruct and quantize the full updated state for the next window. As a result, LeapQuant introduces quantization error less frequently, slowing its accumulation over long contexts.

To address quantization error caused by outliers, LeapQuant introduces Compensator Tokens, which capture the state's largest outliers in high precision and thereby reduce the error of each quantization (Figure 4). Each Compensator Token represents a high-precision outer product of two vectors, capturing large-magnitude patterns across both rows and columns and leaving a residual that is easier to quantize. Since these rank-one terms have the same form as real-token updates, LeapQuant incorporates them directly into the window's update path using only a few additional vectors and no separate recurrent state update. LeapQuant further smooths the residual across channels before quantization to reduce error. Both key techniques in LeapQuant are training-free and require no calibration data.

Our evaluation spanning the Qwen, Kimi, and GLM families demonstrates that LeapQuant substantially reduces memory costs and improves inference throughput. Across 12 model–task pairs, LeapQuant achieves accuracy comparable to the FP32 baseline while reducing state memory traffic by 3.4×3.4\times and end-to-end memory footprint by up to 56%. Across NVIDIA B200, RTX PRO 6000, and RTX 5090 GPUs, LeapQuant achieves average speedups of 2.05–3.70×2.05–3.70\times at the kernel level and 1.47×1.47\times for end-to-end inference.

References (47)