English

DataGpt-SQL-7B: An Open-Source Language Model for Text-to-SQL

Artificial Intelligence 2024-09-25 v1

Abstract

In addressing the pivotal role of translating natural language queries into SQL commands, we propose a suite of compact, fine-tuned models and self-refine mechanisms to democratize data access and analysis for non-expert users, mitigating risks associated with closed-source Large Language Models. Specifically, we constructed a dataset of over 20K sample for Text-to-SQL as well as the preference dateset, to improve the efficiency in the domain of SQL generation. To further ensure code validity, a code corrector was integrated into the model. Our system, DataGpt-sql, achieved 87.2\% accuracy on the spider-dev, respectively, showcasing the effectiveness of our solution in text-to-SQL conversion tasks. Our code, data, and models are available at \url{https://github.com/CainiaoTechAi/datagpt-sql-7b}

Keywords

Cite

@article{arxiv.2409.15985,
  title  = {DataGpt-SQL-7B: An Open-Source Language Model for Text-to-SQL},
  author = {Lixia Wu and Peng Li and Junhong Lou and Lei Fu},
  journal= {arXiv preprint arXiv:2409.15985},
  year   = {2024}
}
R2 v1 2026-06-28T18:55:11.474Z