arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2605.17757cs.LGcs.AIcs.DCcs.PF
收藏

OSCAR: 2位KV缓存量化中的离线频谱协方差感知旋转

OSCAR: Offline Spectral Covariance-Aware Rotation for 2-bit KV Cache Quantization

Together AI;University of Sydney(悉尼大学);University of Illinois Urbana-Champaign(伊利诺伊大学厄巴纳-香槟分校)

Zhongzhu Zhou, Donglin Zhuang, Jisen Li, Ziyan Chen, Shuaiwen Leon Song, Ben Athiwaratkun, Xiaoxia Wu

AI总结:

本文提出OSCAR方法,通过离线估计注意力感知的协方差结构,实现2位KV缓存量化的高效和准确,同时开发了可部署的系统,提升了LLM服务框架的性能和效率。

摘要:

INT2 KV-cache量化对于长上下文LLM服务具有吸引力,但实现准确性和可部署性仍然具有挑战。简单的旋转如Hadamard变换可以减少异常值,但仍然在INT2层面失效,因为它们与下游注意力不对齐。我们提出了OSCAR,一种超低比特KV缓存量化方法,通过离线估计注意力感知的协方差结构,并利用这些结构推导出固定旋转和截断阈值用于量化。这样,KV量化就与注意力实际消耗的协方差结构对齐。更重要的是,我们不仅提供了理论依据,还开发了一个完全可部署的OSCAR系统,包含一个定制的INT2注意力内核,该内核与分页KV缓存服务和融合内核流水线保持兼容,从而无缝集成到现代LLM服务框架中,如SGLang和vLLM。我们评估了我们的方法在最近的推理模型上,使用最多32k token的推理轨迹进行跨5个任务的测试。在Qwen3-4B-Thinking-2507和Qwen3-8B上,OSCAR将BF16精度差距分别减少到3.78和1.42个点,而朴素旋转INT2几乎归零。我们进一步将OSCAR扩展到Qwen3-32B和GLM-4.7(358B参数),其中它仍然与BF16保持有效相当。在长上下文-RULER-NIAH(最多128K)上,OSCAR在Qwen3模型上保持稳健,而朴素旋转INT2崩溃。从系统层面来看,OSCAR将KV缓存内存减少约8倍,在相同内存预算下,大批次大小下吞吐量提高最多7倍,并且由于内存带宽开销减少,单批次解码速度比BF16快最多3倍。

英文摘要:

INT2 KV-cache quantization is attractive for long-context LLM serving, yet making it both accurate and practical remains challenging. Data-oblivious rotations such as Hadamard transforms flatten channel outliers, but still degrade sharply at INT2 because they ignore how downstream attention queries the cache. We propose OSCAR, an ultra-low-bit KV-cache quantization method that estimates attention-aware covariance targets offline and uses them to derive fixed per-layer rotations and clipping thresholds. By aligning the quantization basis with the second-moment structures consumed by attention, OSCAR preserves attention fidelity at 2-bit precision. Beyond theoretical analysis under a frozen-error surrogate, we build a serving-ready OSCAR system with fused Triton write and decode kernels that preserve paged KV-cache layouts and prefix caching, integrating into modern serving engines such as SGLang and vLLM. We evaluate OSCAR on reasoning and coding benchmarks with generation traces of up to 32K tokens across five tasks. On Qwen3-4B-Thinking-2507 and Qwen3-8B, OSCAR narrows the BF16 accuracy gap to 3.78 and 1.21 points, respectively, where Hadamard-only INT2 collapses, and matches BF16 within run-to-run variance on Qwen3-32B and GLM-4.7 (358B parameters). On RULER-NIAH up to 128K tokens, OSCAR substantially outperforms QuaRot-style INT2 across context lengths. System-wise, OSCAR compresses KV-cache memory by nearly $8\times$, boosts multi-request throughput by up to $7.8\times$ at large batch sizes within the same memory budget, and accelerates batch-size-1 decoding by up to $3.1\times$ over BF16 by cutting KV memory traffic.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