让大模型精准查询图数据库,回答复杂知识图谱问题。
GraphRAFT: Retrieval Augmented Fine-Tuning for Knowledge Graphs on Graph Databases
- 用大模型自动生成准确的Cypher查询语句,从图数据库提取高质量子图。
- 在两个大型图文属性知识图谱上,四项指标均显著优于现有方法。
- 可直接部署于原生图数据库,适合需要高精度推理的工业场景。
大语言模型虽具备强大语言处理与推理能力,但在涉及私有数据时易产生幻觉。检索增强生成(RAG)通过检索相关数据放入上下文窗口来提升答案准确性。GraphRAG将此方法扩展至结构化知识图谱(KG),尤其适用于多跳实体查询。现有大多数GraphRAG方法忽略或采用低效、非标准化的检索流程,难以在支持图查询语言的原生图数据库中应用。本文提出GraphRAFT,一种检索-推理框架,通过微调大模型生成可证明正确的Cypher查询,以获取高质量子图上下文并生成准确答案。该方法是首个可即插即用、直接应用于原生图数据库的知识图谱检索方案。基准测试表明,其样本效率高,随训练数据增加而持续提升。在两个大规模文本属性知识图谱的问答任务中,四项标准指标均显著优于当前最优模型。
原文摘要 · Abstract (English)
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.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。