通过分页低秩分解,大幅压缩大模型推理时的键值缓存占用。
PuzzleKV: Page-Wise Low-Rank Decomposition for KV Cache Compression
- 将键值缓存按页划分,每页独立进行低秩分解压缩。
- 在60%存储预算下保持96%以上全量性能,优于全局奇异值分解。
- 无需训练和校准,适合长期上下文推理场景使用。
大语言模型长上下文推理受限于键值(KV)缓存的内存消耗。低秩压缩通过降低历史标记的存储成本缓解此问题。现有方法通常从模型权重中提取固定投影空间,或基于校准激活构建共享基底,难以捕捉关键细节。本文观察到每个头的KV缓存按固定长度划分为逻辑页后,单个页面内存在显著低秩结构。据此提出PuzzleKV:一种无训练、无校准的方法,将完成的每一页视为独立压缩单元,对每层每头的页面进行分解,直接在密集与因子化页面上计算注意力,并在自回归解码中增量压缩新就绪页面。跨模型、上下文长度与基准测试的实验表明,在相同存储预算下,PuzzleKV在约60%原始存储下达到超过96%的全量性能,相比全局奇异值分解在RULER上表现显著提升,在LongBench上表现具有竞争力。进一步结合量化可实现更激进压缩比,仅需18.7%存储仍保持93%以上性能。
原文摘要 · Abstract (English)
Long-context inference in large language models (LLMs) is increasingly limited by the memory required for the key-value (KV) cache. KV cache compression addresses this problem by reducing the storage cost of previous tokens. Among existing approaches, low-rank compression is particularly attractive because it represents every token in reduced dimensions. Previous low-rank methods typically derive fixed projection spaces from model weights, construct fixed spaces from calibration activations, or construct a shared basis over a broad cache region. Such representations may not capture detailed but important information. We partition each per-head KV cache into fixed-length logical pages and observe substantial low-rank structure within individual pages. Based on this observation, we propose PuzzleKV, a training- and calibration-free method that treats each completed page as an independent compression unit. PuzzleKV decomposes pages within each layer and KV head, computes attention directly over dense and factorized pages, and incrementally compresses newly eligible pages during autoregressive decoding. Experiments across models, context lengths, and benchmarks demonstrate the effectiveness of PuzzleKV under matched storage budgets. At approximately 60% of the original KV cache storage, PuzzleKV achieves more than 96% of Full KV performance across both evaluated models and all benchmark settings, with substantial gains over Global SVD on RULER and competitive performance on LongBench. To achieve a more aggressive compression ratio, PuzzleKV can be further combined with quantization while retaining more than 93% of Full KV performance using only 18.7% of the original storage.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。