Rust in Everything
← Papers

LowRAM: Low-Rank Keys and Amortised Values for Composable KV Cache Compression at Test-Time

Teresa Delgado, Hugo Hazard, Martin Benfeghoul, Jun Wang, Zafeirios Fountas

2026-11-09▲ 10arXiv 2611.07025v1Hugging FaceCode

AI-generated from the full paper (deepseek-flash). It may contain mistakes; check the original.

TL;DR

LowRAM is an asymmetric KV cache compression pipeline that predicts values from keys with per-head test-time predictors and residuals while compressing keys with cross-layer low-rank decomposition, reaching near-lossless moderate compression and 26.9× compression at 94.5% of baseline on long contexts.

Problem

Autoregressive decoding relies on a KV cache that grows linearly with context length and caps batch size and throughput. Existing post-training compression methods exploit redundancy across tokens, layers, feature dimensions, or numerical precision, but leave the redundancy between keys and values largely unexplored. Keys and values share an origin but serve different functions, motivating an asymmetric treatment.

Method

LowRAM treats keys and values as structurally distinct objects: keys use xKV cross-layer low-rank compression, while values are reconstructed from keys by a lightweight per-head predictor fitted at test time. The predictor is a two-layer MLP with a learned linear residual branch, fit during prefill by MSE reconstruction from pre-RoPE keys. Tokens are ranked by reconstruction error, and residuals are stored only for the top p fraction, so decoding reconstructs values as fθ(K) plus gated residuals. RoPE is inverted before compression and reapplied at attention time; generated key-values are stored exactly during decoding. Meta-learning can initialise the predictor for fast prefill, and selective reconstruction rebuilds only a query-dependent subset of KV pairs at each decode step.

Results

  • At 3× compression Mistral-7B and Llama-3.1-8B retain 97.9–99.4% of baseline; at 4× recovery is 96.0–99.6% except Llama-3.1-8B on RULER at 93.9%. §4.2
  • Meta-learning the MLP initialisation reduces per-context adaptation to 2 gradient updates and lowers TTFT overhead to 1.3× baseline, down from 26.3× with 150 updates and 55.5× with 300. §4.3
  • At 4× compression LowRAM-SR supports a batch size of 28 at all three context lengths and at 262K tokens reaches roughly 5× the peak throughput of the baseline. §4.3
  • Adding quantisation to the 4× LowRAM cache raises Mistral LongBench compression to 6.4× and recovery from 97.9% to 99.4%; for Llama RULER, LowRAM-Q reaches 99.4% versus 93.9% for LowRAM. §4.4
  • The full LowRAM-EQ stack achieves 26.9× compression while recovering 94.5% of baseline performance on LongBench contexts longer than 10K tokens. §4.4
  • Value-cache amortisation in isolation retains 98.2% of RULER and 99.3% of LongBench performance at 4× compression on Llama-3.1-8B. §4.5

Limitations

  • Long generations are not evaluated; the paper states this would require periodically compressing the suffix of newly generated tokens, e.g. every N tokens, rather than relying on a single prefill-time fit. Stated in §6.
  • The paper states it is unclear how much of the learned parametrisation persists across contexts and whether hard-to-predict tokens are stable across contexts. Stated in §6.
  • The predictor's parameters are a fixed cost amortised only after a few thousand tokens, so LowRAM degrades more on 4K RULER and combines less cleanly with eviction. Stated in §5 and §4.4.
  • Meta-initialisation cuts TTFT but costs 1.4–4.4 points on RULER and 2.4 on LongBench relative to 300-update adaptation. Stated in §4.3.

Key points

  • LowRAM uses xKV for keys: groups of adjacent layers are flattened and factorised as M≈AB at a rank chosen for a target ratio; RoPE is inverted before compression and reapplied at attention time. §3
  • The source-target analysis at fixed 3× compression finds K_L→V_L gives the highest recovered LongBench performance among evaluated configurations; reconstruction error correlates only weakly with downstream performance. §3.1
  • Values are modelled per layer and KV head by a two-layer MLP with ReLU and a learned linear residual branch, fitted during prefill by MSE reconstruction. §3.2
  • Only the top p fraction of tokens by reconstruction error store residuals, and decoding reconstructs V_tilde=fθ(K)+G⊙ΔV; total memory has a sequence-independent parameter term and a sequence-dependent residual term. §3.2
  • Meta-learning uses FOMAML with K=2 inner updates, Adam inner optimiser at 10^-3, AdamW outer at 3×10^-4, and gradient accumulation over 8 sequences. §E
  • Selective reconstruction follows ShadowKV landmark guidance and reconstructs only a query-dependent subset of tokens at each decode step instead of the full cache. §F
  • LowRAM-EQ combines LowRAM with eviction and quantisation; at maximum evaluated compression retaining at least 90% on Mistral LongBench >10K, it reaches 26.9× and 94.5%. §4.4
  • In isolation on Llama-3.1-8B, value-cache amortisation retains 98.2% of RULER and 99.3% of LongBench at 4×; xKV on values is slightly ahead on RULER at higher ratios but amortisation is consistently stronger on LongBench. §4.5

Mind map

LowRAM
Problem
KV cache grows with context
Memory caps batch and throughput
Keys and values treated alike
Method
Asymmetric compression
Keys use cross-layer low-rank xKV
Values predicted from keys
Residuals for worst tokens
RoPE inverted before compression
Adaptation
Per-head MLP fitted at test time
Meta-learned init for fast prefill
Selective reconstruction at decode
Results
Near lossless at 3x and 4x
4x value compression near lossless
5x peak decode throughput at 4x
26.9x at 94.5 percent baseline
Composition
Stacks with quantisation
Stacks with eviction
Quantisation raises compression and recovery
Limitations
Long generations not evaluated
Context persistence unclear
Fixed cost hurts short contexts

Related papers

💬 Related discussions

Loading...