We show that the key-value (KV) cache in transformer attention heads admits a natural decomposition into a low-rank shared context component and a full-rank per-token residual, well described by the spiked random matrix model. This observation leads to eOptShrinkQ, a two-stage compression pipeline: optimal singular value shrinkage (eOptShrink) automatically extracts the shared structure, and the residual -- which satisfies the thin shell property with delocalized coordinates -- is quantized by TurboQuant~\citep{zandieh2025turboquant}, a recently proposed per-vector scalar quantizer with near-optimal distortion guarantees. By restoring the isotropy that scalar quantization assumes, spectral denoising eliminates the need for both outlier handling and dedicated inner product bias correction, freeing those bits for improved reconstruction. The theoretical grounding in random matrix theory provides three guarantees: automatic rank selection via the BBP phase transition, provably near-zero inner product bias on the residual, and coordinate delocalization ensuring near-optimal quantization distortion. Experimentally, we validate eOptShrinkQ on Llama-3.1-8B and Ministral-8B across three levels: per-head MSE and inner product fidelity, where eOptShrinkQ saves nearly one bit per entry over TurboQuant at equivalent quality; end-to-end on LongBench (16 tasks), where eOptShrinkQ at ∼2.2 bits per entry outperforms TurboQuant at 3.0 bits; and multi-needle retrieval, where eOptShrinkQ at 2.2 bits closely matches or exceeds uncompressed FP16, suggesting that spectral denoising can act as a beneficial regularizer for retrieval-intensive tasks.
Figures & tables
λ^+=λ~k+12+22/3−11(λ~k+12−λ~2k+12).
Algorithm 2 eOptShrink (adapted from ( Su and Wu, 2025 ) )
Figure 1: Llama-3.1-8B key head L15H3 ( 128×128 ). Top: Singular value spectrum (left) and distribution (right); outlier singular values clearly separate above the bulk edge λ+ . Bottom: The original block S exhibits vertical stripes from per-channel outliers—the anisotropy that KIVI’s per-channel quantization is designed to handle. The rank- r^+ signal S^ captures these stripes; the residual R=S−S^ is visually isotropic with no discernible structure.
Figure 2: Llama-3.1-8B value head L31H0 ( 128×128 ). Same format as Figure 1 . The spiked structure is present for values as well. The residual R is again structure-free.
Figure 3: Ministral-8B key head L5H3 ( 128×128 ). Same format as Figure 1 . The spiked structure and its removal by eOptShrink are consistent across model families.
Figure 4: Ministral-8B value head L18H1 ( 128×128 ). Same format as Figure 2 . The spiked structure and isotropic residual are consistent across model families.
b=2
b=3
b=4
Method
rˉ
Bits
L2 %
IP
Bits
L2 %
IP
Bits
L2 %
IP
KIVI
—
2.50
24.8
−.016±
.022
3.50
10.5
−.003±
.010
4.50
5.0
−.001±
.004
TQ MSE
—
2.00
34.1
−.028±
.027
3.00
18.5
−.008±
.014
4.00
9.7
−.002±
.007
TQ prod
—
3.00
34.1
−.001±
.036
4.00
18.5
.000±
.020
5.00
9.7
.000±
.010
SVD r=1 +TQ
1.0
2.06
21.3
+.009±
.017
3.06
11.5
+.003±
.010
4.06
6.0
+.001±
.005
eOptShrinkQ MSE
5.6
2.35
17.7
+.006±
.014
3.35
9.6
+.002±
.008
4.35
5.0
.000±
.004
Table 1: Compression quality on Llama-3.1-8B-Instruct keys ( d=128 , blocks of 128×128 , averaged over 256 heads). SVD factors quantized at 4 bits. rˉ : mean eOptShrink rank. IP reported as bias ± std on unit-normalized vectors.
b=2
b=3
b=4
Method
rˉ
Bits
L2 %
IP
Bits
L2 %
IP
Bits
L2 %
IP
KIVI
—
2.50
49.5
−.012±
.041
3.50
21.2
−.003±
.018
4.50
9.9
−.001±
.008
TQ MSE
—
2.00
34.1
−.007±
.031
3.00
18.4
−.002±
.016
4.00
9.7
−.001±
.008
TQ prod
—
3.00
34.1
.000±
.037
4.00
18.4
.000±
.020
5.00
9.7
.000±
.010
SVD r=1 +TQ
1.0
2.06
30.6
+.004±
.028
3.06
16.5
+.001±
.015
4.06
8.7
.000±
.008
eOptShrinkQ MSE
5.0
2.31
26.6
+.003±
.024
3.31
14.4
+.001±
.013
4.31
7.5
.000±
.007
Table 2: Compression quality on Llama-3.1-8B-Instruct values ( d=128 , blocks of 128×128 , averaged over 256 heads). Format as in Table 1 .
b=2
b=3
b=4
Method
rˉ
Bits
L2 %
IP
Bits
L2 %
IP
Bits
L2 %
IP
KIVI
—
2.50
25.2
−.016±
.023
3.50
10.7
−.003±
.010
4.50
5.1
−.001±
.005
TQ MSE
—
2.00
34.2
−.029±
.027
3.00
18.5
−.008±
.014
4.00
9.7
−.002±
.007
TQ prod
—
3.00
34.2
−.002±
.036
4.00
18.5
−.001±
.020
5.00
9.7
.000±
.010
SVD r=1 +TQ
1.0
2.06
21.4
+.009±
.017
3.06
11.6
+.003±
.010
4.06
6.1
+.001±
.005
eOptShrinkQ MSE
5.5
2.34
18.1
+.005±
.014
3.34
9.8
+.002±
.008
4.34
5.1
.000±
.004
Table 3: Compression quality on Ministral-8B-Instruct keys ( d=128 , blocks of 128×128 , averaged over 288 heads). Format as in Table 1 .
b=2
b=3
b=4
Method
rˉ
Bits
L2 %
IP
Bits
L2 %
IP
Bits
L2 %
IP
KIVI
—
2.50
48.8
−.009±
.040
3.50
20.9
−.002±
.018
4.50
9.7
.000±
.008
TQ MSE
—
2.00
34.1
−.005±
.031
3.00
18.4
−.002±
.016
4.00
9.7
.000±
.008
TQ prod
—
3.00
34.1
.000±
.037
4.00
18.4
.000±
.020
5.00
9.7
.000±
.011
SVD r=1 +TQ
1.0
2.06
31.0
+.003±
.028
3.06
16.8
+.001±
.015
4.06
8.8
.000±
.008
eOptShrinkQ MSE
5.0
2.31
26.8
+.002±
.025
3.31
14.5
+.001±
.013
4.31
7.6
.000±
.007
Table 4: Compression quality on Ministral-8B-Instruct values ( d=128 , blocks of 128×128 , averaged over 288 heads). Format as in Table 1 .
Llama-3.1-8B-Instruct
Method
Bits
SingQA
MultQA
Summ
Few
Synth
Code
Avg
FP16
16
43.5
44.9
29.2
69.4
53.9
53.1
49.0
TQ MSE
2.00
41.0
37.9
27.1
67.8
46.4
49.2
44.9
TQ prod
3.00
41.9
38.6
27.6
67.5
47.2
48.5
45.2
SVD r=1 +TQ
2.04
41.5
39.4
26.3
66.9
49.4
52.2
46.0
eOptShrinkQ MSE
2.22
42.3
42.7
27.4
67.4
50.5
53.9
47.4
Table 5: LongBench scores by category and overall average (16 English tasks, residual bit-width b=2 ; total bits per entry shown in the Bits column). Both keys and values compressed at the same rate. Chunk-based evaluation with 128-token chunks and 128×128 blocks. SVD factors quantized at 4 bits. Best compressed method per category in bold .
Figure 5: Multi-needle retrieval heatmaps for Llama-3.1-8B ( N=2,4,6,8,10 needles, context 4K–104K). Each cell shows recall (fraction of needles retrieved). eOptShrinkQ MSE at 2.22 bits (avg 0.981) exceeds FP16 (0.972) on this benchmark, though the effect is task- and model-dependent (see Section 5 ). SVD r=1 shows scattered failures; TQ prod is worst despite using more bits.
Figure 6: Multi-needle retrieval heatmaps for Ministral-8B ( N=2,4,6,8,10 needles, context 4K–30K). eOptShrinkQ MSE at 2.22 bits (avg 0.992) nearly matches FP16 (1.000). Same pattern as Llama: eOptShrinkQ dominates, TQ prod is worst.
The key-value (KV) cache is the dominant memory bottleneck in long-context language model inference. Existing compression methods apply low-rank factorization or quantization independently, without jointly allocating rank and precision under a shared storage budget. We introduce JoLT, a training-free compressor that treats grouped prefill caches as fourth-order tensors and applies partial Tucker decomposition along the token and feature modes, the two axes that carry low-rank structure, while leaving the head and layer modes intact. A rotated low-bit quantizer captures the truncation residual, and a single Lagrangian dual allocates per-group Tucker ranks and residual bit-widths under a global byte constraint. FlashJoLT replaces the exact token-mode SVD with a randomized approximation that matches JoLT within the free zone at a fraction of the compression cost, and a fused Triton decode kernel evaluates attention directly over the stored factors without materializing dense KV tensors. Across five models from four architecture families, covering multi-head attention, grouped-query attention, and mixture-of-experts architecture, JoLT achieves 2 - 3x compression with less than 0.2% perplexity degradation, without retraining. On RULER at 64K context with LLaMA-3.1-8B, retrieval accuracy remains near-lossless through 3x and declines by only 0.90 and 2.40pp at 4x and 5x, respectively. JoLT demonstrates that tensor-aware low-rank decomposition and quantized residuals, unified under a single storage budget, achieve near-lossless KV-cache compression across diverse model architectures without retraining.
Rahul Krishnan, Volker Schulz
Universität Trier · Fachbereich IV, Mathematik, Universität Trier
What limits KV-cache compression at extreme bit-rates? We argue that it is not the choice of compression scheme, but how its budget is allocated across attention heads. Existing methods apply rank and bit-width uniformly, ignoring that each head has a different optimal mix of rank truncation and quantization. We show that co-optimizing rank and bit-width per head, using only standard low-rank projection and scalar quantization, dominates uniform allocation, with the largest gains at low bit-rates. Our method, KV-COBRA (Co-Optimized Bit-Rank Allocation), formalizes this as a resource-allocation problem: it balances rank-truncation loss against quantization loss within each head, then redistributes budget across heads to minimize total distortion. A fused Hadamard rotation equalizes per-channel variance, and reordering the SVD basis by attention-KL importance makes the solver query-aware. The same allocator extends to joint K+V compression. On perplexity, zero-shot, and long-context benchmarks from 0.5 to 4 bits per dimension (bpd), KV-COBRA shows the smallest accuracy degradation among evaluated methods at low bpd, with no per-token overhead.
Sihyeon Ha, Jaeho Lee, Yo-Seb Jeon
Pohang University of Science and Technology (POSTECH)
Recent work on KV cache quantization, culminating in TurboQuant, has approached the Shannon entropy limit for per-vector compression of transformer key-value caches. We observe that this limit applies to a strictly weaker problem than the one that actually matters: compressing the KV cache as a sequence. The tokens stored in a KV cache are not arbitrary floating-point data -- they are samples from the exact formal language the model was trained on, and the model is by construction a near-optimal predictor of that language. We introduce sequential KV compression, a two-layer architecture that exploits this structure. The first layer, probabilistic prefix deduplication, identifies semantically equivalent shared prefixes across sessions using the trie metric d_T(s, s') = -log_2 P_M(s ^ s') from Probabilistic Language Tries (PLTs). The second layer, predictive delta coding, stores only the residual of each new KV vector from the model's own prediction of it, achieving a per-token entropy bound of H(KV_{i+1} | KV_{<=i}) <= H(token_{i+1} | token_{<=i}). We prove that at typical language model perplexity -- approximately 10-20 for fluent English text -- this bound is 3.3-4.3 bits on average per token position, compared to TurboQuant's 3 bits per vector component (with typical attention heads having 64-128 components). The theoretical compression ratio over TurboQuant is approximately 914,000x at the Shannon limit. Even at 1000x above the entropy floor -- a deliberately pessimistic worst-case overhead, two orders of magnitude above the 2-5x typical of practical source coders -- the ratio remains approximately 914x over TurboQuant, with compression improving rather than degrading as context length grows. The two layers are orthogonal and compose with existing per-vector quantization methods including TurboQuant.