[论文解读] Joint Encoding of KV-Cache Blocks for Scalable LLM Serving
论文提出 Fast Fusion (FF) 及 Batch Fast-Fusion (BFF) 与 Chunks Fast-Fusion (CFF),在请求和块之间联合编码 KV-cache 块,实现高达 4.38× 的 KV-cache 压缩,同时保持准确性,在 LLM 服务中实现真实世界吞吐量提升。
Modern large language models (LLMs) drive interactive AI systems but are bottlenecked by the memory-heavy growth of key-value (KV) caches, which limits real-time throughput under concurrent loads. Existing KV-cache compression methods rely on rigid heuristics, disrupt tensor layouts, or require specialized compute, hindering scalability and deployment. We propose joint encoding of KV-cache blocks, which fuses similar blocks across requests and input chunks into shared representations while preserving standard cache structure. This alleviates the KV-cache memory bottleneck, supporting high-concurrency serving without specialized hardware. Theoretically, we analyze the rate-distortion tradeoff of fused cache blocks under a Poisson process model. Empirically, our method achieves up to 4.38 $ imes$ KV-cache compression with negligible accuracy loss across diverse LLMs and benchmarks, outperforming recent structured and adaptive compression baselines. In real LLM serving, joint encoding improves the token throughput by $\sim$40\% on a single-machine vLLM benchmark, demonstrating substantial gains in inference throughput. Code is available at https://github.com/sef1/kv_fast_fusion kv_joint_encoding.
研究动机与目标
- 解决高并发 LLM 服务中的 KV-cache 内存瓶颈。
- 开发一种通用的块级共享机制,将前缀共享扩展到相似但非完全相同的块。
- 在保持标准 KV-cache 结构的同时实现高压缩和对计算的复用。
提出的方法
- 提出 Fast-Fusion (FF),在余弦相似度超过阈值时联合编码相似的 KV 块。
- 实现两种融合方案:跨请求的 Batch Fast-Fusion (BFF) 与跨输入块的 Chunks Fast-Fusion (CFF)。
- 使用树结构融合策略,实现可扩展的融合复杂度为 O(B log B) 和 O(C log C)。
- 用共享单位向量和块级范数表示融合后的块以保留信息并在注意力计算中实现复用。
- 提供一个使用泊松点过程模型的概率性/解析的码率失真骨架,将相似性阈值与压缩和失真联系起来。
实验结果
研究问题
- RQ1跨请求与跨块联合编码相似 KV 块可以节省多少 KV-cache 内存?
- RQ2当相似性阈值作为函数时,压缩比与精度(失真)之间的权衡关系是什么?
- RQ3在异构工作负载下,BFF 和 CFF 如何影响解码吞吐量、预填充复用和网络带宽?
- RQ4能否将融合后的块有效集成到标准的 vLLM 类 KV-cache 布局中,而不破坏张量结构?
- RQ5描述跨层压缩行为的理论保证或模型(码率—失真、泊松过程)是什么?
主要发现
- 在多种 LLM 和基准上,达到高达 4.38× 的 KV-cache 压缩且几乎无精度损失。
- BFF 在 Llama3.1-8B 和 Qwen2.5-72B 的批大小 128–64 下,压缩比约为 ~3.11× 至 ~4.38×,F1 分数保持或提升。
- CFF 在长输入任务中,预填充时再利用的块数减少约 ~3.25×,且精度损失极小。
- 在真实服务场景中,端到端单机吞吐量显著提升,降低 TTFT、提升有效分批,尽管由更大 GEMM 引起的解码阶段潜在延迟。
- 通过泊松过程的理论分析将相似性阈值与码率—失真联系起来,预测各层的压缩与失真,并支持自动阈值自适应。
阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。