arXiv:2502.14902cs.CLcs.AI2025-02AAAI被引 86

用关系路径精简检索信息,提升大模型问答逻辑性。

PathRAG: Pruning Graph-based Retrieval Augmented Generation with Relational Paths

  • 从知识图谱中提取关键关系路径替代冗余文本
  • 在6个数据集上5项指标均超越现有方法
  • 适合需要精准推理的问答系统研发者

检索增强生成(RAG)通过从外部数据库检索知识来提升大语言模型(LLM)的响应质量。传统RAG将文本库切分为块并以扁平结构组织,便于快速检索。为更好捕捉文本库中的内在依赖与结构化关系,研究者提出将文本信息组织成索引图,即基于图的RAG。然而,我们指出当前基于图的RAG方法问题不在于信息不足,而在于检索结果存在冗余。此外,先前方法仍以扁平结构组织提示中的检索内容,导致性能不佳。为此,我们提出PathRAG,从索引图中检索关键关系路径,并将其转化为自然语言用于提示LLM。具体而言,PathRAG通过基于流的剪枝有效减少冗余信息,同时利用路径提示引导LLM生成更逻辑、连贯的回答。实验表明,PathRAG在六个数据集和五个评估维度上持续优于现有最优基线。代码已公开于https://github.com/BUPT-GAMMA/PathRAG。

原文摘要 · Abstract (English)

Retrieval-augmented generation (RAG) improves the response quality of large language models (LLMs) by retrieving knowledge from external databases. Typical RAG approaches split the text database into chunks, organizing them in a flat structure for efficient searches. To better capture the inherent dependencies and structured relationships across the text database, researchers propose to organize textual information into an indexing graph, known asgraph-based RAG. However, we argue that the limitation of current graph-based RAG methods lies in the redundancy of the retrieved information, rather than its insufficiency. Moreover, previous methods use a flat structure to organize retrieved information within the prompts, leading to suboptimal performance. To overcome these limitations, we propose PathRAG, which retrieves key relational paths from the indexing graph, and converts these paths into textual form for prompting LLMs. Specifically, PathRAG effectively reduces redundant information with flow-based pruning, while guiding LLMs to generate more logical and coherent responses with path-based prompting. Experimental results show that PathRAG consistently outperforms state-of-the-art baselines across six datasets and five evaluation dimensions. The code is available at the following link: https://github.com/BUPT-GAMMA/PathRAG

知识图谱RAG推理增强

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。