通过相似子图匹配提升知识图谱增强生成的准确性
SimGRAG: Leveraging Similar Subgraphs for Knowledge Graphs Driven Retrieval-Augmented Generation
- 将查询转为图模式,再用语义距离找最匹配的子图
- 在千万级知识图谱上1秒内检索出前k个最优子图
- 适合需要精准知识推理的问答与事实验证任务
大型语言模型在多项任务中表现出色,但存在幻觉问题。为解决此问题,检索增强生成(RAG)借助知识图谱(KG)等外部知识源成为有效方法。本文研究基于知识图谱的RAG任务,提出一种新型相似图增强检索增强生成方法(SimGRAG)。该方法通过两阶段流程:(1) 查询到模式,利用大语言模型将查询转化为期望的图结构模式;(2) 模式到子图,采用图语义距离(GSD)度量模式与候选子图之间的对齐程度。我们还设计了一种优化的检索算法,在1000万规模的知识图谱上可在1秒内完成前k个子图的检索。大量实验表明,SimGRAG在问答和事实验证任务中均优于现有先进方法。代码已开源:https://github.com/YZ-Cai/SimGRAG。
原文摘要 · Abstract (English)
Recent advancements in large language models (LLMs) have shown impressive versatility across various tasks. To eliminate their hallucinations, retrieval-augmented generation (RAG) has emerged as a powerful approach, leveraging external knowledge sources like knowledge graphs (KGs). In this paper, we study the task of KG-driven RAG and propose a novel Similar Graph Enhanced Retrieval-Augmented Generation (SimGRAG) method. It effectively addresses the challenge of aligning query texts and KG structures through a two-stage process: (1) query-to-pattern, which uses an LLM to transform queries into a desired graph pattern, and (2) pattern-to-subgraph, which quantifies the alignment between the pattern and candidate subgraphs using a graph semantic distance (GSD) metric. We also develop an optimized retrieval algorithm that efficiently identifies the top-k subgraphs within 1-second on a 10-million-scale KG. Extensive experiments show that SimGRAG outperforms state-of-the-art KG-driven RAG methods in both question answering and fact verification. Our code is available at https://github.com/YZ-Cai/SimGRAG.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。