SealKV: Low-Bit Trellis KV Cache Compression (3.44x vLLM Speedup)

SealKV (arXiv:2612.02036, Princeton & Amazon Annapurna Labs) brings calibration-free trellis-coded quantization (CPTC) to growing LLM KV caches via sealed blocks, Hadamard rotations, and block-mean subtraction. It delivers up to 6.6x KV memory reduction (2.41 bits/value) and 2.81x–3.44x end-to-end vLLM throughput at 64K context.
SealKV: Low-Bit Trellis KV Cache Compression (3.44x vLLM Speedup): SealKV (arXiv:2612.02036, Princeton & Amazon Annapurna Labs) brings calibration-free trellis-coded quantization (CPTC) to growing LLM KV caches via sealed blocks, Hadamard rotations, and block-mean subtraction. It delivers up to 6.6x KV memory reduction (2.41 bits/value) and 2.81x–3.44x end-to-end vLLM throughput at 64K context. Designed as a zero-dependency, open-source TypeScript architecture under the MIT License with native Model Context Protocol (MCP) support and deterministic phase state machines.
- 3.44x End-to-End vLLM Throughput: At 64K context, SealKV serves Qwen3-8B 2.81x–3.44x faster than BF16 by expanding maximum concurrent batch size.
- 4.7x–6.6x Calibration-Free Compression: K4V2 (3.41 bits/value) cuts KV VRAM by 4.7x within 0.7 points of BF16; K2V2 (2.41 bits/value) cuts memory by 6.6x.
- Preserves Coding & Agent Accuracy: On Qwen3-Coder-30B-A3B SWE-bench Verified, K4V2 scores 23.4% vs 23.2% BF16 (outperforming NVFP4 at 18.6% and SAW at 21.8%).
- 2.5x–2.9x Faster Decode Kernels: Fused attention kernels read trellis codes directly without materializing full FP16 tensors, beating BF16 FlashAttention-3 from 16K to 1M.
import { createAgent } from '@smoke-monkey/harness';import { execFile } from 'node:child_process';import { promisify } from 'node:util';const execFileAsync = promisify(execFile);// High-concurrency coding agent client backed by SealKV-compressed 64K vLLM endpointconst agent = createAgent({agentId: 'sealkv-high-batch-coder',provider: 'ollama',model: 'qwen3-coder:30b-a3b',workspacePath: process.cwd(),permissions: {read_file: 'allow',write_file: 'allow',run_command: 'ask',},});async function checkKvBudget(contextTokens: number, batchSize: number, bitsPerValue = 3.41) {// Qwen3-8B / Coder KV bytes comparison: BF16 (16 bits) vs K4V2 (3.41 bits)const ratio = 16.0 / bitsPerValue;const { stdout } = await execFileAsync('python3', ['-c','print(f"Batch=' + batchSize + ', Context=' + contextTokens + ', KV Compression Ratio=' + ratio.toFixed(2) + 'x")',]);return stdout.trim();}async function main() {const budget = await checkKvBudget(65536, 24, 3.41);const res = await agent.run(`Verify agent concurrency budget under SealKV K4V2 (${budget}) for multi-turn SWE-bench tool traces.`);console.log(res.summary);}main().catch(console.error);
Watch: Related Video Guides
How KV Cache Speeds Up LLMs for Faster AI Models on GPUs
The KV Cache: Memory Usage in Transformers
How SealKV Applies Trellis-Coded Quantization to Streaming KV Caches
SealKV (co-authored by Lijie Yang, Tri Dao, Ravi Netravali, Rajarshi Saha, and Muhammed Fatih Balın) solves the KV-cache memory bottleneck by sealing completed token blocks once all tokens in a block arrive, removing shared per-channel offsets via Block Mean Subtraction (BMS), applying a Randomized Hadamard Transform (RHT), and encoding residuals with a fast Viterbi CPTC trellis codec (L = 10).
Prior low-bit KV methods either required slow offline calibration (OSCAR), lost long-context accuracy (TurboQuant K3V3 dropping to 10.9% on 64K RULER), or lacked fast fused decode kernels. SealKV keeps the first 128 attention-sink tokens and the active sliding window in exact BF16, while fused decode kernels read quantized bitshift codes directly in shared memory—running 2.5x–2.9x faster than BF16 FlashAttention-3 from 16K to 1M tokens.
| Method | Bits / Value | SWE-bench Verified (Qwen3-Coder-30B-A3B) | τ²-bench Retail | 64K RULER Mean (Qwen3-8B) | Peak 64K Serving Speedup |
|---|---|---|---|---|---|
| BF16 Baseline | 16.00 | 23.2% ± 1.9 | 35.4% ± 0.9 | 86.5% | 1.00x |
| SAW-INT4 | 4.25 | 21.8% ± 1.8 | 35.2% ± 3.8 | 84.3% (-2.2) | ≤1.38x |
| NVFP4 | 4.50 | 18.6% ± 1.7 | 33.1% ± 3.8 | — | — |
| TurboQuant K3V3 | ~3.00 | — | — | 10.9% | 0.24x |
| SealKV K2V2 | 2.41 (6.6x) | 22.4% ± 1.6 | 35.1% ± 2.6 | 85.6% (-0.9) | 2.81x–3.44x |
| SealKV K4V2 | 3.41 (4.7x) | 23.4% ± 1.7 | 36.4% ± 2.9 | 85.5% (-1.0) | 2.81x–3.44x |
| SealKV K4V4 | 4.41 (3.6x) | 22.6% ± 1.9 | 35.5% ± 3.4 | 85.9% (-0.6) | 2.81x–3.44x |
Why Block Mean Subtraction and Sink Protection Enable 2.41-Bit Accuracy
The authors uncover two structural properties of transformer KV caches that explain why naive 2-bit quantization collapses:
- Sink Error Concentration: The first 4 prefix tokens occupy only 0.4% of a 1K cache yet account for 37% of reconstruction error (rising to 42% for 128 prefix tokens). Keeping the prefix sink in BF16 eliminates catastrophic attention drift.
- Shared Channel Offsets: Neighboring tokens share strong per-channel means
mu_d. By waiting until a block ofBtokens is full and subtractingmu_dbefore Hadamard mixing, SealKV isolates zero-mean Gaussian-like residuals ideal for CPTC trellis quantization. - Asymmetric K4V2 Sweet Spot: Keys tolerate less quantization noise than values in softmax dot products. Allocating 4 bits to keys and 2 bits to values (K4V2, 3.41 bits/value including scales and means) matches or exceeds full BF16 on SWE-bench Verified and τ²-bench Retail.
Prefill Overhead vs Long-Generation Payoff
On H200 GPUs, SealKV prefill TTFT is 1.24x–1.27x BF16, turning into 1.01x–1.11x higher end-to-end throughput at 1K generated tokens and 1.98x–2.53x at 16K generated tokens.
Evaluating SealKV K4V2 and K2V2 Configurations in Serving Stacks
When deploying long-context coding or reasoning agents on Qwen3 or GPT-OSS-120B backbones, configure prefix-sink protection alongside block-sealed quantization to prevent silent accuracy loss on 64K multi-turn traces.
# Benchmark Qwen3-8B or Qwen3-Coder-30B-A3B KV capacity on H100/H200
# Target K4V2 (3.41 bits/value) for lossless SWE-bench and 64K RULER parity
python3 -c '
ctx, layers, kv_heads, head_dim = 65536, 36, 8, 128
bf16_gb = (2 * ctx * layers * kv_heads * head_dim * 2) / (1024**3)
k4v2_gb = bf16_gb * (3.41 / 16.0)
k2v2_gb = bf16_gb * (2.41 / 16.0)
print(f"64K Per-Request KV -> BF16: {bf16_gb:.2f} GB | K4V2: {k4v2_gb:.2f} GB | K2V2: {k2v2_gb:.2f} GB")
'Frequently Asked Questions
Q:What do K4V2 and K2V2 mean in SealKV?
K4V2 allocates 4-bit trellis payloads to Keys and 2-bit payloads to Values (3.41 effective bits/value including metadata, a 4.7x reduction), while K2V2 allocates 2 bits to both (2.41 effective bits/value, a 6.6x reduction).
Q:Does SealKV require an offline calibration dataset like OSCAR?
No. SealKV is completely calibration-free and computes per-block channel means and residual scales online as each cache block is sealed.
Q:Why did TurboQuant K3V3 score only 10.9% on 64K RULER in the paper’s table?
When all transformer layers are quantized uniformly without sink protection or sealed block-mean removal, attention-sink errors corrupt long-range retrieval. SealKV preserves 85.5%–85.9% on 64K RULER (vs 86.5% BF16).
Q:At what batch size does SealKV’s decode kernel beat FlashAttention-3?
At 32K context on Qwen3-8B, SealKV K4V4 runs at 0.68x FA3 at batch 1 due to codebook lookup overhead, then accelerates to 2.1x–2.3x at batch 32 (4K) and 2.6x–2.7x at batch 64 (32K).
Related Alternatives & Comparisons
Related Architecture Guides
View all guidesBest Open Source Coding Agents in 2026: Free, Local & Fully Hackable Harnesses
MCP Server Security Best Practices: Hardening Model Context Protocol Agents in 2026
Open Source Coding Agent Harness: Build a Forkable, Local AI Engineering Runtime
Build with Smoke Monkey Harness
Zero dependencies. 24 built-in tools. Human-in-the-loop safety. 100% open source under the MIT License.