ERAGent: Enhancing Retrieval-Augmented Language Models with Improved Accuracy, Efficiency, and Personalization

Yunxiao Shi, Xing Zi, Zijing Shi, Haimin Zhang, Qiang Wu, Min XuarXiv 2024 · DOI

Abstract

Retrieval-augmented generation (RAG) for language models significantly improves language understanding systems. The basic retrieval-then-read pipeline of response generation has evolved into a more extended process due to the integration of various components, sometimes even forming loop structures. Despite its advancements in improving response accuracy, challenges like poor retrieval quality for complex questions that require the search of multifaceted semantic information, inefficiencies in knowledge re-retrieval during long-term serving, and lack of personalized responses persist. Motivated by transcending these limitations, we introduce ERAGent, a cutting-edge framework that embodies an advancement in the RAG area. Our contribution is the introduction of the synergistically operated module: Enhanced Question Rewriter and Knowledge Filter, for better retrieval quality. Retrieval Trigger is incorporated to curtail extraneous external knowledge retrieval without sacrificing response quality. ERAGent also personalizes responses by incorporating a learned user profile. The efficiency and personalization characteristics of ERAGent are supported by the Experiential Learner module which makes the AI assistant being capable of expanding its knowledge and modeling user profile incrementally. Rigorous evaluations across six datasets and three question-answering tasks prove ERAGent's superior accuracy, efficiency, and personalization, emphasizing its potential to advance the RAG field and its applicability in practical systems.

Introduction

Retrieval-Augmented Generation (RAG) has become a cornerstone in reducing hallucinations and improving the factual grounding of Large Language Models (LLMs). By fetching relevant documents from external corpora, RAG systems provide models with the context necessary to answer specific or up-to-date queries. However, standard "retrieve-then-read" pipelines face significant hurdles in real-world deployment. These include poor query quality from users (often laden with jargon or ambiguity), redundant retrieval of the same information across sessions, and a "one-size-fits-all" approach that ignores individual user preferences.

ERAGent is proposed as a modular framework to address these "pain points." It moves beyond simple retrieval by incorporating intelligent triggering, precision filtering, and an "Experiential Learner" that builds persistent user profiles and local memory. This paper details the architecture of ERAGent and demonstrates its efficacy across multiple benchmarks.

The ERAGent Framework

The ERAGent architecture consists of five synergistically operated modules designed to optimize the flow from user query to personalized response.

The ERAGent framework architecture, illustrating the flow from query rewriting to experiential learning.

1. Enhanced Question Rewriter

Users often provide queries that are either too brief or contain domain-specific terminology that does not align well with general-purpose retrieval indices. The Enhanced Question Rewriter addresses this by utilizing a terminology dictionary to expand and clarify the query. It transforms colloquial or jargon-heavy input into multiple, fine-grained search queries that cover different facets of the information needed.

An example of the Enhanced Question Rewriter processing a complex medical query into clear, searchable terms.

2. Retrieval Trigger

To improve efficiency, ERAGent does not always default to external retrieval. The Retrieval Trigger acts as a gatekeeper, calculating a "popularity" metric against a local Knowledge Boundary. If the system determines that the required information is already present in its local Memory Knowledge Base (populated by previous interactions), it skips the external search, significantly reducing latency and compute costs.

3. Knowledge Filter

Retrieved documents often contain "noise" or irrelevant snippets. The Knowledge Filter employs Natural Language Inference (NLI) to evaluate whether a retrieved snippet actually entails the information needed for the answer. By pruning irrelevant data before it reaches the LLM reader, the system reduces the risk of the model being misled by distractor information.

4. Personalized LLM Reader

The final generation stage is not static. The Personalized LLM Reader takes the filtered knowledge and the rewritten question, but also injects a learned User Profile. This allows the model to tailor its response style, tone, and content to the specific user's known preferences and constraints.

5. Experiential Learner

The Experiential Learner is the core of ERAGent's long-term intelligence. It incrementally updates the Memory Knowledge Base and the User Profile based on every successful interaction. This allows the agent to "grow" its internal knowledge and refine its understanding of the user over time, facilitating faster and more accurate responses in future sessions.

Experimental Evaluation

The authors evaluated ERAGent across six datasets covering three task types:

  • One-Round Open-Domain QA: Natural Questions (NQ), PopQA, and AmbigNQ.
  • Multi-Hop Reasoning: HotpotQA and 2WIKIMQA.
  • Multi-Session Personalization: A new dataset, MSMTQA (Multi-Session Multi-Round Question Answering), was introduced to test long-term personalization across 12 unique personas.

Key Results

  • Accuracy Gains: ERAGent demonstrated superior performance, particularly on complex datasets. On AmbigNQ, it achieved an Exact Match (EM) score of 47.00, a significant jump from the 38.00 baseline. The synergy between the Rewriter and Filter was found to be crucial for these gains.
  • Efficiency Improvements: By setting an optimal similarity threshold ($\tau = 0.6$) for the Retrieval Trigger, the system achieved a 40% reduction in response time. It successfully avoided redundant external calls for questions similar to those previously encountered.
  • Personalization Success: In GPT-4-based pairwise evaluations, the personalized responses were preferred significantly over generic ones. For instance, in dietary advice scenarios, the system correctly remembered and applied user-specific restrictions (e.g., avoiding beef), which generic RAG systems failed to do.

Discussion and Future Work

While ERAGent shows significant promise, the authors noted that the NLI-based Knowledge Filter can occasionally be overly stringent, leading to the loss of useful context. Future work will focus on refining this filtering mechanism and testing the framework with real-world human interaction data beyond the simulated MSMTQA dataset. Additionally, exploring more complex, non-linear pipeline structures could further enhance reasoning capabilities for extremely difficult queries.

In conclusion, ERAGent represents a significant step forward in making RAG systems more practical, efficient, and user-centric, proving that "knowing when to search" and "knowing who you are talking to" are as important as the retrieval process itself.

Summary updated

BibTeX
@misc{shi2024eragent,
  author = {Yunxiao Shi and Xing Zi and Zijing Shi and Haimin Zhang and Qiang Wu and Min Xu},
  title = {{ERAGent: Enhancing Retrieval-Augmented Language Models with Improved Accuracy, Efficiency, and Personalization}},
  year = {2024},
  eprint = {2405.06683},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2405.06683},
}
Figure