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.

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

Conventional KV cacheevery key and value
LowRAMreconstructed when needed
Figure 1. A conventional cache stores every key and value. LowRAM stores low-rank keys, a value predictor ƒθ fitted to the context, and sparse corrections for the values it predicts worst.

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 recorded run…

128K tokens per sequence · — · 4× compression target

GPU: loading recorded metadata…

The document
BeginningEnd
The question

Loading…

Uncompressed—

Waiting for the recorded result.

LowRAM—

Waiting for the recorded result.

Physical prefill cache—
Baseline
—
LowRAM
—
Performance comparison for the selected configuration
Measured metricBaselineLowRAM
Figure 2. Recorded model outputs, not live inference. Answer scores refer to the displayed three-code example; “Suite fact recall” summarises the recorded retrieval suite. Cache sizes are mean bytes per batch, including the stored predictor and cache metadata, and exclude model weights. Comparisons use the selected batch size on both sides.

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.

  1. 1
  2. 2

K ≈ A · B

Figure 3. Shared structure, smaller keys. A shared factor captures patterns across a group of layers. Each layer keeps its own smaller reconstruction factor.

3Results

Explore the tradeoffs between cache size, retained benchmark score and decode throughput. Select a point to inspect its result and settings.

Select a point to inspect its result.
Figure 4. How much performance is retained? Mistral-7B on LongBench contexts longer than 10K tokens (paper Table 11). Recovered score = method score / uncompressed score × 100.
Select a measured point to inspect its settings.
Figure 5. When does compression help throughput? Llama-3.1-8B, 262K tokens, 4× target. Five repeats, two warmups, 128 decode steps. Points marked OOM ran out of memory. Peak throughput is compared across batch sizes; it is not a 5× speedup for every request. The uncompressed baseline is faster at small batches in this sweep.

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.

Setup
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.

Run the demo
# 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.

Benchmark comparison
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

  1. Chang et al. xKV: Cross-Layer SVD for KV-Cache Compression. arXiv:2503.18893, 2025.
  2. 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.

BibTeX
@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}
}