Abstract
Retrieval-Augmented Generation (RAG) systems face challenges with complex, multihop questions. Agentic frameworks such as Search-R1, which operates iteratively, have been proposed to address these complexities. However, such approaches can introduce inefficiencies, including repetitive retrieval and challenges in contextualizing results effectively within the current generation prompt. In this paper, we investigate test-time modifications to the Search-R1 pipeline to mitigate these shortcomings. Specifically, we explore the integration of a contextualization module to better integrate relevant information and a de-duplication module that replaces previously retrieved documents. Evaluated on HotpotQA and Natural Questions, our best-performing variant, utilizing GPT-4.1-mini for contextualization, achieves a 5.6% increase in EM score and reduces retrieval turns by 10.5% compared to the baseline.
Introduction
Agentic RAG systems represent an evolution from simple one-shot retrieval to iterative loops of reasoning and searching. In frameworks like Search-R1, a model generates a search query, processes the results, and decides whether further retrieval is necessary to answer complex, multi-hop questions. Despite their potential, these iterative processes often suffer from two primary bottlenecks: information forgetting, where models struggle to retain data from earlier steps, and ineffective extraction, leading to redundant "retrieval loops."
These issues result in increased token consumption, higher latency, and suboptimal accuracy. We propose addressing these shortcomings through test-time modifications that require no retraining of the base model.
Methodology
We introduce three strategies to refine the information flow between the retriever and the reasoning agent:
- Contextualization Module: Instead of feeding raw documents back into the reasoning loop, an external LLM (GPT-4.1-mini) extracts only the relevant snippets. This distilled information is stored in a persistent memory cache accessible in every subsequent turn.
- De-duplication Module: This module filters out documents previously seen by the agent, ensuring the retriever provides the next most relevant, unseen documents from the search results.
- Hybrid Approach: This combines both modules, where retrieved documents are first de-duplicated and then contextualized before being presented to the reasoning agent.
Experimental Evaluation
We evaluated these strategies using the HotpotQA and Natural Questions (NQ) datasets, focusing on multi-hop reasoning and real-world queries. The primary baseline was the Qwen2.5-7b Search-R1 model. Performance was measured using Exact Match (EM) scores, an LLM-as-a-Judge semantic similarity check (LLM Match), and the average number of retrieval searches.
Results and Analysis
The experimental results demonstrate that the Contextualization strategy significantly outperforms the baseline in both accuracy and efficiency.
Key findings include:
- Accuracy and Efficiency Gains: The Contextualization module achieved a 5.6% increase in EM scores and a 6.7% increase in LLM Match scores over the baseline. Simultaneously, it reduced the average number of retrieval turns from 2.39 to 2.14, a 10.5% improvement in efficiency.
- The Role of De-duplication: Interestingly, de-duplication alone increased the average number of searches. This suggests that without improved extraction (contextualization), forcing the model to look at new documents simply extends the search process. The synergy between de-duplication and contextualization is vital for true efficiency.
- Performance Decay: Analysis shows that as the number of required search turns increases, the EM score tends to drop. This indicates a point of diminishing returns in agentic loops where the model may eventually lose the thread of the original question.
Conclusion and Future Work
Our study highlights that simple test-time modifications can substantially improve the performance of agentic RAG systems. By focusing on concise information representation and preventing redundant retrieval, we can create more accurate and efficient AI agents. Future work will explore integrating these memory and filtering capabilities directly into the model's training via reinforcement learning, potentially removing the need for external contextualization APIs and further reducing latency.
Summary updated