SQL Statement Generation Enhanced Through the Fusion of Large Language Models and Knowledge Graphs

Current mainstream SQL generation approaches remain insufficient in capturing the semantic information of structured data and handling complex query tasks. To address the challenges of hallucination and accuracy degradation in large language model (LLM)-based SQL generation, this paper proposes an enhanced SQL generation framework that integrates knowledge graphs with large language models. The proposed method introduces an SQL-KG-Verifier module, which synergizes the structured information of knowledge graphs with the generative capabilities of LLMs. By incorporating the verifier, the framework collaboratively refines SQL statements to ensure higher structural consistency, improved accuracy, and enhanced interpretability. Specifically, the verifier employs the entities and relational information retrieved from the knowledge graph as proxies to validate and revise the model outputs, effectively reducing generation errors. Experimental results demonstrate that on the BIRD and Spider datasets, the proposed method achieves execution accuracies of 52.71% and 77.26%, respectively—representing improvements of 19.93 and 21.27 percentage points over baseline models. Moreover, the approach exhibits superior adaptability and generation performance in complex and domain-specific query scenarios.

Authors

Institutions

Publication Details

Journal
Electronics
Published
2026-01-07
DOI
https://doi.org/10.3390/electronics15020278
Primary Topic
Topic Modeling
Type
article
Field-Weighted Citation Impact
0.00

Funders

Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

SQL Statement Generation Enhanced Through the Fusion of Large Language Models and Knowledge Graphs

Xuhong Yu, Xin Zheng, Bohan Wang
Electronics
Topic Modeling
article

SQL Statement Generation Enhanced Through the Fusion of Large Language Models and Knowledge Graphs

Xuhong Yu, Xin Zheng, Bohan Wang
article en

Abstract

Current mainstream SQL generation approaches remain insufficient in capturing the semantic information of structured data and handling complex query tasks. To address the challenges of hallucination and accuracy degradation in large language model (LLM)-based SQL generation, this paper proposes an enhanced SQL generation framework that integrates knowledge graphs with large language models. The proposed method introduces an SQL-KG-Verifier module, which synergizes the structured information of knowledge graphs with the generative capabilities of LLMs. By incorporating the verifier, the framework collaboratively refines SQL statements to ensure higher structural consistency, improved accuracy, and enhanced interpretability. Specifically, the verifier employs the entities and relational information retrieved from the knowledge graph as proxies to validate and revise the model outputs, effectively reducing generation errors. Experimental results demonstrate that on the BIRD and Spider datasets, the proposed method achieves execution accuracies of 52.71% and 77.26%, respectively—representing improvements of 19.93 and 21.27 percentage points over baseline models. Moreover, the approach exhibits superior adaptability and generation performance in complex and domain-specific query scenarios.

ElectronicsVol. 15(2)
Guizhou Normal University (CN)
National Natural Science Foundation of China
Openalex Percentile: Top 96%
Topic Modeling
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

SQL Statement Generation Enhanced Through the Fusion of Large Language Models and Knowledge Graphs — Xuhong Yu, Xin Zheng, et al. · Electronics (2026) | TGRS Research Map | TGRS