Towards Adaptive Memory-Based Optimization for Enhanced Retrieval-Augmented Generation (2025)

Abstract: Retrieval-Augmented Generation (RAG), by integrating non-parametric knowledge from external knowledge bases into models, has emerged as a promising approach to enhancing response accuracy while mitigating factual errors and hallucinations. This method has been widely applied in tasks such as Question Answering (QA). However, existing RAG methods struggle with open-domain QA tasks because they perform independent retrieval operations and directly incorporate the retrieved information into generation without maintaining a summarizing memory or using adaptive retrieval strategies, leading to noise from redundant information and insufficient information integration.To address these challenges, we propose Adaptive memory-based optimization for enhanced RAG (Amber) for open-domain QA tasks, which comprises an Agent-based Memory Updater, an Adaptive Information Collector, and a Multi-granular Content Filter, working together within an iterative memory updating paradigm. Specifically, Amber integrates and optimizes the language model’s memory through a multi-agent collaborative approach, ensuring comprehensive knowledge integration from previous retrieval steps. It dynamically adjusts retrieval queries and decides when to stop retrieval based on the accumulated knowledge, enhancing retrieval efficiency and effectiveness. Additionally, it reduces noise by filtering irrelevant content at multiple levels, retaining essential information to improve overall model performance. We conduct extensive experiments on several open-domain QA datasets, and the results demonstrate the superiority and effectiveness of our method and its components. The source code is available .

