SPS-SQL: Enhancing Text-to-SQL generation on small-scale LLMs with pre-synthesized queries

Large Language Models (LLMs) have demonstrated strong performance in Text-to-SQL generation, converting natural language questions into SQL queries. While most researches focus on enhancing large LLMs like GPT-4 by OpenAI, small-scale open-source LLMs remain overlooked and underutilized. This paper introduces SPS-SQL, a novel lightweight approach designed to boost the Text-to-SQL accuracy on small-scale open-source LLMs. By leveraging semantic information to extract templates from training data , SPS-SQL pre-synthesizes queries based solely on schema information , which serve as few-shot examples to guide further SQL generation. SPS-SQL achieves execution accuracies on the Spider development and test set with Qwen 2.5 Coder (7 billion parameters) of 81.7% and 82.1%. Competitive results are seen on other LLMs as well, further emphasizing its flexibility and adaptability, significantly outperforming other methods on the same model. • Focus on improving Text-to-SQL accuracy on open-source small-scale LLMs. • Extract templates from prior SQL queries to synthesis new queries. • Pre-synthesis SQL queries with database schema as few-shot examples. • Achieve high execution accuracy on Spider dataset. • Improve accuracies of SQL generation on multiple small-scale LLMs.

Authors

Institutions

Publication Details

Journal
Pattern Recognition Letters
Published
2025-04-29
DOI
https://doi.org/10.1016/j.patrec.2025.04.016
Citations
1
Primary Topic
Semantic Web and Ontologies
Type
article
Field-Weighted Citation Impact
2.48
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

SPS-SQL: Enhancing Text-to-SQL generation on small-scale LLMs with pre-synthesized queries

Chuanyi Liu, Shaoming Duan, Yong Xu, Peiyi Han et al.
1 citations
Pattern Recognition Letters
Semantic Web and Ontologies
2.48
article

SPS-SQL: Enhancing Text-to-SQL generation on small-scale LLMs with pre-synthesized queries

Chuanyi Liu, Shaoming Duan, Yong Xu, Peiyi Han, Liang Yan, Qing Wan
article en
1 citations

Abstract

Large Language Models (LLMs) have demonstrated strong performance in Text-to-SQL generation, converting natural language questions into SQL queries. While most researches focus on enhancing large LLMs like GPT-4 by OpenAI, small-scale open-source LLMs remain overlooked and underutilized. This paper introduces SPS-SQL, a novel lightweight approach designed to boost the Text-to-SQL accuracy on small-scale open-source LLMs. By leveraging semantic information to extract templates from training data , SPS-SQL pre-synthesizes queries based solely on schema information , which serve as few-shot examples to guide further SQL generation. SPS-SQL achieves execution accuracies on the Spider development and test set with Qwen 2.5 Coder (7 billion parameters) of 81.7% and 82.1%. Competitive results are seen on other LLMs as well, further emphasizing its flexibility and adaptability, significantly outperforming other methods on the same model. • Focus on improving Text-to-SQL accuracy on open-source small-scale LLMs. • Extract templates from prior SQL queries to synthesis new queries. • Pre-synthesis SQL queries with database schema as few-shot examples. • Achieve high execution accuracy on Spider dataset. • Improve accuracies of SQL generation on multiple small-scale LLMs.

Pattern Recognition LettersVol. 196
Shenzhen Institute of Information Technology (CN), Harbin Institute of Technology (CN), Peng Cheng Laboratory (CN), Inspur (China) (CN), Cloud Computing Center (CN)
Quality Education
Openalex Percentile: Top 11%
Semantic Web and Ontologies
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.