R$^{2}$Adapter: A Routing and Rewriting Adapter for Efficient Hybrid RAG

R$^{2}$Adapter: A Routing and Rewriting Adapter for Efficient Hybrid RAG

R$^{2}$Adapter:用于高效混合 RAG 的路由与重写适配器

Retrieval-Augmented Generation (RAG) has become a prevailing paradigm for enhancing Large Language Models (LLMs) with non-parametric knowledge. Vanilla RAG efficiently handles simple queries but struggles with relational or multi-hop reasoning. Graph-based RAG alleviates this issue but incurs higher inference complexity and latency. In practice, user queries can differ significantly in their complexity, rendering a fixed RAG strategy suboptimal. However, existing hybrid text-graph RAG methods typically rely on heuristic and LLM-based routing, resulting in unnecessary overhead and strong dependence on the underlying LLM.

检索增强生成(RAG)已成为利用非参数化知识增强大语言模型(LLM)的主流范式。基础 RAG 可以高效处理简单查询,但在处理关系型或多跳推理时表现欠佳。基于图的 RAG 虽然缓解了这一问题,但带来了更高的推理复杂度和延迟。在实际应用中,用户查询的复杂度差异巨大,使得固定的 RAG 策略往往并非最优。然而,现有的混合文本-图 RAG 方法通常依赖启发式规则或基于 LLM 的路由,导致了不必要的开销,并对底层 LLM 产生了强依赖。

To address these challenges, we propose R$^{2}$Adapter, a lightweight plug-in Routing and Rewriting Adapter designed to allocate queries between vanilla and graph-based RAG dynamically. By routing only the queries that genuinely benefit from graph-based reasoning, R$^{2}$Adapter reduces unnecessary graph retrieval overhead. Additionally, uncertain graph-routed queries are rewritten to better expose their multi-hop reasoning requirements, improving retrieval quality without additional supervision.

为了应对这些挑战,我们提出了 R$^{2}$Adapter,这是一种轻量级的插件式路由与重写适配器,旨在动态地在基础 RAG 和基于图的 RAG 之间分配查询。通过仅将真正能从图推理中获益的查询进行路由,R$^{2}$Adapter 减少了不必要的图检索开销。此外,对于不确定的图路由查询,系统会对其进行重写,以更好地揭示其多跳推理需求,从而在无需额外监督的情况下提升检索质量。

Extensive experiments on three multi-hop QA benchmarks demonstrate that R$^{2}$Adapter reduces graph-based RAG usage by up to 59% while maintaining comparable answer accuracy. This adapter is model-agnostic and can be seamlessly integrated into diverse vanilla and graph-based RAG pipelines, providing an efficient and adaptive solution for hybrid RAG systems.

在三个多跳问答基准测试上的大量实验表明,R$^{2}$Adapter 在保持相当回答准确率的同时,将基于图的 RAG 使用率降低了高达 59%。该适配器具有模型无关性,可以无缝集成到各种基础和基于图的 RAG 流水线中,为混合 RAG 系统提供了一种高效且自适应的解决方案。