Memory Never Fades: Boosting Long Context Processing with Global Memory-Enhanced Retrieval Augmentation

Hongjin Qian, Zheng Liu, Peitian Zhang, Kelong Mao, Defu Lian, Zhicheng Dou, Tiejun HuangWWW 2025

TL;DR

This paper introduces HawkRAG, a novel Retrieval-Augmented Generation (RAG) framework that tackles the challenge of processing extremely long contexts in Large Language Models (LLMs). HawkRAG uses a "global memory" to generate helpful clues, guiding retrieval for more accurate and comprehensive answers, outperforming existing RAG methods and even LLMs with extended context windows.

What Problem Does This Paper Address?

Large Language Models (LLMs) are increasingly tasked with processing vast amounts of text, from multi-page documents to entire books. While LLMs have seen significant improvements in their context window sizes (e.g., 32K or 128K tokens), processing extremely long contexts (potentially millions of tokens) remains computationally expensive and can still lead to insufficient performance. Traditional Retrieval-Augmented Generation (RAG) methods, which aim to mitigate this by retrieving relevant information, face limitations: they often require explicitly stated queries and well-structured knowledge bases, which are not always available in real-world long-context scenarios. This paper addresses the gap where standard RAG struggles with implicit information needs and unstructured long documents.

Methods

HawkRAG introduces a dual-system architecture inspired by human cognition.

  1. Light Global Memory System: This system creates a "global memory" of the entire long context. It uses KV compression to efficiently store this memory, making it scalable and retentive. When a task is presented, this memory module generates "draft answers" or "clues." These clues are not necessarily complete answers but serve as intelligent pointers to relevant information within the long context.
  2. Expressive Generation System: This system uses the clues generated by the memory module to guide a retriever. The retriever then fetches precise evidence from the long context. Finally, a generator uses this retrieved evidence and the original query to produce a high-quality final answer.

Key technical innovations include:

  • KV Compression: The memory module is implemented using KV compression, allowing for flexible context lengths and end-to-end optimization.
  • Reinforcement Learning from Generation Feedback (RLGF): The memory module's ability to generate useful clues is further enhanced through RLGF. This process rewards clues that lead to high-quality final answers, reinforcing the memory module's memorization and cluing capacity.

Datasets

The paper evaluates HawkRAG on several benchmarks:

  • LongBench [4] and InfiniteBench [55]: These benchmarks include both traditional QA tasks (e.g., HotPotQA, NarrativeQA) and non-QA tasks (e.g., government report summarization).
  • UltraDomain Benchmark: A newly curated benchmark consisting of 20 diverse datasets with long contexts and high-level queries across specialized domains like finance, law, physics, and programming. This benchmark is designed to test generalization beyond typical QA tasks.

Key Insights and Ideas

  • Human Cognition as Inspiration: The core idea of mimicking human reading comprehension—forming a global understanding first, then using that to guide detailed information retrieval—is a powerful paradigm shift for RAG.
  • Clues as Bridges: The "draft answers" or "clues" generated by the memory module are crucial. They act as semantic bridges, translating potentially vague or implicit user intents into actionable queries for the retrieval system, overcoming a key limitation of standard RAG.
  • Scalability and Efficiency: By using KV compression for its global memory, HawkRAG achieves a balance between handling long contexts and maintaining computational efficiency, outperforming even LLMs with large native context windows.
  • Generalization Beyond QA: HawkRAG demonstrates strong performance not only on standard QA tasks but also on more challenging non-QA tasks and complex scenarios where traditional RAG falters, significantly expanding RAG's applicability.

Key Results

  • Superior Performance: HawkRAG consistently outperforms standard RAG, advanced RAG methods (like RQ-RAG, HyDE, GraphRAG), and even LLMs with large context windows across various benchmarks.
  • LongBench & InfiniteBench: HawkRAG shows notable advantages, particularly in non-QA tasks where traditional RAG struggles.
  • UltraDomain: On the UltraDomain benchmark, HawkRAG consistently surpasses baselines, demonstrating strong domain generalization capabilities. For instance, on the "Computer" domain, HawkRAG achieved 40.5 F1-score, a significant improvement over the next best baseline (35.9).
  • Efficiency: HawkRAG maintains a balanced time and memory efficiency, being slower than standard RAG for indexing but more efficient than long LLMs for processing.

Limitations and Future Work

  • Indexing Latency: While HawkRAG is more efficient than long LLMs, its indexing latency is higher than standard RAG due to the global memory formation process.
  • Compression Ratio Trade-off: The paper notes a trade-off with the compression ratio (β) in compact memory. While higher compression improves efficiency, it can reduce semantic richness. The optimal point was found to be around β=32.
  • Future Work: The paper suggests exploring further optimizations for indexing latency and investigating the impact of different memory module architectures and training strategies. The authors also plan to release their code and the UltraDomain benchmark.

Summary updated

BibTeX
@inproceedings{qian2025memory,
  author = {Hongjin Qian and Zheng Liu and Peitian Zhang and Kelong Mao and Defu Lian and Zhicheng Dou and Tiejun Huang},
  title = {{Memory Never Fades: Boosting Long Context Processing with Global Memory-Enhanced Retrieval Augmentation}},
  booktitle = {The Web Conference},
  year = {2025},
  url = {https://openreview.net/forum?id=8Cggwrvkho},
}
Figure