Staged Multi‐Strategy Framework With Open‐Source Large Language Models for Natural Language to <scp>SQL</scp> Generation

In the field of natural language to SQL (NL2SQL), significant progress has been made with large pre‐trained language models. However, these models still have deficiencies in terms of their ability to generalize, particularly in open‐source Large Language Models (LLMs). Additionally, most research efforts tend to overlook the impact of key column information and data table content on the accuracy of queries during the SQL statement generation process. In this paper, we propose a staged, multi‐strategy framework called Key Columns and Table Contents (KCTC). The framework is divided into two stages. Firstly, it uses fixed prompt content to extract SQL key column information from natural language questions, including selected columns and conditioned columns. It also formats the output of column information. Secondly, it combines variable prompt content to guide the model in generating SQL statements. It uses the content of the data table for constraints to reduce the impact of errors in condition values on SQL statements. We conducted experiments on the Chinese dataset TableQA using several open‐source LLMs. The results demonstrate that our method significantly improved the execution accuracy of SQL statements, with an average increase of 60.29% and reaching up to 91.22% accuracy. This result validates the effectiveness of our approach. © 2025 Institute of Electrical Engineers of Japan and Wiley Periodicals LLC.

Authors

Institutions

Publication Details

Journal
IEEJ Transactions on Electrical and Electronic Engineering
Published
2025-01-10
DOI
https://doi.org/10.1002/tee.24268
Citations
1
Primary Topic
Topic Modeling
Type
article
Field-Weighted Citation Impact
2.48
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Staged Multi‐Strategy Framework With Open‐Source Large Language Models for Natural Language to SQL Generation

Wei Liao, Zhen Xu, Chuanlong Liu
1 citations
IEEJ Transactions on Electrical and Electronic Engineering
Topic Modeling
2.48
article

Staged Multi‐Strategy Framework With Open‐Source Large Language Models for Natural Language to SQL Generation

Wei Liao, Zhen Xu, Chuanlong Liu
article en
1 citations

Abstract

In the field of natural language to SQL (NL2SQL), significant progress has been made with large pre‐trained language models. However, these models still have deficiencies in terms of their ability to generalize, particularly in open‐source Large Language Models (LLMs). Additionally, most research efforts tend to overlook the impact of key column information and data table content on the accuracy of queries during the SQL statement generation process. In this paper, we propose a staged, multi‐strategy framework called Key Columns and Table Contents (KCTC). The framework is divided into two stages. Firstly, it uses fixed prompt content to extract SQL key column information from natural language questions, including selected columns and conditioned columns. It also formats the output of column information. Secondly, it combines variable prompt content to guide the model in generating SQL statements. It uses the content of the data table for constraints to reduce the impact of errors in condition values on SQL statements. We conducted experiments on the Chinese dataset TableQA using several open‐source LLMs. The results demonstrate that our method significantly improved the execution accuracy of SQL statements, with an average increase of 60.29% and reaching up to 91.22% accuracy. This result validates the effectiveness of our approach. © 2025 Institute of Electrical Engineers of Japan and Wiley Periodicals LLC.

IEEJ Transactions on Electrical and Electronic EngineeringVol. 20(7)
Shanghai University of Engineering Science (CN)
Quality Education
Openalex Percentile: Top 12%
Topic Modeling
2.48
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.