LoomKV: Lossless KV Cache Compression Extending from GPU Memory to SSD

LoomKV uses lossless compression to expand both the external storage tier and GPU pool capacity of KV cache without modifying the inference engine.
LoomKV tackles the two-level capacity bottleneck of KV cache in LLM inference—the external storage tier and the GPU KV pool—with a lossless compression scheme that avoids numerical drift from lossy compression. Its core is a head-wise calibrated two-level 3-bit codebook that compresses only the BF16 high byte, bit-identical after decompression, shrinking BF16 KV to 0.71 and FP8 KV to 0.85-0.87 across nine models. Tier mode via TileStream makes the compressed tier equivalent to a 1.4x larger original tier, boosting effective throughput 2.7-3.6x near the LRU cliff; pool mode via FragPack and a fused decode kernel decompresses in place, holding 1.31-1.34x more GPU tokens. The modes stack, cost at most 2.2% throughput when capacity is ample, and are built on LMCache and vLLM without engine changes.
Title
LoomKV: Lossless KV Cache Compression Extending from GPU Memory to SSD
Meta Description
LoomKV proposes a lossless KV cache compression scheme that compresses the high byte of BF16 values via head-wise calibrated two-level 3-bit codebooks, operating on both the external storage tier and the GPU KV pool. The tier mode delivers 2.7-3.6x effective throughput near the LRU cliff, while the pool mode accommodates 1.31-1.34x more GPU tokens, and both are bit-identical to the original tier.
Article Content
In LLM inference serving, KV cache memory is becoming a more vexing bottleneck than compute. Multi-turn conversations and Agent requests need to reuse prompt prefixes, so engines offload KV cache from GPU memory to host DRAM or even SSD. Capacity limits therefore emerge at two levels: the external storage tier determines how long a prefix can be reused before eviction, while the GPU KV pool constrains the number of concurrent long requests. Most existing solutions rely on lossy compression to trade for space, at the cost of rewritten KV values and drifting output quality. LoomKV's approach is to achieve lossless compression on both the external storage tier (tier mode) and the GPU pool (pool mode) without modifying the engine.

