ExeSQL: Self-Taught Text-to-SQL Models with Execution-Driven Bootstrapping for SQL Dialects

Jipeng Zhang, Haolin Yang, Kehao Miao, Ruiyuan Zhang, Renjie Pi +2 more
5/22/2025
cs.CLcs.AIcs.DB

No official code found. Best implementation: 2003pro/exesql (12 stars, MIT, last commit 2025-12-21).

Abstract

Recent text-to-SQL models have achieved strong performance, but their effectiveness remains largely confined to SQLite due to dataset limitations. However, real-world applications require SQL generation across multiple dialects with varying syntax and specialized features, which remains a challenge for current models. The main obstacle in building a dialect-aware model lies in acquiring high-quality dialect-specific data. Data generated purely through static prompting - without validating SQLs via execution - tends to be noisy and unreliable. Moreover, the lack of real execution environments in the training loop prevents models from grounding their predictions in executable semantics, limiting generalization despite surface-level improvements from data filtering. This work introduces ExeSQL, a text-to-SQL framework with execution-driven, agentic bootstrapping. The method consists of iterative query generation, execution-based filtering (e.g., rejection sampling), and preference-based training, enabling the model to adapt to new SQL dialects through verifiable, feedback-guided learning. Experiments show that ExeSQL bridges the dialect gap in text-to-SQL, achieving average improvements of 15.2%, 10.38%, and 4.49% over GPT-4o on PostgreSQL, MySQL, and Oracle, respectively, across multiple datasets of varying difficulty.

View on arXivView PDF

Code Implementations(1)

2003pro/exesqlCommunity100%
MIT

This repository contains the official implementation of ExeSQL.

121PythonMay 21, 202510 months agoMIT

Cite this paper

@article{zhang2025exesql,
  title  = {ExeSQL: Self-Taught Text-to-SQL Models with Execution-Driven Bootstrapping for SQL Dialects},
  author = {Jipeng Zhang and Haolin Yang and Kehao Miao and Ruiyuan Zhang and Renjie Pi and Jiahui Gao and Xiaofang Zhou},
  year   = {2025},
  eprint = {2505.17231},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2505.17231v1}
}

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/2505.17231.svg)](https://codeofpaper.com/paper/2505.17231)

Discussion