JoLT: Near-Lossless KV Cache Compression

Joint Lagrangian allocation of Tucker ranks and a rotated low-bit residual

MSc thesis: Low-Rank Tensor Decomposition for Key-Value Cache Compression in Large Language Models

Supervisor: Prof. Dr. Volker Schulz
M.Sc. Data Science thesis, Universitaet Trier, 2026

At 3x KV cache compression, GSM8K on Mistral-7B moves -1.21 pp and RULER 64K on LLaMA-3.1-8B moves -0.10 pp, with perplexity within 0.3% of dense across all five models tested; even at 5x, RULER 64K costs only -2.40 pp.

Abstract

The key-value cache dominates inference memory in long-context large language models. Existing compression methods can combine low-rank compression and quantization, but they typically choose ranks and precisions independently or heuristically, so none allocates ranks and bit-widths jointly under one storage budget. We propose JoLT (Joint Lagrangian Tucker), which applies a partial Tucker decomposition to the token and feature axes of a fourth-order layer-group cache tensor, keeps the head and layer axes intact, and restores truncation energy with a rotated low-bit residual. A single Lagrangian dual allocates ranks and residual bit-widths jointly under a shared byte budget. JoLT and its production variant FlashJoLT are near-lossless through 3x compression of the KV cache from short context to 64K; on a RULER subset at 64K with LLaMA-3.1-8B, 4x costs under a point (-0.90 pp) and 5x stays within 2.40 pp. This near-lossless band holds across models and architecture families. For FlashJoLT we present a fused decode kernel that cuts peak decode memory of the KV cache by a measured 3.61x against the dense bf16 cache at context length 8192. Together, these results show that substantial KV-cache compression is possible without retraining while jointly exploiting low-rank and low-bit structure.

Near-lossless: downstream accuracy stays within a prespecified 2 pp noninferiority margin against the dense KV cache on a paired test; perplexity changes are reported separately.

How JoLT works

Prefill KV cache keys and values of all layers, kept in bf16 during prefill Layer groups g, cells (g, K) and (g, V) each cell a 4th-order tensor |g| × n_h × T × d_h Joint Lagrangian allocation one multiplier λ picks (r_T, r_d, b) per cell to minimise Σ e = ε²(b) · τ(r_T, r_d) under one byte budget B ranks r_T, r_d bits b Partial Tucker (ST-HOSVD) heads and layers pinned; tokens to r_T, features to r_d; core + U_T + U_d Rotated low-bit residual R = X − X̃, random orthogonal rotation, uniform b-bit code, b ∈ {0, 2, 4, 8} Compressed cache core, two factor matrices, packed residual with one fp32 scale per row FlashJoLT fused decode attention directly on the compressed cache; inverts the rotation on the fly

JoLT groups the layers, treats the keys and the values of each group as separate cells, and lets one Lagrangian multiplier pick every cell's Tucker ranks and residual bit-width under a shared byte budget before anything is compressed. The partial Tucker step keeps heads and layers intact and truncates only tokens and features, the rotated low-bit residual recovers the truncated tail, and FlashJoLT attends directly on the stored core, factors and residual.

Key findings

  • Tucker beats CP, TT and t-SVD for runtime KV caches, but any 4D format that compresses the head or layer axis loses to per-head SVD: those axes are index-like and incompressible.
  • V is 2-3x harder to compress than K across architectures (median cellwise V/K error ratio 2.47).
  • Decomposing K after RoPE costs 22-70% extra reconstruction error, so JoLT operates pre-RoPE.
  • On GSM8K with Mistral-7B, 2x compression costs -0.45 pp and 3x costs -1.21 pp, while WikiText2+C4 perplexity at 3x stays within 0.3% of the dense cache on all five tested models.
  • At 64K context on the RULER subset with LLaMA-3.1-8B, 3x compression costs -0.10 pp (90.87 vs. 90.97 baseline); on the official RULER subset at 16K/32K with Mistral-7B, 3x costs -0.225 pp pooled (95% CI [-0.9, +0.5] pp).
  • FlashJoLT fused decode kernel: 3.61x lower peak decode KV memory vs dense fp16 at context 8192.

BibTeX

@article{krishnan2026jolt,
  author  = {Krishnan, Rahul and Schulz, Volker},
  title   = {A {JoLT} for the {KV} {C}ache: {N}ear-{L}ossless {KV} {C}ache {C}ompression via {J}oint {L}agrangian {A}llocation of {T}ucker {R}anks and a {R}otated {R}esidual for {LLM}s},
  journal = {arXiv preprint arXiv:2607.12550},
  year    = {2026}
}