Papers

KVSeal:用无损压缩的 KV Cache 服务长上下文 LLM

KVSeal: Serving Long-Context LLMs with Losslessly Compressed KV Caches

Why we picked it

长上下文推理时 KV Cache 才是开销大头,这篇论文用定长编码做在线无损压缩,压掉约 30% 存储,解码还比 FlashAttention-2 快最多 27%,精度一点不掉。做推理部署和长上下文服务的人可以看看,比低比特量化那类有精度风险的路子更稳。

arXiv 论文 KVSeal 提出将无损压缩作为 KV Cache 的常驻形态,实现约 1.3 倍的常驻 KV 存储压缩,同时保证每个 K/V 位不丢失。其压缩页格式利用 BF16 KV 指数的集中特性,采用定长编码并设定有界的转义存储,每个压缩页自带编码值和转义记录,可独立存储、按位还原,并被注意力直接消费。

Body

系统层面的关键在于压缩感知的页生命周期管理:cache 增长时在线压缩原始页,解码阶段注意力同时读取原始与压缩两种格式,边消费边重建压缩值。基准测试显示,KVSeal 相比 FlashAttention-2 最高取得 1.27 倍解码注意力加速,相比原版 vLLM 取得最高 1.19 倍端到端解码加速。

这不同于会改变注意力可见内容或数值精度的淘汰、稀疏注意力和低比特量化方案——后者在短 prompt 上达标的方法可能在长上下文任务上掉精度,KVSeal 的按位无损特性规避了这一风险。

Original · arXiv cs.AI

KVSeal: Serving Long-Context LLMs with Losslessly Compressed KV Caches

Long context is what lets an LLM serve real workloads: a single request can carry an entire repository, a document collection, or a long agent trajectory. It also makes the KV Cache, rather than the model weights, the dominant serving cost, because the cache grows linearly with the context and every decode step rereads all of it. Eviction, sparse attention, and low-bit quantization shrink this cost by changing which K/V entries attention sees or what values they carry, so accuracy that holds on short prompts can collapse on the long-context tasks these systems target. Lossless compression can reduce KV storage while preserving every original K/V bit. Prior uses of lossless compression include shrinking static weights and reducing KV transfers between workers. Applying it to resident KV, however, requires the serving system to compress pages online as they fill, manage them independently as requests progress, and keep them accessible to decode attention. We present KVSeal, which makes lossless compression the resident form of the KV Cache. We exploit the strong concentration of BF16 KV exponents to design a lossless page format with fixed-length codes and bounded escape storage. Each compressed page carries its own encoded values and escape records, allowing it to be stored, reconstructed bit for bit, and consumed by attention independently of other pages. A compression-aware page lifecycle manages raw and compressed pages as the cache grows. During decode, attention reads both formats and reconstructs compressed values as it consumes them. KVSeal achieves about $1.3\times$ resident KV compression, up to $1.27\times$ decode attention speedup over FlashAttention-2, and up to $1.19\times$ end-to-end decode speedup over stock vLLM.

Industry Coordinates & Source Verification

This report is categorized under AITOP's "Papers" desk, focusing on US frontier AI labs and Silicon Valley technology leaders. Within our cross-regional analytical framework, it directly maps to AI developer toolchains, coding agents, and engineering workflows. Key entities and technical topics under continuous tracking include KVSeal, KV Cache, FlashAttention-2, vLLM.

Source attribution: curated from arXiv cs.AI (@Hangyu Liang, Zeyu Mi).