NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Pre-computed memory or on-the-fly encoding? A hybrid approach to retrieval augmentation makes the most of your compute

Michiel de Jong, Yury Zemlyanskiy, Nicholas FitzGerald, Joshua Ainslie, Sumit Sanghai, Fei Sha, William W. Cohen

TL;DR

LUMEN (Live Update Memory Network) is a hybrid retrieval-augmented model that bridges the gap between expensive on-the-fly encoding and low-quality pre-computed memory. By pre-computing the bulk of passage representations and only "finishing" the encoding with a small query-conditioned "live" encoder, it achieves near-state-of-the-art accuracy at a fraction of the computational cost.

The Compute Tax of Retrieval-Augmented Models

Retrieval-augmented language models, such as Fusion-in-Decoder (FiD), are the current gold standard for knowledge-intensive tasks like open-domain question answering. They work by retrieving relevant text passages from a massive corpus (like Wikipedia) and processing them alongside the user's question.

However, this approach comes with a massive "compute tax." In standard FiD, every time a question is asked, the model must encode dozens of retrieved passages from scratch, conditioned on that specific question. This makes inference incredibly slow and expensive.

Researchers have tried to solve this by pre-encoding the entire corpus into a "memory" of vector representations. While this makes inference fast (you just grab the vectors), it incurs a severe "quality penalty." Because these representations were computed without knowing the specific question, they often lack the nuance needed to extract the exact answer. The authors of this paper ask: Can we get the efficiency of pre-computed memory without sacrificing the accuracy of on-the-fly encoding?

Introducing LUMEN

The authors propose LUMEN, which splits the encoding process into two distinct stages:

LUMEN Architecture
  1. The Memory Encoder (Frozen): This consists of the first $1 - \alpha$ layers of a standard T5 encoder. These layers are run offline once to pre-compute representations for the entire text corpus. These "frozen" representations are stored in memory.
  2. The Live Encoder (Fine-tuned): This consists of the remaining $\alpha$ layers of the encoder. During inference, the model retrieves the pre-computed representations and passes them through these "live" layers, which are conditioned on the specific question.

By adjusting the parameter $\alpha$ (the proportion of live layers), developers can choose their preferred trade-off between compute cost and model quality. LUMEN also uses a separate Question Encoder to ensure the question's representation is compatible with the pre-computed passage memories.

Key Insights and Performance

LUMEN was evaluated on standard open-domain question-answering benchmarks, including Natural Questions (NQ), TriviaQA, and WebQuestions, using a 2020 snapshot of Wikipedia as the retrieval corpus.

Performance vs. Live Layers
  • The "Top-Off" Effect: The most surprising finding is that you don't need to re-encode a passage from scratch to make it "query-aware." As shown in the chart above, a small number of live layers (as few as 20-30%) can "update" a generic pre-computed representation enough to match the performance of a model that saw the question from layer one.
  • Efficiency Scales with Size: The advantage of LUMEN actually increases as the model gets larger. For the massive T5-XXL model, LUMEN matches full FiD performance using only one-third of the live layers.
  • Performance Parity and Massive Speedup: On Natural Questions, LUMEN-XXL with $\alpha=0.33$ (33% live layers) achieved an Exact Match (EM) score of 57.1, nearly identical to the full FiD-XXL score of 57.3. Because it skips the first two-thirds of the encoder, LUMEN-XXL uses significantly fewer FLOPs per sample—roughly 10 TFLOPs compared to FiD's 30 TFLOPs—for the same level of accuracy.
  • Conditioning > Fine-tuning: Ablation studies reveal that the primary benefit of the live encoder comes from its ability to let the question "attend" to the passage (and vice versa) on-the-fly, rather than just the fact that those layers are task-specific.

Limitations and Future Work

While LUMEN saves compute, it requires significant storage. Pre-computing the representations for all of Wikipedia using an XXL model takes up approximately 16 terabytes of disk space.

Furthermore, the paper assumes the retrieval step (finding the passages) is already handled. Future work could look at how to jointly optimize the retriever and the LUMEN reader. The authors also suggest exploring "non-standard" shapes—for example, using a very wide but shallow memory encoder paired with a deep but narrow live encoder to further optimize the compute-to-memory ratio.

Summary updated

BibTeX
@inproceedings{jong2023pre,
  author = {Michiel de Jong and Yury Zemlyanskiy and Nicholas FitzGerald and Joshua Ainslie and Sumit Sanghai and Fei Sha and William W. Cohen},
  title = {{Pre-computed memory or on-the-fly encoding? A hybrid approach to retrieval augmentation makes the most of your compute}},
  booktitle = {International Conference on Machine Learning},
  year = {2023},
  url = {https://openreview.net/forum?id=nlUAvrMbUZ},
}
Figure