STEPQuant:Delta规则循环状态量化中的误差何时与何处重要
STEPQuant: When and Where Errors Matter in Delta-Rule Recurrent State Quantization
September 29, 2026
作者: Bingchen Yao, Haobo Xu, Haokun Lin, Yichen Wu, Ziyu Guo, Renrui Zhang, Zhichao Lu, Zhenan Sun, Ying Wei
cs.AI
摘要
线性注意力用固定大小的循环状态取代了不断增长的KV缓存,但这些持久状态在并发服务下可能成为显著的内存瓶颈。直接将循环状态量化到低精度往往导致严重的精度下降,因为量化误差会通过连续的状态更新传播。我们发现这些误差的影响取决于两个互补维度:在时间维度上,长寿命记忆中的误差会在许多解码步骤中持续存在;在空间维度上,不同键行中的误差对模型输出的影响不同,而状态幅度在行和列方向上都存在显著变化。受这些观察启发,我们提出了STEPQuant,一种用于Delta规则循环状态的时空训练后量化框架。STEPQuant根据误差幅度和记忆寿命分配精度,并基于状态分布以及键行对输出误差的影响,联合拟合键行与值列缩放因子。在Qwen3.8-27B和Kimi-Linear-48B-A3B-Instruct上,针对长生成和短生成基准的实验表明,STEPQuant在标称6比特预算下能够接近FP32状态精度,并且在其4比特配置下优于均匀INT8。集成到SGLang并使用优化的GPU内核后,6比特STEPQuant实现了超过5倍的循环状态压缩,并将总服务内存降低最多68.7%。我们的代码可在https://github.com/Dreamer-Toby/STEPQuant获取。
English
Linear attention replaces growing KV caches with fixed-size recurrent states, yet these persistent states can become a substantial memory bottleneck under concurrent serving. Directly quantizing recurrent states to low precision often leads to severe accuracy degradation, as quantization errors propagate through successive state updates. We discover that the impact of these errors depends on two complementary dimensions: temporally, errors in long-lived memory can persist across many decoding steps; spatially, errors in different key rows affect model outputs differently, while state magnitudes vary substantially along both rows and columns. Motivated by these observations, we propose STEPQuant, a spatial-temporal post-training quantization framework for Delta-rule recurrent states. STEPQuant allocates precision according to error magnitude and memory lifetime, and jointly fits key-row and value-column scales based on state distributions and key-row impact on output error. Experiments on Qwen3.8-27B and Kimi-Linear-48B-A3B-Instruct across both long- and short-generation benchmarks show that STEPQuant closely matches FP32-state accuracy under a nominal 6-bit budget and outperforms uniform INT8 in its 4-bit configuration. Integrated into SGLang with optimized GPU kernels, 6-bit STEPQuant achieves over 5x recurrent-state compression and reduces total serving memory by up to 68.7%. Our code is available at https://github.com/Dreamer-Toby/STEPQuant.