mlsanityData to 14 Oct 2026

Fine-Tuning Language Models for Context-Specific SQL Query Generation

arXiv 2312.02251 ↗First posted 4 Dec 2023cs.DB cs.AI cs.CLcited by 3

Not on the map. Why?

Abstract (arXiv)

The ability to generate SQL queries from natural language has significant implications for making data accessible to non-specialists. This paper presents a novel approach to fine-tuning open-source large language models (LLMs) for the task of transforming natural language into SQL queries within the retail domain. We introduce models specialized in generating SQL queries, trained on synthetic datasets tailored to the Snowflake SQL and GoogleSQL dialects. Our methodology involves generating a context-specific dataset using GPT-4, then fine-tuning three open-source LLMs(Starcoder Plus, Code-Llama, and Mistral) employing the LoRa technique to optimize for resource constraints. The fine-tuned models demonstrate superior performance in zero-shot settings compared to the baseline GPT-4, with Code-Llama achieving the highest accuracy rates, at 81.58% for Snowflake SQL and 82.66% for GoogleSQL. These results underscore the effectiveness of fine-tuning LLMs on domain-specific tasks and suggest a promising direction for enhancing the accessibility of relational databases through natural language interfaces.

Key facts. Cited by 3 papers in the map (data through 14 Oct 2026). Builds on 14 of its 17 references that are in the map. First posted on arXiv 4 Dec 2023.

Builds on

14 of 17 references.

References · 14

  1. 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,599
  2. 2021Evaluating Large Language Models Trained on Codecited by 8,320
  3. 2022Emergent Abilities of Large Language Modelscited by 2,512
  4. 2018Spider: A Large-Scale Human-Labeled Dataset for Complex and Cross-Domain Semantic Parsing and Text-to-SQL Taskcited by 1,139
  5. 2023Can LLM Already Serve as A Database Interface? A BIg Bench for Large-Scale Database Grounded Text-to-SQLscited by 688
  6. 2017Seq2SQL: Generating Structured Queries from Natural Language using Reinforcement Learningcited by 687
  7. 2021PICARD: Parsing Incrementally for Constrained Auto-Regressive Decoding from Language Modelscited by 411
  8. 2023Text-to-SQL Empowered by Large Language Models: A Benchmark Evaluationcited by 385
  9. 2017SQLNet: Generating Structured Queries From Natural Language Without Reinforcement Learningcited by 135
  10. 2023A comprehensive evaluation of ChatGPT's zero-shot Text-to-SQL capabilitycited by 119
  11. 2018TypeSQL: Knowledge-based Type-Aware Neural Text-to-SQL Generationcited by 81
  12. 2020Grounded Adaptation for Zero-shot Executable Semantic Parsingcited by 76
2 more
  1. 2022A Survey on Text-to-SQL Parsing: Concepts, Methods, and Future Directionscited by 52
  2. 2017An Encoder-Decoder Framework Translating Natural Language to Database Queriescited by 23

Built on by

Cited by year

Citing papers per year: 2024: 1; 2025: 2.

3 papers.