Fine-Tuning Large Language Models for Text-to-SQL
In recent years, the integration of natural language processing (NLP) with database querying has led to the emergence of Text-to-SQL systems, which enable nontechnical users to interact with databases using natural language. While existing models, particularly those based on large language models (LLMs), have demonstrated remarkable generalization capabilities, they face challenges in generating complex multi-table and nested queries, as well as adapting to cross-domain tasks. This paper proposes a novel approach for Text-to-SQL tasks by utilizing supervised fine-tuning (SFT) on large language models. By leveraging high-quality annotated datasets, the proposed method significantly improves the accuracy of complex SQL generation and enhances cross-domain adaptability. Comprehensive evaluations on the Spider and CHASE datasets demonstrate that our approach achieves superior performance, with Exact Match (EM) scores of 36.5% and 45.5% for the deepseek-SQL and Qwen2.5-SQL models, respectively. The findings highlight the effectiveness of fine-tuning in optimizing LLMs for Text-to-SQL tasks, reducing inference costs, and bridging the gap between semantic parsing accuracy and real-world application requirements.
Authors
- Y. Sophia Dai (ORCID: https://orcid.org/0000-0002-7928-416X)
Institutions
- Jilin University of Finance and Economics (CN)
Publication Details
- Published
- 2025-05-23
- DOI
- https://doi.org/10.1109/icetci64844.2025.11084052
- Primary Topic
- Topic Modeling
- Type
- article
- Field-Weighted Citation Impact
- 0.00