SWE-SQL: Illuminating LLM Pathways to Solve User SQL Issues in Real-World Applications

Jinyang Li, Xiao-Long Li, Ge Qu, Per Jacobsson, Bo-Wen Qin +15 more
6/1/2025
21 citations

No official code found. Best implementation: bird-bench/BIRD-CRITIC-1 (1,104 stars, Python, MIT, last commit 2026-03-23).

Abstract

Resolution of complex SQL issues persists as a significant bottleneck in real-world database applications. Current Large Language Models (LLMs), while adept at text-to-SQL translation, have not been rigorously evaluated on the more challenging task of debugging SQL issues.

Show full abstract

To address this gap, we introduce BIRD-CRITIC, a new SQL issue debugging benchmark comprising 530 PostgreSQL tasks (BIRD-CRITIC-PG) and 570 multi-dialect tasks (BIRD-CRITIC-Multi), distilled from authentic user issues and replayed within new environments to facilitate rigorous evaluation. Baseline evaluations underscore the task's complexity, with the leading reasoning model O3-Mini achieving only 38.87% success rate on BIRD-CRITIC-PG and 33.33% on BIRD-CRITIC-Multi. Meanwhile, advancing open-source models for database tasks is crucial for empowering local development while safeguarding data privacy. Therefore, we present Six-Gym (Sql-fIX-Gym), a training environment for elevating open-source model capabilities for SQL issue debugging. This environment leverages SQL-Rewind strategy, which automatically generates executable issue-solution datasets by reverse-engineering issues from verified SQLs. However, popular trajectory-based fine-tuning methods do not explore substantial supervisory signals. We further propose f-Plan Boosting, which extracts high-level debugging plans from SQL solutions, enabling teacher LLMs to produce 73.7% more successful trajectories for training. We integrate these components into an open-source agent, Bird-Fixer. Based on Qwen-2.5-Coder-14B, Bird-Fixer achieves 38.11% success rate on BIRD-CRITIC-PG and 29.65% on BIRD-CRITIC-Multi, surpassing leading proprietary models such as Claude-3.7-Sonnet and GPT-4.1, marking a significant step toward democratizing sophisticated SQL-debugging capabilities. The leaderboard and source code are available: https://bird-critic.github.io/

View on arXivView PDF

Code Implementations(1)

MIT

[NeurIPS 2025 Main] SWE-SQL: Illuminating LLM Pathways to Solve User SQL Issues in Real-World Applications

1,10436Python, ShellJan 28, 20258 months agoMIT

Similar Papers

Cite this paper

@article{li2025swesql,
  title  = {SWE-SQL: Illuminating LLM Pathways to Solve User SQL Issues in Real-World Applications},
  author = {Jinyang Li and Xiao-Long Li and Ge Qu and Per Jacobsson and Bo-Wen Qin and Bin-Yuan Hui and Shu-Zheng Si and Nan Huo and Xiao-Han Xu and Yue Zhang and Zi-Wei Tang and Yuanshuai Li and Florensia Widjaja and Xin-Tong Zhu and Fei-Ge Zhou and Yong-Feng Huang and Y. Papakonstantinou and Fatma Özcan and Chen-Hao Ma and Reynold Cheng},
  year   = {2025},
  eprint = {2506.18951},
  archivePrefix = {arXiv},
  doi    = {10.48550/arXiv.2506.18951},
  url    = {https://doi.org/10.48550/arXiv.2506.18951},
  journal = {Neural Information Processing Systems}
}

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

Discussion