SimGRAG: Leveraging Similar Subgraphs for Knowledge Graphs Driven Retrieval-Augmented Generation

Yuzheng Cai, Zhenyue Guo, Yiwen Pei, Wanrui Bian, Weiguo Zheng
12/17/2024
cs.CLcs.AIcs.IR

Official code: YZ-Cai/SimGRAG (142 stars, last commit 2025-07-25).

Abstract

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.

View on arXivView PDF

Code Implementations(1)

YZ-Cai/SimGRAGOfficial100%

Official code of the ACL 2025 paper "SimGRAG: Leveraging Similar Subgraphs for Knowledge Graphs Driven Retrieval-Augmented Generation"

14222Shell, PythonDec 16, 20241 years ago
kgkgqaknowledge-graphlarge-language-modelllm+2 more

Similar Papers

Cite this paper

@article{cai2024simgrag,
  title  = {SimGRAG: Leveraging Similar Subgraphs for Knowledge Graphs Driven Retrieval-Augmented Generation},
  author = {Yuzheng Cai and Zhenyue Guo and Yiwen Pei and Wanrui Bian and Weiguo Zheng},
  year   = {2024},
  eprint = {2412.15272},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2412.15272v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2412.15272.svg)](https://codeofpaper.com/paper/2412.15272)

Discussion