NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

LoomKV: Lossless KV Cache Compression from GPU Memory to SSD for LLM Serving

Wentao Zhu, Ziao Sheng, Peng Deng, Huiqi Hu, Xuan Zhou, Xing Wei, Zhuang WangarXiv 2026

TL;DR

Serving long-context AI agents eats up massive amounts of memory because engines store past conversation calculations—the Key/Value (KV) cache—across GPUs, host DRAM, and SSDs. LoomKV introduces a fast, lossless compression scheme that shrinks this cache by ~29% across the entire memory hierarchy without changing a single model output bit. By cleverly exploiting the skewed bit patterns of 16-bit floating-point numbers, it effectively gives your GPUs and storage drives 1.4× more capacity for free—at full speed.

What Problem Does This Paper Address?

When you chat with an LLM or run an autonomous coding agent, the system repeatedly sends back a growing history of text. Re-reading that prefix from scratch every turn is painfully slow, so serving engines (like vLLM) save intermediate math states in a KV cache. Because this cache balloons quickly—nearly 100 KB per token on a 30B model—systems spill older cache blocks from precious GPU memory out to host DRAM and SSDs.

Capacity bottlenecks hit at two distinct places:

  1. External Tiers (DRAM/SSD): If storage fills up and evicts cached prefixes just before an agent needs them again, performance falls off a "capacity cliff," forcing expensive recomputation.
  2. GPU KV Pool: Even if a prompt’s cache sits ready in DRAM, active requests still need room on the GPU itself to run. Full GPU pools force requests to wait in a queue.
Fig. 1. Three observations on raw KV. (a) Goodput by tier size. (b) Requests running and waiting in vLLM. (c) Mean shares of BF16 high and low bytes covered by the top 7, next 7, and remaining 242 values. We rank high- and low-byte values separately within each tensor and average the shares over all 96 tensors (one K and one V per layer across 48 layers).

Existing compression solutions usually quantize numbers or drop tokens. That’s lossy—it subtly alters outputs and requires nerve-wracking accuracy re-testing for every task. Meanwhile, standard lossless GPU compressors (like LZ4 or ANS) are either blind to floating-point patterns or far too slow for parallel GPU execution.

Methods

The authors observe a neat quirk in 16-bit Brain Float (BF16) numbers: while the lower 8 bits look like random noise, the upper 8 bits (sign + upper exponent) are wildly repetitive. Within any attention head, just 7 values account for ~94% of all high bytes, and the top 14 cover 99.81%.

LoomKV builds a static, offline-calibrated two-level 3-bit code per attention head. Low bytes stay untouched. High bytes map to values 0–6; value 7 acts as an "escape" to a second 3-bit table, and a double-escape stores the rare raw byte verbatim. Because codes have fixed widths rather than variable bit-streams like Huffman coding, all 32 threads in a GPU warp can decode symbols in lockstep using single-instruction byte permutations (PRMT) with zero branch divergence.

Fig. 3. The lossless KV code on eight BF16 scalars. Low bytes stay verbatim; high bytes are coded through a calibrated two-level 3-bit codebook per KV head in each layer’s K or V tensor (entry 7 marks an escape).

LoomKV deploys this code in two modes on an unmodified vLLM + LMCache stack:

  • Tier Mode (TileStream): Compresses KV blocks going to DRAM and SSD into exact-length objects, then decompresses them over PCIe straight into scattered GPU memory pages—skipping temporary staging buffers. Background worker threads and rotating buffers keep CPU/GPU synchronization off the critical path.
  • Pool Mode (FragPack): Keeps the GPU’s own KV pool compressed inside smaller, shared-budget physical pages. A custom decode-attention kernel stages compressed records and decompresses them directly into GPU registers right before tensor-core matrix multiplication.
System overview comparing LoomKV's Tier Mode and Pool Mode architectures

Datasets

  • AgentX: Replays 393 real-world Claude Code agent session trees (cc-traces, prompts up to 254K tokens) to stress-test prefix caching and multi-turn reuse.
  • Production-derived AI IDE Trace: A 3-hour open-loop replay of 5,098 internal coding assistant requests (mean prompt 68K tokens).
  • Accuracy & Calibration Suites: GSM8K and RULER (up to 128K context) to verify numerical precision, plus diverse text domains (prose, code, Chinese chat, math, random tokens) across nine Qwen, Llama, and GLM models (4B–72B).

Key Insights and Ideas

  • Saved bytes aren't capacity unless the allocator knows: Outputting shorter byte arrays does nothing if memory slots remain fixed-size. Exact-length object allocation in DRAM/SSD and shared variable-length page budgets on the GPU are what actually convert compression ratios into extra capacity.
  • Compression makes fused attention faster, not slower: You might expect on-the-fly decompression during every token generation step to slow down attention. Instead, because decode attention is bottlenecked by memory bandwidth, reading 30% fewer bytes from GPU memory lets LoomKV’s fused kernel beat FlashAttention-3 and FlashInfer on BF16!
  • One tiny calibration rules them all: Exponent distributions depend on model weights, not user prompts. Calibrating codebooks once offline on a single 1,024-token pass generalizes cleanly across languages, coding tasks, and 240K-token contexts.
  • Lossless stacks on lossy: Because LoomKV preserves bits faithfully, it even compresses already-quantized FP8 caches down to 85–87% of their size after subtracting static per-channel offsets.

Key Results

  • Consistent Compression: Shrinks BF16 KV caches to 0.70–0.71× raw size across all nine models (within 3.6% of the theoretical entropy limit) and restores paged GPU memory at 1,182 GB/s (6.5× faster than nvCOMP ANS).
  • Shifting the Storage Cliff (Tier Mode): Compressed external tiers behave identically to 1.4× larger raw tiers. Near LMCache's eviction cliff on AgentX, Tier Mode boosts goodput (requests meeting strict latency targets) by 2.7–3.6×, cuts mean time-to-first-token (TTFT) by 1.9–3.1×, and delivers bit-for-bit identical text outputs.
  • Higher GPU Concurrency (Pool Mode): Fits 1.31–1.34× more tokens in GPU memory, allowing 12 concurrent long-context requests to run with the same low queueing and high goodput as 8 requests on an uncompressed GPU.
  • Constrained Real-World Trace: On the AI IDE workload where both storage and GPU memory are tight, Tier Mode and Pool Mode lift goodput by 1.24× and 1.59×, respectively. When raw capacity is already plentiful, overhead is at most 2.2% throughput.

Limitations and Future Work

  • Power-Capped FP8 Pool Mode: While FP8 works great in Tier Mode, FP8 Pool Mode sees limited end-to-end gains because shared GPU pages must accommodate the least-compressible layer, and the FP8 fused kernel runs slightly slower than FlashAttention-3 when GPUs hit their 700W power cap.
  • Untested Architectures & Topologies: Evaluation focuses on single-node Tensor Parallelism over PCIe with Grouped-Query Attention (GQA). Pipeline/expert parallelism, multi-node shared cache servers, FP4 KV caches, and Multi-head Latent Attention (MLA—which would require adapting the Pool Mode kernel) remain avenues for future work.

Summary updated

BibTeX
@misc{zhu2026loomkv,
  author = {Wentao Zhu and Ziao Sheng and Peng Deng and Huiqi Hu and Xuan Zhou and Xing Wei and Zhuang Wang},
  title = {{LoomKV: Lossless KV Cache Compression from GPU Memory to SSD for LLM Serving}},
  year = {2026},
  eprint = {2611.32954},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.32954},
}
Figure