RAG without Forgetting: Continual Query-Infused Key Memory

Yuntong Hu, Sha Li, Naren Ramakrishnan, Liang Zhao

Introduction: The Stateless Bottleneck in RAG

In Retrieval-Augmented Generation (RAG) systems, the retrieval step is frequently the primary bottleneck for performance. To mitigate this, researchers often employ Query Expansion (QE) techniques—such as HyDE—which leverage Large Language Models (LLMs) to generate hypothetical answers or synonyms that enrich the search query. While highly effective, QE is inherently "stateless." The system recomputes these expensive expansions for every single query and discards them immediately after use, incurring high inference costs and preventing the system from learning cumulatively over time.

Conversely, Key Expansion (KE) attempts to enrich the document side of the index. However, KE is typically performed offline and remains "query-agnostic," meaning it fails to account for actual user search behavior. This disconnect often results in "semantic drift," where the index becomes cluttered with noisy, irrelevant information.

To resolve this structural separation between query adaptation and validation, researchers introduce Evolving Retrieval Memory (ERM). ERM is a training-free framework designed to "bake" successful query expansions directly into the document index, achieving the high performance of complex query expansion at the lightning speed of native retrieval.

The Evolving Retrieval Memory (ERM) Framework

ERM transforms transient query-time gains into persistent retrieval improvements through three core mechanisms:

  1. Correctness-Gated Feedback Verifier: Rather than blindly updating the index with every query, ERM strictly listens to "validated" signals. It utilizes a success indicator—verifying whether the retrieval found the correct document or if the LLM produced a high-quality answer. Only when successful is the query expansion cached for memory evolution.
  2. Selective Expansion Attribution: Recognizing that not every part of a query expansion benefits every document, ERM measures the "marginal benefit" of an expansion unit for a specific document. It selectively attributes expansion signals only to the document keys they genuinely improve, effectively preventing noise accumulation.
  3. Progressive Key Evolution: To maintain system stability, ERM updates document vectors (keys) in a batched, "lazy" manner. It employs a saturation criterion that halts updates to a key once the marginal benefit of new information diminishes. This ensures the index converges to a stable state rather than drifting indefinitely.

Theoretical Foundation and Key Insights

At the heart of ERM is a mathematical proof demonstrating that expanding a query is theoretically equivalent to expanding a document key under standard similarity functions (such as the inner product). This equivalence justifies shifting the computational burden from the query side (which slows down inference) to the key side (which enables fast retrieval).

This architecture yields several critical insights:

  • Amortized Inference Cost: By embedding the "intelligence" of query expansion into the document index, the per-query computational cost eventually vanishes. Users experience LLM-quality retrieval at the speed of a simple vector search.
  • Specialization over Generalization: As document keys evolve, they specialize toward the specific query patterns that successfully retrieve them. This reduces "crowding" in the embedding space, allowing the retriever to better distinguish between similar but distinct concepts.
  • Zipf-like Efficiency: Real-world query distributions are long-tailed (Zipfian). ERM exploits this by focusing updates on the most frequent intents, covering a massive portion of user traffic with minimal index modifications.
  • Training-Free Evolution: ERM is entirely non-parametric. It requires no fine-tuning of massive embedding models; it simply updates the vectors within an existing vector database.

Experimental Setup

The researchers evaluated ERM across 13 diverse domains using two major benchmarks:

  • BEIR: A standard, heterogeneous benchmark for information retrieval (including datasets like NFCorpus and SciDocs).
  • BRIGHT: A newer, highly challenging benchmark specifically designed for reasoning-intensive retrieval, covering domains like StackExchange (Biology, Earth Science), LeetCode (coding), and AoPS/TheoremQA (mathematics).

Key Results

ERM demonstrated remarkable improvements across both standard and complex retrieval tasks:

  • Massive Retrieval Gains: ERM achieved a +46% average improvement in nDCG for sparse models (BM25) and a +13–15% boost for state-of-the-art dense retrievers (such as BGE and GTE).
  • Reasoning Powerhouse: Performance gains were most dramatic on complex, reasoning-heavy tasks. On the AoPS (math) dataset, performance skyrocketed by 115% to 2200%, depending on the underlying retriever.
  • Unmatched Efficiency: ERM operates at native retrieval speeds (150–280 ms). This represents a 50–100x latency reduction compared to LLM-based query expansion methods like HyDE, which can take 7–15 seconds per query.
  • No Catastrophic Forgetting: In "streaming" evaluations where new domains were introduced sequentially, the system maintained or improved its performance on older domains while successfully adapting to new ones.

Limitations and Future Directions

While ERM presents a massive leap forward for RAG efficiency, the authors note a few limitations. First, the system is susceptible to feedback loops: if a document is never retrieved initially, it never receives updates, potentially marginalizing underrepresented content. Future iterations may require better exploration strategies to balance this "rich-get-richer" dynamic and prevent the index from saturating too early on local optima.

Finally, while the underlying theory holds for most dense retrievers, the authors acknowledge that ERM's mathematical equivalence may not extend perfectly to "late-interaction" models (like ColBERT) or certain sparse retrievers without further architectural modifications.

Summary updated

BibTeX
@inproceedings{hu2026rag,
  author = {Yuntong Hu and Sha Li and Naren Ramakrishnan and Liang Zhao},
  title = {{RAG without Forgetting: Continual Query-Infused Key Memory}},
  booktitle = {International Conference on Machine Learning},
  year = {2026},
  url = {https://openreview.net/forum?id=Z8svqD3pmI},
}

Loading related content...

Figure