Large language models (LLMs) often struggle with knowledge-intensive tasks due to hallucinations and outdated parametric knowledge. While Retrieval-Augmented Generation (RAG) addresses this by integrating external corpora, its effectiveness is limited by fragmented information in unstructured domain documents. Graph-augmented RAG (GraphRAG) emerged to enhance contextual reasoning through structured knowledge graphs, yet paradoxically underperforms vanilla RAG in real-world scenarios, exhibiting significant accuracy drops and prohibitive latency despite gains on complex queries. We identify the rigid application of GraphRAG to all queries, regardless of complexity, as the root cause. To resolve this, we propose an efficient and adaptive GraphRAG framework called EA-GraphRAG that dynamically integrates RAG and GraphRAG paradigms through syntax-aware complexity analysis. Our approach introduces: (i) a syntactic feature constructor that parses each query and extracts a set of structural features; (ii) a lightweight complexity scorer that maps these features to a continuous complexity score; and (iii) a score-driven routing policy that selects dense RAG for low-score queries, invokes graph-based retrieval for high-score queries, and applies complexity-aware reciprocal rank fusion to handle borderline cases. Extensive experiments on a comprehensive benchmark, consisting of two single-hop and two multi-hop QA benchmarks, demonstrate that our EA-GraphRAG significantly improves accuracy, reduces latency, and achieves state-of-the-art performance in handling mixed scenarios involving both simple and complex queries.
翻译:大型语言模型(LLMs)在处理知识密集型任务时,常因幻觉和过时的参数化知识而受限。检索增强生成(RAG)通过整合外部语料库来应对这一问题,但其效果受限于非结构化领域文档中信息的碎片化。图增强RAG(GraphRAG)应运而生,旨在通过结构化知识图谱增强上下文推理能力,然而在实际场景中却矛盾地表现不及基础RAG,尽管在复杂查询上有所提升,却存在显著的准确率下降和难以接受的延迟。我们发现,其根本原因在于无论查询复杂度如何,GraphRAG都被僵化地应用于所有查询。为解决此问题,我们提出了一种高效自适应的GraphRAG框架,称为EA-GraphRAG,它通过语法感知的复杂度分析,动态整合RAG与GraphRAG范式。我们的方法引入了:(i)一个语法特征构造器,用于解析每个查询并提取一组结构特征;(ii)一个轻量级复杂度评分器,将这些特征映射为一个连续的复杂度分数;(iii)一个分数驱动的路由策略,该策略为低分查询选择密集RAG,为高分查询调用基于图的检索,并对边界情况应用复杂度感知的互逆排序融合。在一个包含两个单跳和两个多跳问答基准的综合基准测试上进行的大量实验表明,我们的EA-GraphRAG显著提高了准确率,降低了延迟,并在处理同时包含简单和复杂查询的混合场景中实现了最先进的性能。