GraphRAFT: Retrieval Augmented Fine-Tuning for Knowledge Graphs on Graph Databases
Alfred Clemedtson, Borun Shi
TL;DR
GraphRAFT tackles hallucination and inefficiency in knowledge-graph QA by merging retrieval-augmented LLMs with native graph database querying. It learns to synthesize executable Cypher queries that fetch compact subgraphs and employs a second LLM to reason over the subgraph to yield accurate answers, all within a constrained decoding framework that guarantees syntactic and semantic correctness. The approach is modular and readily applicable to any KG stored in a graph DB, achieving state-of-the-art results on STaRK-prime and STaRK-mag with sample-efficient training. This work enables scalable, faithful KBQA over large, text-rich KGs using off-the-shelf components and graph-query engines, with demonstrated practical benefits for private domain graphs.
Abstract
Large language models have shown remarkable language processing and reasoning ability but are prone to hallucinate when asked about private data. Retrieval-augmented generation (RAG) retrieves relevant data that fit into an LLM's context window and prompts the LLM for an answer. GraphRAG extends this approach to structured Knowledge Graphs (KGs) and questions regarding entities multiple hops away. The majority of recent GraphRAG methods either overlook the retrieval step or have ad hoc retrieval processes that are abstract or inefficient. This prevents them from being adopted when the KGs are stored in graph databases supporting graph query languages. In this work, we present GraphRAFT, a retrieve-and-reason framework that finetunes LLMs to generate provably correct Cypher queries to retrieve high-quality subgraph contexts and produce accurate answers. Our method is the first such solution that can be taken off-the-shelf and used on KGs stored in native graph DBs. Benchmarks suggest that our method is sample-efficient and scales with the availability of training data. Our method achieves significantly better results than all state-of-the-art models across all four standard metrics on two challenging Q&As on large text-attributed KGs.
