LowRAM
Why spend memory on what you can predict?
LowRAM compresses the KV cache used by long-context LLMs. It reconstructs values from their keys, keeps corrections for the hardest-to-predict values, and compresses keys across layers.
Base-model weights stay frozen. Lightweight predictors adapt to each prompt.
Compression: Mistral-7B, LongBench prompts longer than 10K tokens. Throughput: Llama-3.1-8B, comparing peak decode throughput across batch sizes. These are separate experimental settings.
Get started Explore the 128K demoHugging FaceRead the paper
LowRAM: Low-Rank Keys and Amortised Values for Composable KV Cache Compression at Test-Time
1Can a smaller cache keep the details?
Three access codes are hidden in a 128K-token document. Compare recorded uncompressed and LowRAM runs to see which details they recover, how much KV-cache memory they use, and how inference performance changes.
Loading…
Waiting for the recorded result.
Waiting for the recorded result.
| Measured metric | Baseline | LowRAM |
|---|
Show a smaller-batch baseline for reference
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
Explore the tradeoffs between cache size, retained benchmark score and decode throughput. Select a point to inspect its result and settings.
4Try it yourself
Start with a small retrieval example, then measure the tradeoffs on your own workload.
Requirements: Python 3.12, a CUDA GPU, Git LFS and access to the selected model. The supplied demo supports Llama and Mistral. The default Llama model requires approved Hugging Face access.
Run the demo
Start with a 4K-token document and a 4× cache-compression target. Use the fast preset, then compare its answer with the uncompressed baseline.
git clone https://github.com/lowram-model/lowram cd lowram git lfs install git lfs pull conda create -n lowram python=3.12 -y conda activate lowram pip install -r requirements.txt
If needed, create or edit .env in the repository root and add HF_TOKEN="<your_huggingface_token>". Keep any existing settings and never commit this file.
# Fast LowRAM preset python -m examples.lowram_demo --method fast # Uncompressed baseline python -m examples.lowram_demo --method baseline
The demo prints the question, reference codes, generated answer and fact-recall score. The fast preset uses meta-initialised value prediction, two fitting steps and selective reconstruction. Use --method lowram for the full-adaptation preset with more fitting steps.
Reproduce the larger benchmark
This runs the larger comparison and requires substantially more GPU memory than the introductory demo. Commands run from the repository root.
python -m benchmarks.compare \ --methods baseline fast lowram \ --meta-weights checkpoints/meta_init/Llama-3.1-8B-Instruct/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
The two scripts currently initialise the full-adaptation lowram preset differently: the small demo loads value-MLP warm-start weights, while this comparison script does not pass those weights. Treat their outputs as separate configurations, not identical reruns.
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.
Cite LowRAM
Using LowRAM in your research? Please cite our paper.
@article{lowram2026,
title = {{LowRAM}: Low-Rank Keys and Amortised Values for
Composable {KV} Cache Compression at Test-Time},
author = {Delgado, Teresa and Hazard, Hugo and
Benfeghoul, Martin and Wang, Jun and
Fountas, Zafeirios},
journal = {arXiv preprint arXiv:2611.07025},
year = {2026},
doi = {10.48550/arXiv.2611.07025},
url = {https://arxiv.org/abs/2611.07025}
}