SealKV: calibration-free KV cache quantization in sealed blocks
TL;DR. SealKV quantizes the KV cache (the stored keys and values a model re-reads at every generated token) only after a block of tokens is complete ("sealed"). It subtracts a per-channel offset that neighbouring tokens share, then codes the small residuals jointly with trellis-coded quantization, a scheme that wastes fewer bits than rounding each value on its own. The earliest tokens (attention sinks) and the newest, still-open block stay in BF16. A fused attention kernel rebuilds values in GPU registers, so the compressed cache is never expanded back into HBM. With no calibration it is close to lossless at 3 bits and above, loses as little as 0.37 points at 2 bits on Qwen3-14B, and in vLLM at 64K context on one H100 reaches 2.81x (4-bit) and 3.44x (2-bit) peak decode throughput over BF16 with about 6x less KV memory. The throughput gain comes mostly from larger batches in the freed memory, not faster single requests.
flowchart LR
N["New tokens<br/><small>BF16, still arriving</small>"] --> B["Sealed block<br/><small>full, ready to code</small>"]
B --> O["Subtract offset<br/><small>shared per channel</small>"]
O --> T["Trellis code<br/><small>2-4 bits per value</small>"]
T --> K["Fused kernel<br/><small>decode in registers</small>"]
K --> A["Attention<br/><small>no extra HBM traffic</small>"]
classDef input fill:#d0ebff,stroke:#1971c2,color:#1b1b1b,stroke-width:2px
classDef loop fill:#fff3bf,stroke:#f08c00,color:#1b1b1b,stroke-width:2px
classDef core fill:#e5dbff,stroke:#6741d9,color:#1b1b1b,stroke-width:2px
classDef exit fill:#d3f9d8,stroke:#2f9e44,color:#1b1b1b,stroke-width:2px
class N input
class B,O loop
class T,K core
class A exit
linkStyle 4 stroke:#2f9e44,stroke-width:2px
Key points
- Offset first, then code. If a channel holds 100, 101, 102 across three tokens, store 101 once and keep -1, 0, 1. Small residuals survive low bit widths. The offset trick alone lifts three existing KV quantizers by up to 32 points on GPT-OSS-120B retrieval.
- Joint coding. Trellis-coded quantization encodes a sequence of values together, choosing a path through a small state machine, so quantization error is lower than per-value rounding at the same bits.
- No decompression pass. Decode happens in registers inside the attention kernel. This is what turns memory savings into throughput rather than overhead.
- Results: near-lossless at 3-4 bits on Qwen3; 2-bit drops more but as little as 0.37 points on Qwen3-14B; vLLM, 64K, H100: 2.81x / 3.44x peak decode throughput, about 6x less KV memory at 2 bits.
Gaps
- Tested on Qwen3 and GPT-OSS at 64K. Not shown on hybrid linear-attention models (Qwen4, Olmicro), where most layers keep no growing cache and the payoff shrinks.
- Peak throughput is a batch-capacity number. Latency per request is not the headline.
Relation to prior wiki
- Extends the 12-03 Hopper 4-bit KV kernel, which showed the bottleneck for low-bit KV is instructions per byte in the decode kernel, not the format. SealKV makes the same bet (fuse decode into attention) and adds a better code.
- Confirms the 12-03 point that quantization frees memory uniformly and so composes with paged allocators, while token eviction leaves holes (NVIDIA's "evict 90%, free nothing" post, 11-02). Sealed blocks map naturally onto pages.
- Same idea in silicon, same day: AWS's Trainium4 does trellis coding in hardware for 4-bit weights and claims 98% of the theoretical precision limit. Trellis coding is now showing up in both a KV paper and a chip.
- Concept pages: kv-cache, quantization.
Source: arXiv 2612.02036 · @_avichawla explainer · raw: raw/twitter/feed/2026-12-03-afternoon-ranked.json