LR-SQL: A Supervised Fine-Tuning Method for Text2SQL Tasks Under Low-Resource Scenarios
Open Access
- 31 August 2025
- journal article
- research article
- Published by MDPI AG in Electronics
- Vol. 14 (17) , 3489
Abstract
In supervised fine-tuning (SFT) for Text2SQL tasks, particularly for databases with numerous tables, encoding schema features requires excessive tokens, escalating GPU resource requirements during fine-tuning. To bridge this gap, we propose LR-SQL, a general dual-model SFT framework comprising a schema linking model and an SQL generation model. At the core of our framework lies the schema linking model, which is trained on a novel downstream task termed slice-based related table filtering. This task dynamically partitions a database into adjustable slices of tables and sequentially evaluates the relevance of each slice to the input query, thereby reducing token consumption per iteration. However, slicing fragments destroys database information, impairing the model’s ability to comprehend the complete database. Thus, we integrate Chain of Thought (CoT) in training, enabling the model to reconstruct the full database context from discrete slices, thereby enhancing inference fidelity. Ultimately, the SQL generation model uses the result from the schema linking model to generate the final SQL. Extensive experiments demonstrate that our proposed LR-SQL reduces total GPU memory usage by 40% compared to baseline SFT methods, with only a 2% drop in table prediction accuracy for the schema linking task and a negligible 0.6% decrease in overall Text2SQL Execution Accuracy.Keywords
Funding Information
- National Natural Science Foundation of China (62071244)
This publication has 33 references indexed in Scilit:
- A Survey on Employing Large Language Models for Text-to-SQL TasksACM Computing Surveys, 2025
- Igniting Language Intelligence: The Hitchhiker’s Guide from Chain-of-Thought Reasoning to Language AgentsACM Computing Surveys, 2025
- Demonstration of DB-GPT: Next Generation Data Interaction System Empowered by Large Language ModelsProceedings of the VLDB Endowment, 2024
- CodeS: Towards Building Open-source Language Models for Text-to-SQLProceedings of the ACM on Management of Data, 2024
- Compressing Context to Enhance Inference Efficiency of Large Language Models2023
- CQR-SQL: Conversational Question Reformulation Enhanced Context-Dependent Text-to-SQL Parsers2022
- HIE-SQL: History Information Enhanced Network for Context-Dependent Text-to-SQL Semantic Parsing2022
- S2SQL: Injecting Syntax to Question-Schema Interaction Graph Encoder for Text-to-SQL Parsers2022
- The Power of Scale for Parameter-Efficient Prompt Tuning2021
- Prefix-Tuning: Optimizing Continuous Prompts for Generation2021