Skip to content
Conference

CypherSmith: Transforming Text-to-Cypher Generation for LLMs with Synthetic Data

2026 · Annual Meeting of the Association for Computational Linguistics · pp. 34665-34682 · 0 citations · 59 references
Computer Science

TL;DR

CypherSmith is introduced, an instruction-tuning dataset over 12 × larger than prior public Text-to-Cypher datasets, spanning diverse domains to better support LLM fine-tuning and introducing a novel likelihood-based filtering technique to ensure high-quality Text-to-Cypher data.

Abstract

Knowledge Graph (KG) retrieval is a promising augmentation to address knowledge gaps and hallucinations in LLMs. As KGs in practice are stored in graph databases (e.g., Wikidata, Freebase), accurate retrieval requires translating natural language questions into structured queries (query generation). A key challenge of query generation is Text-to-Cypher, which generates Cypher queries for property graphs (e.g., Neo4j), a paradigm increasingly adopted in industry for their scalable architectures and expressive schemas. However, compared to other query generation tasks such as Text-to-SQL or Text-to-SPARQL, Text-to-Cypher remains underexplored due to scarce public KGs and datasets. Existing datasets are small, domain-limited, and lack diversity, constraining LLM progress. To address this, we introduce CypherSmith, an instruction-tuning dataset over 12 × larger than prior public Text-to-Cypher datasets, spanning diverse domains to better support LLM fine-tuning. Our key distinction lies in fully leveraging open-source LLMs for large-scale synthetic data generation and introducing a novel likelihood-based filtering technique to ensure high-quality Text-to-Cypher data. Extensive experiments demonstrate the effectiveness of CypherSmith, achieving state-of-the-art LLM performance.

View source

Similar papers

Open access Jul 2026

Feedback-Guided Prompt Injection Defense in Retrieval-Augmented Text-to-Cypher Generation

A dynamic and self-corrective procedure with feedback-loop-based AI architecture with Large Language Models (LLMs) for near real-time validation and correction of generated queries and it is demonstrated that the proposed solution outperforms various training-free prompt injection defense methods.

Gergely Szlobodnyik · 1 citation · ⚡1
Open access 2026

Design and Evaluation of Large Language Model Approaches for Text2Cypher Generation in Domain-Specific Knowledge Graphs

A comparative study conducted within BMW AG, focusing on the application of LLM-based Text2Cypher generation for querying a domain-specific knowledge graph designed to support virtual product development, reveals that the primary challenge in industrial Text2Cypher generation lies in correctly interpreting domain-specific graph semantics, particularly relationship selection and graph traversal.

Carolin Lehmacher, Efe Kamasoglu, Kristin Paetzold-Byhain · 0 citations
Preprint Jul 2026

GGC: Selective Query Correction for Reliable Text-to-SPARQL Generation

Generator-Gate-Corrector (GGC), a framework for reliable LLM-based Text-to-SPARQL generation that enhances the accuracy, reliability, and efficiency of LLM-based text-to-SPARQL generation.

Ziyi Yang, Thanh-Son Nguyen, T. Nguyen et al. · 0 citations
Preprint Jul 2026

SQuaD-SQL: Efficient Text-to-SQL with Small Language Models via LLM-Guided Knowledge Distillation

SQuaD-SQL (Small-Qualified and Distilled for SQL), a novel approach that empowers small language models to approach the performance of LLMs on the Text-to-SQL task while significantly improving efficiency through knowledge distillation and synthetic data generation, is introduced.

Wangyu Wu, Xiaojian Lin, Rong Fu et al. · 0 citations
Preprint Jul 2026

MARS: Multi-hop Adaptive Retrieval and SPARQL Generation for KGQA

This work proposes MARS, a scalable knowledge graph question answering (KGQA) approach that requires no model fine-tuning, and performs a structured retrieval procedure that links question entities to the KG and iteratively retrieves relevant next-hop information.

Nikit Srivastava, Daniel Vollmers, René Speck et al. · 0 citations
Book Open access Aug 2026

TEFD: A Benchmark for Natural Language to Flux Query Generation in Time-Series Databases

The proliferation of IoT and real-time monitoring has established Time-Series Databases (TSDBs) like InfluxDB as critical infrastructure. However, their functional query languages (e.g., Flux) present a steep learning curve, hindering data accessibility for non-experts. While Natural Language Interfaces (NLIs) offer a potential solution, the domain of Text-to-Flux is stalled by a critical bottleneck: the complete absence of diverse, high-quality paired benchmarks. To address this, we introduce the Text-to-Flux task and propose FluxEngine, a novel automated pipeline for dataset construction. Unlike static generation methods used in Text-to-SQL, our framework features a Self-Sustaining Live Data Context that utilizes background tasks to perpetually generate fresh data, ensuring that queries involving relative time windows (e.g., ''past hour'') remain executable and valid indefinitely. Using this framework, we construct and release TEFD (Text-to-Flux Dataset), the first large-scale benchmark for this task. We further define execution-based evaluation metrics tailored for time-series validity. This work provides the essential infrastructure to foster future research in NLI for TSDBs. To facilitate reproducibility and future research, our dataset and benchmark code are publicly available at https://github.com/gta886/TEFD-Benchmark.

Xuefeng Wu, Yuanfeng Song, Jiawei Wen et al. · 0 citations