Skip to content
leapquantPublic

About

LeapQuant: Efficient Linear Attention with Accurate Recurrent State Quantization

Resources

Stars

64 stars

Watchers

1 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LeapQuant

Efficient Linear Attention with Accurate Recurrent State Quantization

Near-lossless 8-bit recurrent states, training-free. LeapQuant quantizes the recurrent state of linear attention models in the Qwen, Kimi, and GLM families, achieving average speedups of 2.05–3.70× at the kernel level and 1.51× end to end.

🔥 News

  • [2026/11] LeapQuant is open-sourced!

📚 About

Recent LLMs replace many standard attention layers with linear attention, such as Gated DeltaNet (GDN) and Kimi Delta Attention (KDA). Linear attention compresses the context into a fixed-size recurrent state, but reading and updating that state at every decoding step remains a major inference bottleneck.

Quantization is a natural way to reduce this cost, but it can significantly degrade model quality. Rounding errors accumulate across decoding steps, and outlier rows and columns in the state make each quantization step inaccurate. LeapQuant addresses both problems with three training-free techniques:

  • Per-window quantization limits error accumulation by quantizing the state only once per window of tokens.
  • Compensator Tokens keep the state's largest outliers in high precision.
  • Residual smoothing balances the remaining residual before quantization.

🧠 Method

① Per-window quantization

To limit error accumulation, LeapQuant leaps over a window of tokens and quantizes the state only once, at the end of the window. Within the window, the low-bit state stays fixed, token updates are buffered in high precision, and each output is computed from the fixed state together with the buffered updates.

② Compensator Tokens

To reduce the error of each quantization step, LeapQuant keeps the state's largest outliers in high precision as a few Compensator Tokens. Each one is a rank-one outer product, the same form as a real-token update, so it shares the window's update path at almost no extra cost.

③ Residual smoothing

After the Compensator Tokens are removed, the residual can still have uneven magnitudes across key channels. LeapQuant rescales each key row before quantization to balance these magnitudes. The smoothing scales are recomputed at every window boundary.

🚀 Results

With accuracy comparable to the FP32 baseline, LeapQuant achieves average speedups of 2.05–3.70× at the kernel level and 1.51× for end-to-end inference on NVIDIA B200, RTX PRO 6000, and RTX 5090 GPUs.

🎯 Accuracy (%) on AIME 2026, BeyondAIME (Beyond), GPQA-Diamond (GPQA), and LiveCodeBench v6 (LCB):

MethodQwen3.5-9BGLM-5.3-FlashQwen3.8-Flash-NextAvg.
AIMEBeyondGPQALCBAIMEBeyondGPQALCBAIMEBeyondGPQALCB
FP3287.963.381.364.192.280.792.185.298.585.191.486.884.0
BF1672.133.766.249.676.757.290.674.696.878.890.284.072.5
8-bit methods
LeapQuant87.964.081.864.191.183.291.287.599.085.391.685.884.4
KVQuant70.339.966.855.587.972.890.683.094.774.287.279.975.2
TurboQuant67.943.262.042.283.867.389.973.895.478.489.984.773.2
QuaRot11.47.438.235.691.076.290.978.688.361.084.772.061.3
INT83.91.817.210.787.466.890.467.467.541.861.356.047.7
FP80.00.12.25.969.644.282.053.282.552.876.871.545.1
6-bit methods
LeapQuant87.963.681.065.492.982.791.286.398.885.889.986.884.4
TurboQuant19.37.233.213.088.166.888.066.294.473.188.283.760.1
MXFP60.00.00.80.571.444.882.753.459.234.663.358.039.1
NVFP60.00.11.57.639.217.167.836.980.452.973.767.437.1
4-bit methods
LeapQuant85.060.180.061.385.067.691.672.892.572.690.679.978.3
TurboQuant3.51.426.811.559.743.277.949.479.349.874.962.845.0
MXFP40.00.03.70.325.318.670.929.31.72.825.422.616.7

⚙️ Kernel throughput of one linear attention layer:

⚡ Decode throughput in vLLM at context length 4K:

🌐 End-to-end throughput in vLLM:

🛠️ Usage

LeapQuant is integrated into vLLM 0.30.0 as a plugin and supports the Qwen (Gated DeltaNet) and GLM (Kimi Delta Attention) models.

git clone https://github.com/leapquant/LeapQuant.git
cd LeapQuant && pip install -e .

bash serve.sh <model>

serve.sh starts an OpenAI-compatible vLLM server with 8-bit recurrent states; extra arguments are passed to vllm serve.

📝 Citation

@article{pan2026leapquant,
  title   = {LeapQuant: Efficient Linear Attention with Accurate Recurrent State Quantization},
  author  = {Pan, Yi and Xi, Haocheng and Zhu, Kan and Li, Xingyang and Wu, Yibo and Mishra, Mayank and
             Zhang, Hongtao and Zheng, William X. and Kasikci, Baris and Han, Song and Keutzer, Kurt and
             Iyer, Rishabh and Stoica, Ion},
  journal = {arXiv preprint arXiv:2609.38166},
  year    = {2026}
}

🙏 Acknowledgement

LeapQuant is built on vLLM, TileLang, and Flash Linear Attention. We also extend our thanks to the Kernel Design Agents (KDA) team for co-evolving the kernels for LeapQuant.

About

LeapQuant: Efficient Linear Attention with Accurate Recurrent State Quantization

Resources

Stars

64 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages