用大模型自动生成高质量图数据库查询数据,提升文本转Cypher效果
Auto-Cypher: Improving LLMs on Cypher generation via LLM-supervised generation-verification framework
- 用大模型自动填充数据库生成正确查询语句
- 构建29.8万条合成数据,使模型性能提升40%
- 适合研究图数据库与自然语言交互的开发者
图数据库(如Neo4j)在处理复杂关联数据方面日益流行,优于传统关系型数据库。尽管自然语言转SQL已有深入研究,但文本转Cypher查询仍相对冷门。本文提出一种全自动的LLM监督生成-验证框架,用于生成高质量的合成文本转Cypher数据。该框架引入创新策略LLM-As-Database-Filler,确保生成的Cypher查询正确性,从而产出高质量数据集SynthCypher,包含29.8万条跨领域、多复杂度的实例。在SynthCypher上训练开源大模型(如LLaMa-3.1-8B、Mistral-7B、QWEN-7B),使其在Text2Cypher测试集上性能提升达40%,在适配为图数据库的SPIDER基准上提升30%。
原文摘要 · Abstract (English)
Graph databases like Neo4j are gaining popularity for handling complex, interconnected data, over traditional relational databases in modeling and querying relationships. While translating natural language into SQL queries is well-researched, generating Cypher queries for Neo4j remains relatively underexplored. In this work, we present an automated, LLM-Supervised, pipeline to generate high-quality synthetic data for Text2Cypher. Our Cypher data generation pipeline introduces LLM-As-Database-Filler, a novel strategy for ensuring Cypher query correctness, thus resulting in high quality generations. Using our pipeline, we generate high quality Text2Cypher data - SynthCypher containing 29.8k instances across various domains and queries with varying complexities. Training open-source LLMs like LLaMa-3.1-8B, Mistral-7B, and QWEN-7B on SynthCypher results in performance gains of up to 40% on the Text2Cypher test split and 30% on the SPIDER benchmark, adapted for graph databases.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。