RAM: Towards an Ever-Improving Memory System by Learning from Communications

Jiaqi Li, Xiaobo Wang, Zihao Wang, Zilong ZhengarXiv 2024

Abstract

We introduce an innovative RAG-based framework with an ever-improving memory. Inspired by humans' pedagogical process, RAM utilizes recursively reasoning-based retrieval and experience reflections to continually update the memory and learn from users' communicative feedback, namely communicative learning. Extensive experiments with both simulated and real users demonstrate significant improvements over traditional RAG and self-knowledge methods, particularly excelling in handling false premise and multi-hop questions. Furthermore, RAM exhibits promising adaptability to various feedback and retrieval methods, showcasing its potential for advancing AI capabilities in dynamic knowledge acquisition and lifelong learning.

Introduction

Large Language Models (LLMs) are typically static after training, making it difficult for them to integrate new information or correct outdated beliefs without expensive retraining. While Retrieval-Augmented Generation (RAG) provides external context, it often relies on a static knowledge base and fails to learn from user interactions. This paper addresses the challenge of building a Communicatively-Learned AI (CLAI)—an agent that can determine when and how to update its internal dynamic memory based on feedback, mirroring a student learning from a teacher.

The RAM Framework

RAM mimics a pedagogical process through two primary modules designed to create a lifelong learning loop.

  1. Recursive Reasoning-based Retrieval ($R^3$): Instead of a single search query, the model uses a recursive "Chain-of-Thought" (CoT) approach. It reasons about a question, performs a search, reflects on the result, and decides whether further searching is required. This allows the model to decompose complex, multi-hop questions into manageable steps and clarify search directions.
  2. Memory-Reflection & Update: When the model fails to answer correctly, it receives feedback (from a human or a "teacher" model). It then generates a "reflected memory"—a corrected version of the facts—and uses semantic similarity to locally edit the outdated entry in its vector database.
The RAM framework architecture, illustrating the cycle of recursive retrieval, inference, and memory update based on human feedback.

Experimental Results

The authors evaluated RAM using FreshQA (for post-2023 knowledge and false-premise questions) and MQuAKE-T (for multi-hop reasoning). RAM achieved massive accuracy gains, with an average improvement of 30% over self-knowledge and 40% over standard RAG-only methods.

As shown in Figure 2, RAM's performance on the MQuAKE-T dataset is particularly noteworthy. On 3-hop questions, RAM's performance jumped from near-zero to over 50%, vastly outstripping traditional RAG. Remarkably, RAM often exceeded the performance of models given the ground-truth updated memory from the start (RAG-upd), suggesting that the process of reflection and reasoning adds value beyond raw data.

Performance comparison on the MQuAKE dataset, showing RAM's significant advantage in multi-hop reasoning compared to standard RAG and self-knowledge.

Discussion and Insights

Several key insights emerged from the study:

  • The Power of Hints: Providing "hints" rather than direct answers led to better long-term performance. Hints stimulate the model to use its internal reasoning more effectively, whereas direct answers can lead to a dependency on "spoon-fed" information.
  • Handling False Premises: RAM is exceptionally effective at rebutting questions based on incorrect assumptions (e.g., "Who is the king of the United States?"). By retrieving and reflecting on the lack of such a figure, it avoids the common LLM trap of hallucination.
  • Memory Cache Analogy: By treating the vector database like a fast-updated memory cache, RAM achieves lifelong learning without the computational cost of retraining model weights.

Conclusion

RAM represents a significant step toward AI agents that can learn and adapt in real-time. While currently focused on QA tasks, future work will explore using more complex structures like Knowledge Graphs and developing more proactive models that can identify exactly when to ask for human intervention. The framework's success in handling complex reasoning and dynamic facts showcases its potential for advancing AI capabilities in lifelong learning.

Summary updated

BibTeX
@misc{li2024ram,
  author = {Jiaqi Li and Xiaobo Wang and Zihao Wang and Zilong Zheng},
  title = {{RAM: Towards an Ever-Improving Memory System by Learning from Communications}},
  year = {2024},
  eprint = {2404.12045},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2404.12045},
}
Figure