Two-Level Capacity Bottleneck and Two Paths for Compression
Hierarchical KV cache offloading is already mainstream, but it splits the problem into two mutually independent constraints. The capacity of the external tier determines how many times a prefix can be reused before being evicted by policies such as LRU; once the hit rate drops, time-to-first-token (TTFT) spikes. The capacity of the GPU pool directly determines how many long requests can be accommodated simultaneously; when the pool is too small, requests can only queue.
LoomKV's entry point is not to modify the scheduling logic of engines like vLLM, but to perform lossless compression at the data representation level. "Lossless" means the decompressed KV values are bit-identical to the original BF16 values, not approximately restored. This determines that it can serve both levels simultaneously: after compression, the external tier still guarantees correctness of prefix reuse, and after compression, the GPU pool does not affect the numerical precision of attention computation.
KV Cache and Hierarchical Offloading: In autoregressive LLM inference, generating each token requires caching the Key and Value vectors of all previous tokens to avoid redundant computation; this cache is the KV cache. Its size is proportional to sequence length, number of layers, and number of attention heads, and can easily overflow GPU memory under long contexts or high concurrency. Hierarchical offloading moves inactive KV blocks progressively from GPU memory to host DRAM or even SSD, and retrieves them when needed. LMCache is a representative open-source implementation of this idea; it attaches an external cache tier alongside engines like vLLM and manages prefix reuse with policies such as LRU. But offloading merely shifts the capacity pressure: the external tier and the GPU pool each form independent bottlenecks, and cross-tier transfers introduce additional latency, so compressing the data itself becomes a direct means of increasing effective capacity at both levels.
How the 3-bit Two-Level Codebook Compresses BF16
LoomKV's compression core is a head-wise calibrated two-level 3-bit codebook that operates on the high byte of BF16, i.e., the sign bit plus the upper seven exponent bits. The observational basis for this design is that the dynamic range of BF16 values is mainly determined by the exponent, while the mantissa is relatively less sensitive in attention computation; by representing the high byte with a compact codebook and separately preserving the low bits, the size can be reduced without loss of precision.
In measured results across nine models, LoomKV compresses BF16 KV to 0.71 of the original size, and FP8 KV to 0.85 to 0.87. The compression ratio does not look aggressive, but this is the result under a lossless premise, and it is not on the same evaluation dimension as schemes that trade precision for space.
Numerical Structure of BF16 and High-Byte Compression: BF16 (Brain Floating Point 16) has 16 bits in total, consisting of 1 sign bit, 8 exponent bits, and 7 mantissa bits; compared with FP32, it retains the full dynamic range of the exponent and sacrifices only mantissa precision. Its high byte contains exactly the sign bit and the upper 7 exponent bits, essentially determining the magnitude of the value; the low byte carries the mantissa and the lowest exponent bit. LoomKV performs codebook quantization only on the high byte and preserves the low bits as-is, so it can be restored bit-for-bit after decompression. The so-called "two-level codebook" usually means first using a coarse codebook to index the interval to which the value belongs, then using a fine codebook to locate within the interval, thereby representing the original 8-bit high byte with 3 bits. The codebook is calibrated separately per attention head because the value distributions of different heads differ significantly, and a unified codebook would introduce errors; only per-head calibration can approach the theoretical compression limit without loss of precision.
Tier Mode: Making the Compressed Tier Behave Like a Larger Original Tier
On the external storage tier, LoomKV introduces the TileStream mechanism: writes are recorded at exact length, and length readback is moved out of the load path, so the storage, eviction, and prefetch logic of the tier layer remain unchanged, and the engine does not need to be aware of compression. When records are retrieved, the data is decompressed directly into scattered GPU pages, skipping the intermediate reorganization step.
The effect of this design on the AgentX workload is quite direct: the compressed tier behaves like an original tier with 1.4x the capacity. Near the LRU cliff of LMCache, tier mode delivers 2.7 to 3.6x the effective throughput of the original tier, with average TTFT reduced by 1.9 to 3.1x; when switching to other simulated replacement policies, the cliff position shifts similarly. For repeated prompts, through the SSD-to-DRAM promotion mechanism, TTFT can be shortened by up to 1.7x. It should be emphasized that tier mode is bit-identical to the original tier, which means there is no semantic deviation in reuse behavior.
Pool Mode: In-Place Decompression Within GPU Pages
On the GPU pool side, the problem is more subtle: compressed records become variable-length and scattered, and the traditional approach requires decompressing to a contiguous buffer before handing off to the attention kernel; the extra overhead would offset the compression gains. LoomKV's FragPack packs variable-length records into smaller shared-budget GPU pages, and a fused decode attention kernel reads them in place.
This fused kernel is faster than FlashAttention-3 on BF16 while maintaining numerical precision on par with the latter. The effect is that when the tier layer is sufficient to hold the working set, pool mode can hold 1.31 to 1.34x more GPU tokens; in scenarios where the original tier can hold only 8 long requests, it can accept 12 long requests while queue length and effective throughput are roughly comparable to the original tier.
FlashAttention and Fused Decode Attention Kernel: FlashAttention is an IO-aware exact attention algorithm that avoids writing the full attention matrix to GPU memory through tiled computation and online softmax, significantly reducing memory usage and improving speed; its third-generation version (FlashAttention-3) is optimized with asynchronous pipelining for the Hopper architecture. LoomKV's fused decode kernel merges "decompressing KV records" and "attention computation" into the same kernel function, decompressing while participating in matrix multiplication, eliminating the intermediate step of first decompressing to a contiguous buffer. Since the decoding phase processes only one new token's query against historical KV at a time, it is a memory-bound scenario; integrating decompression into the compute path can effectively hide decompression overhead, which is one reason its speed can exceed FlashAttention-3.
Joint Benefits and Costs Under Dual Constraints
The real test of the scheme is when the tier layer and GPU pool are both tight. On a trace from an AI IDE, tier mode and pool mode increase effective throughput by 1.24x and 1.59x, respectively. This shows that two-level compression is not a mutually exclusive optimization, but a stackable means of capacity expansion.
On the cost side, in scenarios where the original capacity is already sufficient, compression brings at most a 2.2% throughput loss. This is an acceptable trade-off: almost imperceptible when capacity is abundant, with significant gains when capacity is tight. LoomKV is built on LMCache and vLLM and does not require modifying the engine itself, which may be more important for engineering deployment than the compression ratio numbers.
Editorial View
The value of LoomKV lies not in pursuing extreme compression ratios, but in redefining the applicable boundary of compression. Lossy compression has long been regarded as the default option for KV cache management, but it sets numerical correctness and serving capacity as opposites. LoomKV proves that by calibrating at the granularity of attention heads and compressing only the high byte, substantial capacity gains can be achieved under a lossless premise, and these gains can be realized at both the tier layer and the GPU pool. For teams planning capacity for long-context and Agent workloads, this provides a path to scale capacity without sacrificing output quality.
One-line Summary
LoomKV uses lossless compression to simultaneously expand the capacity of the KV cache external storage tier and GPU pool without modifying the inference engine.
Paragraph Summary
LoomKV addresses the two-level capacity bottleneck of KV cache in LLM inference—the external storage tier and the GPU KV pool—by proposing a lossless compression scheme that avoids the numerical drift caused by lossy compression. Its core is a head-wise calibrated two-level 3-bit codebook that compresses only the high byte of BF16, with decompressed values bit-identical to the originals; across nine models it compresses BF16 KV to 0.71 and FP8 KV to 0.85-0.87. Tier mode uses TileStream to make the compressed tier equivalent to an original tier with 1.4x capacity, improving effective throughput by 2.7-3.6x near the LRU cliff; pool mode uses FragPack and a fused decode kernel for in-place decompression, accommodating 1.31-1.34x more GPU tokens. The two modes are stackable, with at most a 2.2% throughput loss when capacity is sufficient, and are built on LMCache and vLLM without requiring engine modifications.
Related articles

μ-Bench: A Benchmark for Multi-User Voice Agents in Shared Spaces
μ-Bench is the first closed-loop benchmark for multi-user voice agents in shared spaces, covering 800 cases across 20 domains and evaluating joint task success with privacy boundaries. Proprietary systems succeed about 60% of the time, while open-source models fall below 20%.

DRBench Pro: A Deep Research Agent Benchmark Centered on Knowledge Coverage
DRBench Pro is a deep research agent benchmark centered on knowledge coverage, using Wikipedia knowledge trees to generate queries and rubrics and evaluate agents on breadth and depth. It includes 144 cases and 44,102 rubrics, with the best agent achieving 57.04% coverage.

How Proverbs Reveal Collective Behavioral Norms: AI Quantitatively Analyzes 50,000 English Proverbs
A new study uses LLMs to analyze nearly 50,000 English proverbs, quantifying their collective behavioral norms: advice on controllable matters, descriptions of uncontrollable ones, consistent caution/honesty/long-term orientation, and contradictory advice on genuine trade-offs like autonomy vs. conformity.