arXiv:2511.18643cs.LGcs.AI2025-11被引 7

2-bit KV缓存量化实现近零精度损失,大幅降低显存占用

Kitty: Accurate and Efficient 2-bit KV Cache Quantization with Dynamic Channel-wise Precision Boost

  • 按敏感度动态保留部分通道为4位,其余用2位,实现混合精度
  • 在7个任务上减少8倍显存,吞吐提升2.1至4.1倍
  • 适合需要长上下文推理的大型语言模型部署场景

KV缓存是大模型推理中的主要内存瓶颈。虽然4比特量化能保持精度,但2比特常导致精度下降,尤其在长文本推理中。本文通过算法-系统协同设计提出Kitty方案:实验表明,动态通道级精度增强(按敏感度排序,仅保留少数通道为高精度)可实现几乎零精度损失的同时接近2比特内存开销。核心挑战在于如何在保持页面布局连续、去量化统一的前提下处理动态4比特通道提升,避免分散读取与硬编码掩码。Kitty将每个混合精度键缓存页分解为两个统一2比特张量,构建基于页面的KV布局,提供Triton兼容的去量化内核及轻量级运行时管道,有效维持内存访问连续性与无分支执行。在七项任务及两个模型族(Qwen3, LLaMA3)上,Kitty将KV内存减少近8倍,精度损失可忽略,支持8倍更大批量,相同显存下吞吐提升2.1至4.1倍。完整代码已开源:https://github.com/Summer-Summer/Kitty。

原文摘要 · Abstract (English)

The KV cache is a dominant memory bottleneck for LLM inference. While 4-bit KV quantization preserves accuracy, 2-bit often degrades it, especially on long-context reasoning. We close this gap via an algorithm-system co-design for mixed-precision KV caching: Kitty. On the algorithm side, extensive experiments show that Dynamic Channel-wise Precision Boost -- which ranks Key-cache channels by sensitivity and keeps only a small fraction at higher precision -- maintains near-zero loss in accuracy drop while approaching 2-bit memory. The main challenge is handling dynamic 4-bit channel boosts while keeping the page layout coalesced and the dequantization uniform, with no scattered reads or hard-coded masks. Kitty addresses these issues by decompose each mixed-precision Key page into two tensors with unified 2-bit precision. Based on this, Kitty provides a page-centric KV layout, Triton-compatible page dequantization kernels, and a lightweight runtime pipeline that preserves coalescing and avoids divergence. Across seven tasks and two model families (Qwen3, LLaMA3), Kitty cuts KV memory by nearly 8x with negligible accuracy loss, enabling up to 8x larger batches and 2.1x-4.1x higher throughput under the same memory budget. We release the full implementation of Kitty at https://github.com/Summer-Summer/Kitty.

KV缓存量化大模型推理显存优化

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。