LLM·

KV-COBRA splits the KV-cache budget per head — Rank vs bit-width allocation — What does it mean?

The news. On September 21, 2026, researchers at POSTECH posted KV-COBRA (Co-Optimized Bit-Rank Allocation) to arXiv. The paper argues that at extreme compression rates the limit is not the compression scheme but how its budget is allocated across attention heads. It keeps the standard low-rank-plus-quantize kernel and adds a two-level allocator, tested on LLaMA-3.1-8B, Mistral-7B-v0.3 and Qwen2.5-7B-Instruct from 0.5 to 4 bits per dimension. Read the paper →

Picture one phone whose storage is shared by several photo albums. For each album you make two choices: how many photos to keep, and how sharp to save each one. A holiday album with three great moments should keep those three at full resolution. A stock-inventory album where every shelf matters should keep all of its photos, even if each one is a bit blurry. Give both albums the same rule — say, 32 photos at medium resolution — and the first wastes space on blurry filler while the second loses most of its shelves. The storage total is fixed; the only question is how it is split.

In a transformer, each album is one attention head and the photos are the directions of its key vectors. A head is concentrated when a handful of directions carry almost all of its variance, and diffuse when variance spreads over many. The paper measures how different heads really are: in LLaMA-3.1-8B at a uniform 2 bpd, the per-head error spans 100× across its 256 KV heads. One shared setting cannot be right for both ends of that range, yet current rotate-and-quantize compressors give every head the same bit width, and none choose rank and bits together.

KV-COBRA splits the decision into two levels. Inside one head (step C1), it trades two kinds of loss against each other: dropping a direction loses that direction's variance outright, while quantizing the kept directions adds rounding noise that falls about 4× per extra bit. C1 picks the rank and bit width where two more directions would buy back exactly as much as they cost in thinner bits. Across heads (step C2), it moves budget until every head sits at the same marginal error — the classic water-filling rule from information theory: a bit goes wherever it removes the most error. The paper reports C2 converges within five rounds, and at 2 bpd the chosen settings range from roughly rank 16 to 100 and 2 to 5 bits across heads.

Two supporting pieces make this work with a plain kernel. A Hadamard rotation, fused into the same projection matrix at no extra latency, flattens the steeply uneven variances of the kept directions so one uniform b-bit quantizer fits all of them — the same outlier-spreading trick other low-bit caches use. And instead of ranking directions by variance alone, the KL variant reorders them by how much the attention output depends on them, so a low-variance direction the query attends to strongly is kept rather than cut. Everything is decided once at calibration; at inference each key is projected, rotated and quantized with frozen per-head settings, so there is no per-token overhead.

Where the bits actually go

Hold three things fixed (illustrative numbers, not from the paper): a head dimension of 128, a budget of 1 bpd, and two heads — so each head gets 128 bits per token and the pair gets 256. Head A is concentrated: its top 16 directions hold 99% of its variance. Head B is diffuse: its variance is spread evenly over all 128 directions. Uniform setting, rank 32 at 4 bits for both (32 × 4 = 128 bits each): head A loses about 1%, but head B keeps only 32 of its 128 directions and throws away 75% of its variance before any rounding happens. Per-head setting: head A needs only rank 16 at 4 bits (64 bits) to keep the same 99%. The 64 bits it frees move to head B, which now has 192 bits and can take rank 96 at 2 bits. Head B's lost variance drops from 75% to 25%, at the price of the extra rounding noise that 2-bit storage adds — the trade C1 checks explicitly. Same 256 bits, same kernel; only the split changed.

MethodBasis the cache is stored inRank per headBits per head
KIVI, KVQuant, GEARoriginal channelsno rank reductionfixed hyperparameter (paper, Table 1)
TurboQuantrandom rotationno rank reductionfixed hyperparameter (paper, Table 1)
SVDqper-layer SVDfixed hyperparameterfixed hyperparameter (paper, Table 1)
KQ-SVDquery-aware SVDadaptive, set by an error thresholdfixed per head, optimized per layer (paper, Table 1)
KV-COBRAper-head SVD + Hadamardoptimized per headoptimized per head and per layer (paper, Table 1)

The gains are concentrated at the low end. The paper states that at 2 bpd and above the choice of allocator barely matters; below that, KV-COBRA degrades most gracefully, and at 1 bpd its KL variant nearly doubles the F1 score of the integer-only baselines on LongBench, a long-document question-answering benchmark. The scope has limits worth stating: the main results compress keys only, taken before rotary position encoding, because the value spectrum is flatter and gains little from redistribution (the paper's joint key-plus-value sweep is in its Tables 4 and 5); the allocation is calibrated once on Wikitext-2 samples; and the paper reports kernel-level attention speed, not end-to-end serving latency. It also composes with, rather than replaces, token eviction and grouped-query attention, which shrink the cache along other axes.

Goes deeper in: LLM Internals → Quantization → Modern Methods

Related explainers

Continue in trackQuantization: Modern Methods

Frequently Asked Questions

Check what you knowMap your AI & GPU knowledge across every track — free, role-based