## introduction in recent years, large language models (llms) (brown et al., 2020; achiam et al., 2023; touvron * these authors contributed equally to this work. 1 https://anonymous.4open.science/r/amber-b203/ @xcite have demonstrated exceptional performance across various tasks, including question answering (qa) @xcite , owing to their ability to capture diverse knowledge through billions of parameters. however, even the most advanced llms often suffer from hallucinations @xcite and factual inaccuracies due to their reliance on parametric memory. additionally, it is impractical for these models to memorize all of the everevolving knowledge. to address these challenges, retrieval-augmented generation (rag) @xcite @xcite have garnered increasing attention. these models retrieve passages relevant to the query from external corpora and incorporate them as context to the llms, enabling the generation of more reliable answers. by integrating retrieved information, retrieval-augmented llms maintain both the accuracy and timeliness of their knowledge. early studies on rag primarily focused on single-hop queries @xcite , where answers can typically be found within a single document. however, these methods often fall short when handling complex qa tasks, such as long-form qa and multi-hop qa, which require aggregating information from multiple sources. unlike single-hop qa, these queries necessitate connecting and synthesizing information across multiple documents and cannot be solved by a single retrieval-and-response step. for instance, the query "is microsoft office 2019 available in a greater number of languages than microsoft office 2013?" requires three reasoning steps: first, retrieving information about the languages supported by "office 2019"; second, retrieving similar information for "office 2013"; and finally, comparing the two sets of data to produce an answer. to address this issue, adaptive rag has been proposed. it adaptively selects appropriate retrieval questions and timing based on the difficulty of the user query to flexibly capture more valuable knowledge for answering open-domain qa tasks, achieving a balance between effectiveness and efficiency. however, these methods still have several problems. first, each retrieval operates independently and lacks a summarizing memory of previous retrieval fragments, which may cause the outputs to reflect only limited knowledge from specific retrieval steps while neglecting the integration and interaction of retrieved information from different steps. second, when the llm uses these retrieved fragments for reasoning, it does not actively evaluate the validity of the information. consequently, without the ability to determine when to proactively stop retrieval based on known information or update the queries that need to be retrieved, it may lead to inefficiencies or the retrieval of irrelevant information. third, the effective parts within the retrieved text segments are very few, and excessive redundant information introduces noise, which can obscure important details and negatively impact the model's performance. to this end, we propose adaptive memory-based optimization for enhanced rag (amber). amber comprises three core components: agent-based memory updater (amu), adaptive information collector (aic), and multi-granular content filter (mcf). these components work in unison to automatically integrate and update retrieved information as the llm's memory, dynamically adjust the queries based on known information, and employ multi-granular content filtering during retrieval to retain useful information and reduce noise, thereby achieving outstanding performance. firstly, to address the issue in which each retrieval operates independently and lacks a summarizing memory of previous retrieval fragments, amu employs a multiagent collaborative approach. by coordinating various agents, amu optimizes the llm's current memory. this process ensures that the knowledge structure is continuously refined and enriched, effectively integrating all valuable information from previous retrieval steps. secondly, aic utilizes the real-time memory generated by amu to update the queries that need to be retrieved and decides when to stop retrieval. by automatically adjusting the retrieval process based on the accumulated knowledge, aic ensures that subsequent retrievals are more targeted and efficient, effectively addressing the challenge of insufficient knowledge accumulation and avoiding unnecessary retrievals. lastly, we fine-tune the llm to function as mcf to reduce noise during retrieval. mcf includes two levels of filtering capabilities. firstly, it assesses the validity of the entire retrieved text segment and the query, determining whether the information is relevant and useful. secondly, from the valid retrieved segments, it filters out irrelevant content and retains essential information. this approach effectively reduces redundant information and highlights crucial details, thereby enhancing the overall performance of the model. in summary, our contributions are as follows. open-domain qa open-domain question answering (openqa) @xcite seeks to provide answers to questions expressed in natural language that are not restricted to a specify domain. modern methods for open qa tasks typically adopt the retriever-and-reader framework @xcite . with the advancement of open-domain qa, multi-hop qa @xcite and longform @xcite have gradually emerged. this more complex qa further necessitates the system to extensively collect and contextualize from the multiple documents (typically through iterative processes) in order to address more intricate queries. in particular, @xcite suggested breaking down multi-hop queries into simpler single-hop queries, iteratively utilizing llms and the retriever to address these sub-queries, and then combining their results to construct a comprehensive answer. unlike the decomposition-based method, other recent studies, such as @xcite and @xcite , explored a technique that creates a logical sequence of reasoning steps with document original question: who sings back vocals with piano one of these nights, the song? z knowledge retriever external knowledge: k1: wikipedia: one of these nights is the fourth audio album … k2: who wrote one of these nights? one of these night was written by don henley and glen frey… k3: one of these nights" is the fourth studio album by american rock band … chunk-level filter filtered chunks: c1, c2, c6… sentence-level filter extracted sentences: p1, p2, p6… memory generate agent update memory? generate new query answer generate response: on the song "one of these nights" by the eagles, the piano is played by glen frey. multi-granular content filter agent-based memory updater adaptive information collector reviewer challenger refiner memory memory query memory query query who wrote one of these nights? one of these night was written by don henley and glen frey one of these night was written by don henley and glen frey retrieved chunk filtered content retrieval. additionally, @xcite proposed a method that involves iteratively fetching new documents when the tokens in the generated sentences exhibit low confidence, and @xcite proposed a retrieval strategy based on the complexity of the questions. however, the methods mentioned above neglect both the quality of retrieved documents and the generation of memory. therefore, it is essential to propose a method aimed at enhanceing the quality of both retrieval and memory generation. retrieval-augmented generation. rag has become essential for enhancing the response quality of large language models (llms). early strategies @xcite relied on single-time retrieval, inputting the retrieved passages directly into llms to generate answers. however, these methods often fell short in complex tasks like multihop and long-form question answering, failing to capture sufficient information. to address these limitations, multi-time retrieval @xcite was explored, though it risked incorporating irrelevant data, leading to poor-quality responses. this led to the development of adaptive rag (arag), which dynamically adjusts retrieval strategies based on realtime feedback, determining optimal retrieval times and content. key innovations include flare @xcite , which triggers new retrievals for low-confidence tokens, and self-rag @xcite , which uses self-reflective markers to assess content quality. these adaptive approaches enhance retrieval relevancy and accuracy, while agent-based models like react @xcite further augment rag's flexibility and intelligence. nevertheless, we argue that the above methods overlook the quality issues in both retrieval and agent generation, resulting in inaccurate answers. ## methods in this section, we define the task and present an overview of our proposed method, amber (illustrated in figure 1 ). following this, we provide a detailed explanation of each individual component. ## experimental setup in this section, we present the datasets, models, metrics, and implementation details. more experiment setup can see appendix a and b. ## results and analysis in this section, we evaluate our proposed framework, amber, on six real-world datasets and compare it against several baselines, including no retrieval, single-time and adaptive rag methods. ## conclusion in this paper, we propose a novel rag method, amber, based on memory-adaptive updates. our approach introduces a collaborative multi-agent memory updating mechanism, combined with an adaptive retrieval feedback iteration and a multigranular filtering strategy. this design enables efficient information gathering and adaptive updates, significantly improving answer accuracy while reducing hallucinations