Stanford Research Open-Sources Memorilla, a Latent Memory Module for Frozen LLMs
In one sentence
Stanford researchers open-sourced Memorilla, a 194M-parameter latent memory module that compresses entire document collections into 16 memory tokens for frozen LLMs.
Key points
- Memorilla trains only 194M parameters while keeping the Qwen3-Embedding-4B encoder and Qwen3-8B decoder frozen.
- It achieved the highest average score of 49.68 across 8 benchmarks and outperformed full-context prompting on FactKG with 108x fewer tokens.
- On a single H100 GPU with 512 documents, it answers in 0.74 seconds, making it 27x faster than full-context inference.
- The team released the code, training recipes, and checkpoints on GitHub and Hugging Face under the Apache 2.0 license.
In depth
An AI-written overview of the original article, not the article itself.
Stanford researchers have open-sourced Memorilla, a 194-million-parameter latent memory module for frozen large language models. By compressing entire document collections into just 16 memory tokens, it enables models to outperform full-context prompting while using a fraction of the tokens.
How Memorilla Works
Developed by Jure Leskovec's SNAP group alongside co-authors from Toronto, Penn, and MIT, Memorilla pairs a frozen Qwen3-Embedding-4B encoder with a frozen Qwen3-8B decoder.
Its three-step pipeline encodes each document once, uses two cross-attention layers to let 16 learned slots attend to the question and document store, and projects those slots into the decoder's input space.
Training runs in three stages, covering Wikipedia reconstruction, QA and summarization datasets, and benchmark fine-tuning, taking about 19 hours on four H100 GPUs.
Benchmark Performance and Speed
According to the research team, Memorilla achieved an average score of 49.68 across eight benchmarks, outperforming xRAG, LLMLingua-2, and Mem0. On FactKG, it reached 84.33% accuracy compared to 80.43% for full context, using 108 times fewer document tokens.
However, it trailed on three benchmarks, including PubMedQA, where short 324-token abstracts left little room for compression. On speed, Memorilla answered 512-document queries in 0.74 seconds on one H100 GPU, making it 27 times faster than full-context prompting.
Open-Source Release
The code, training recipes, and checkpoints are available under the Apache 2.0 license, requiring Linux, Python 3.11, and an 80 GB CUDA GPU. The team also released the PersonalizationV4 dataset under CC BY 4.0.
This summary was generated by AI from the original article and may contain errors; the original is authoritative. Copyright belongs to the original author.