Real Long-Term Memory for AI: A 50-Million-Token Window That Is Faster and Cheaper Than Recompute
Researchers store encrypted KV cache on NVMe so Gemma 4 recalls facts across 50 million tokens without recompute.
The paper evaluates galahad-kv, which writes each roughly 16,000-token block's key-value state to encrypted local NVMe and reloads it byte-exact instead of recomputing. Tests used vLLM on one NVIDIA H100 with Gemma 4 12B and Gemma 4 31B over 50 million tokens of public text. All 100 probed blocks reloaded without recompute; loads were 2.8x to 4.3x faster and used 8.8x to 12.3x less GPU energy, while GPU memory stayed flat. Planted-fact recall was 82 of 100 for the 12B model and 98 of 100 for the 31B model, with no fabricated answers. Only one stored block is loaded at a time, and the store requires terabytes of disk.
- galahad-kv saves encrypted KV blocks of about 16,000 tokens to local NVMe.
- Tested on Gemma 4 12B and 31B via vLLM on a single H100.
- Block reload was 2.8–4.3x faster and used far less GPU energy than recompute.
- Fact recall at multi-million-token depth was 82% (12B) and 98% (31B).
- This reuses stored state one block at a time, not a wider attention window.
- Products
- galahad-kvvLLMNVIDIA H100
- AI models
- Gemma 4 12BGemma 4 31B
From the original article
1 min read at huggingface.coA large language model can only use the text that fits in its context window, and it recomputes its internal key-value (KV) state for a prompt every time the prompt is sent. We test a memory layer, the public package galahad-kv, that saves the KV state of each block of about 16,000 tokens to encrypted local NVMe disk and loads it back later, byte-exact, without recomputing it.
By Sietse Schelpe · huggingface.co
A short excerpt; the article and its images belong to the publisher. Summary, key facts and assessment above are AI-written from the article and can be wrong.