Skip to main navigation Skip to search Skip to main content

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

  • Liang Yan
  • , Qichen Wan
  • , Chuanyi Liu*
  • , Shaoming Duan
  • , Peiyi Han
  • , Yong Xu
  • *Corresponding author for this work
  • Harbin Institute of Technology
  • Inspur Cloud Information Technology Co., Ltd.
  • Pengcheng Laboratory

Research output: Contribution to journalArticlepeer-review

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.

Original languageEnglish
Pages (from-to)45-51
Number of pages7
JournalPattern Recognition Letters
Volume196
DOIs
StatePublished - Oct 2025
Externally publishedYes

Keywords

  • In-context learning
  • Large language model
  • SQL synthesis
  • Text-to-SQL

Fingerprint

Dive into the research topics of 'SPS-SQL: Enhancing Text-to-SQL generation on small-scale LLMs with pre-synthesized queries'. Together they form a unique fingerprint.

Cite this