LowRAM
Low-rank keys and amortised values for composable KV cache compression at test time
Why store what you can predict? LowRAM reconstructs values from keys and keeps only what it can't predict.
| 4× | value-cache compression, keeping 99.3% of the uncompressed LongBench score | Llama-3.1-8B, values only Table 5 |
|---|---|---|
| 26.9× | combined with eviction and quantisation, 94.5% recovered score on long contexts | Mistral-7B, LongBench >10K Table 11 |
| 2 | adaptation steps with meta-initialisation: faster prefill, with an accuracy tradeoff | Meta-initialised LowRAM Table 2 |
1Can it keep the details?
Three facts are tucked inside a 64K-token document, and the model is asked for all three. Pick a LowRAM configuration and a batch size to compare the recorded answers, and the memory they take, with the uncompressed model.
Loading…
Waiting for the recorded result.
Waiting for the recorded result.
| Measured metric | Baseline | LowRAM |
|---|
2Store the pattern, keep the exceptions
Keys and values come from the same hidden states. LowRAM uses that relationship to store less, in four steps. Select a step to see it.
3Results
Quality, speed and capacity tell different parts of the story, so they are shown separately. Hover over or focus a point to read its value.
4Try it yourself
Run the readable example, measure the tradeoffs, and inspect the recorded measurements. Commands run from the repository root.
# Activate the environment and install required packages # Generate an answer with a compressed cache python -m examples.lowram_demo # Compare memory, throughput, latency and accuracy python -m benchmarks.compare \ --methods baseline fast lowram \ --meta-weights /path/to/meta_mlps.pt \ --contexts 131072 --batch-sizes 1 2 4 6 8 12 \ --ratios 4 --samples 24 --repeats 2 --warmup 1 \ --decode-tokens 48 \ --output results/demo/comparison.json
References
- Chang et al. xKV: Cross-Layer SVD for KV-Cache Compression. arXiv:2503.18893, 2025.
- Sun et al. ShadowKV: KV Cache in Shadows for High-Throughput Long-Context LLM Inference. ICML 2025.