无需预建图结构,动态构建推理逻辑提升RAG效果。
You Don't Need Pre-built Graphs for RAG: Retrieval Augmented Generation with Adaptive Reasoning Structures
- 推理时动态构建有向无环图,按逻辑顺序分解问题
- 相比基线模型,检索成本降低40%以上,准确率提升5.3个点
- 适合复杂问答场景,尤其对知识密集型任务优化明显
大语言模型在处理超出其知识范围的问题时常产生幻觉。检索增强生成(RAG)通过从知识库中检索相关上下文来支持模型推理。现有基于图的RAG方法依赖预构建图,转换过程耗时且引入高令牌开销与更新延迟。此外,真实查询类型多样、复杂度不一,所需推理结构各异,预建图难以匹配,导致知识检索效率低下。为此,我们提出逻辑感知的检索增强生成框架LogicRAG,可在推理时动态提取推理结构,无需任何预建图。LogicRAG首先将输入问题分解为子问题,并构建有向无环图(DAG)以建模其逻辑依赖关系;随后通过拓扑排序线性化图结构,确保多步推理顺序一致。同时,采用图剪枝减少冗余检索,上下文剪枝过滤无关内容,显著降低整体令牌消耗。大量实验表明,LogicRAG在性能与效率上均优于现有最优基线。
原文摘要 · Abstract (English)
Large language models (LLMs) often suffer from hallucination, generating factually incorrect statements when handling questions beyond their knowledge and perception. Retrieval-augmented generation (RAG) addresses this by retrieving query-relevant contexts from knowledge bases to support LLM reasoning. Recent advances leverage pre-constructed graphs to capture the relational connections among distributed documents, showing remarkable performance in complex tasks. However, existing Graph-based RAG (GraphRAG) methods rely on a costly process to transform the corpus into a graph, introducing overwhelming token cost and update latency. Moreover, real-world queries vary in type and complexity, requiring different logic structures for accurate reasoning. The pre-built graph may not align with these required structures, resulting in ineffective knowledge retrieval. To this end, we propose a $\textbf{Logic}$-aware $\textbf{R}etrieval$-$\textbf{A}$ugmented $\textbf{G}$eneration framework ($\textbf{LogicRAG}$) that dynamically extracts reasoning structures at inference time to guide adaptive retrieval without any pre-built graph. LogicRAG begins by decomposing the input query into a set of subproblems and constructing a directed acyclic graph (DAG) to model the logical dependencies among them. To support coherent multi-step reasoning, LogicRAG then linearizes the graph using topological sort, so that subproblems can be addressed in a logically consistent order. Besides, LogicRAG applies graph pruning to reduce redundant retrieval and uses context pruning to filter irrelevant context, significantly reducing the overall token cost. Extensive experiments demonstrate that LogicRAG achieves both superior performance and efficiency compared to state-of-the-art baselines.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。