Text-to-SQL Domain Adaptation via Human-LLM Collaborative Data Annotation

Yuan Tian, Daniel Lee, Fei Wu, Tung Mai, Kun Qian +3 more
2/21/2025
cs.HCcs.AIcs.DB

Official code: magic-YuanTian/SQLsynth (6 stars, last commit 2026-04-24).

Abstract

Text-to-SQL models, which parse natural language (NL) questions to executable SQL queries, are increasingly adopted in real-world applications. However, deploying such models in the real world often requires adapting them to the highly specialized database schemas used in specific applications. We find that existing text-to-SQL models experience significant performance drops when applied to new schemas, primarily due to the lack of domain-specific data for fine-tuning. This data scarcity also limits the ability to effectively evaluate model performance in new domains. Continuously obtaining high-quality text-to-SQL data for evolving schemas is prohibitively expensive in real-world scenarios. To bridge this gap, we propose SQLsynth, a human-in-the-loop text-to-SQL data annotation system. SQLsynth streamlines the creation of high-quality text-to-SQL datasets through human-LLM collaboration in a structured workflow. A within-subjects user study comparing SQLsynth with manual annotation and ChatGPT shows that SQLsynth significantly accelerates text-to-SQL data annotation, reduces cognitive load, and produces datasets that are more accurate, natural, and diverse. Our code is available at https://github.com/magic-YuanTian/SQLsynth.

View on arXivView PDF

Code Implementations(1)

60CSS, HTMLNov 8, 20255 months ago

Similar Papers

Cite this paper

@article{tian2025texttosql,
  title  = {Text-to-SQL Domain Adaptation via Human-LLM Collaborative Data Annotation},
  author = {Yuan Tian and Daniel Lee and Fei Wu and Tung Mai and Kun Qian and Siddhartha Sahai and Tianyi Zhang and Yunyao Li},
  year   = {2025},
  eprint = {2502.15980},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2502.15980v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2502.15980.svg)](https://codeofpaper.com/paper/2502.15980)

Discussion