SDE-SQL: Enhancing Text-to-SQL Generation in Large Language Models via Self-Driven Exploration with SQL Probes
Paper · 2026 · Wenxuan Xie, Yaxun Dai and Wenhao Jiang
Summary
Most LLM-based Text-to-SQL systems receive a fixed snapshot of database information prepared before inference. The model cannot look at the actual data itself, so it often misreads values, joins or filters. SDE-SQL addresses this by letting the LLM explore the database on its own. It writes and runs auxiliary queries, called SQL Probes, and uses their outputs as evidence.
The pipeline has three stages:
- Schema linking: entity-based, with value retrieval and soft linking.
- Generation: a two-phase exploration step before writing SQL.
- Refinement: queries that fail are fixed from the error message. Queries that return nothing are diagnosed using the results of decomposed sub-queries, and then candidate fixes are tested with targeted probes.
The method is zero-shot and needs no demonstrations or question–SQL pairs. With Qwen2.5-72B-Instruct, it reaches the best BIRD result among open-source approaches that use neither SFT nor ensembling. A small module-level fine-tuning dataset adds further gains. The work shows that treating SQL execution as an interactive tool can narrow the gap to human experts.
Key points
- BIRD dev execution accuracy: 67.67% zero-shot with Qwen2.5-72B-Instruct, an 8.02% relative gain over the vanilla model. With SFT of the explorer and generator modules, accuracy rises to 68.19%.
- Spider: 87.3 dev / 88.3 test EX, or 87.5 / 88.5 with SFT. The vanilla Qwen2.5-72B-Instruct scores 73.9 / 84.0.
- Latency: about 35.19 s per instance on BIRD-dev (1,534 questions, vLLM, local deployment). Pre-generation exploration takes the largest share (~18 s), and runtime grows with question difficulty. On a sampled subset, SDE-SQL is faster than MAG-SQL and CHESS.
- Ablations: both exploration phases contribute the largest improvements.
- Limitations and availability: exploration depends entirely on hand-written prompts, and the authors propose reinforcement learning as future work. Code is available at github.com/Lancelot-Xie/SDE-SQL.
Institutions
Fields, topics and concepts
📚 Shelves 5The field of science this work belongs to (OpenAlex fields).Computer Science · 16,667 worksArtificial Intelligence · 16,194 worksArts and Humanities · 16,039 worksLanguage and Linguistics · 15,891 worksComputer Vision and Pattern Recognition · 2,869 works
🧭 Topics 3Research subjects and languages the work is about.Language models & pretraining · 3,320 worksSemantic parsing & meaning representation · 185 worksCode & programming languages · 129 works
Cite
Cite as Wenxuan Xie, Yaxun Dai and Wenhao Jiang. 2026. SDE-SQL: Enhancing Text-to-SQL Generation in Large Language Models via Self-Driven Exploration with SQL Probes. Proceedings of the 64th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers).
@inproceedings{xie2026sde,
title = {{SDE-SQL: Enhancing Text-to-SQL Generation in Large Language Models via Self-Driven Exploration with SQL Probes}},
author = {Wenxuan Xie, Yaxun Dai and Wenhao Jiang},
booktitle = {Proceedings of the 64th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)},
year = {2026},
doi = {10.18653/v1/2026.acl-long.116},
url = {https://doi.org/10.18653/v1/2026.acl-long.116}
}References
- Ruichu Cai, Jinjie Yuan, Boyan Xu, and Zhifeng Hao. 2021. Sadga: Structure-aware dual graph aggregation network for text-to-sql. In Advances in Neural Information Processing Systems, volume 34, pages 7664–7676. Curran Associates, Inc. find
- Ruisheng Cao, Lu Chen, Zhi Chen, Yanbin Zhao, Su Zhu, and Kai Yu. 2021. LGESQL: Line graph enhanced text-to-SQL model with mixed local and non-local relations. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Na…
- Xiaojun Chen, Tianle Wang, Tianhao Qiu, Jianbin Qin, and Min Yang. 2024. Open-sql framework: Enhancing text-to-sql on open-source large language models. arXiv preprint arXiv:2405.06674. — [arXiv:2405.06674](https://arxiv.org/abs/2405.06674) find
- DongHyun Choi, Myeong Cheol Shin, EungGyun Kim, and Dong Ryeol Shin. 2021. RYANSQL: Recursively applying sketch-based slot fillings for complex text-to-SQL in cross-domain databases. Computational Linguistics, 47(2):309–332.
- Yaxun Dai, Wenxuan Xie, Xialie Zhuang, Tianyu Yang, Yiying Yang, Haiqin Yang, Yuhang Zhao, Pingfu Chao, and Wenhao Jiang. 2025a. Reex-sql: Reasoning with execution-aware reinforcement learning for text-to-sql. CoRR, abs/2505.12768. find
- Yaxun Dai, Haiqin Yang, Mou Hao, and Pingfu Chao. 2025b. PARSQL: Enhancing text-to-SQL through SQL parsing and reasoning. In Findings of the Association for Computational Linguistics: ACL 2025, pages 661–681, Vienna, Austria. Association for Computational Linguistics. find
- Mingwen Dong, Nischal Ashok Kumar, Yiqun Hu, Anuj Chauhan, Chung-Wei Hang, Shuaichen Chang, Lin Pan, Wuwei Lan, Henghui Zhu, Jiarong Jiang, Patrick Ng, and Zhiguo Wang. 2025. PRACTIQ: A practical conversational text-to-SQL dataset with ambiguous and unanswerable queries. In Proceedings of the 2025 C…
- Dawei Gao, Haibin Wang, Yaliang Li, Xiuyu Sun, Yichen Qian, Bolin Ding, and Jingren Zhou. 2024. Text-to-sql empowered by large language models: A benchmark evaluation. Proc. VLDB Endow., 17(5):1132–1145.
- Pushpendu Ghosh, Aryan Jain, and Promod Yenigalla. 2025. SQLGenie: A practical LLM based system for reliable and efficient SQL generation. In Proceedings of the 63rd Annual Meeting of the Association for Computational Linguistics (Volume 6: Industry Track), pages 1004–1012, Vienna, Austria. Associat… find
- Jiaqi Guo, Zecheng Zhan, Yan Gao, Yan Xiao, Jian-Guang Lou, Ting Liu, and Dongmei Zhang. 2019. Towards complex text-to-SQL in cross-domain database with intermediate representation. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 4524–4535, Florence,… find
- Zijin Hong, Zheng Yuan, Hao Chen, Qinggang Zhang, Feiran Huang, and Xiao Huang. 2024. Knowledge-to-SQL: Enhancing SQL generation with data expert LLM. In Findings of the Association for Computational Linguistics: ACL 2024, pages 10997–11008, Bangkok, Thailand. Association for Computational Linguisti… find
- Binyuan Hui, Xiang Shi, Ruiying Geng, Binhua Li, Yongbin Li, Jian Sun, and Xiaodan Zhu. 2021. Improving text-to-sql with schema dependency learning. arXiv preprint arXiv:2103.04399. — [arXiv:2103.04399](https://arxiv.org/abs/2103.04399) find
- Wonseok Hwang, Jinyeong Yim, Seunghyun Park, and Minjoon Seo. 2019. A comprehensive exploration on wikisql with table-aware word contextualization. arXiv preprint arXiv:1902.01069. find
- Dongjun Lee, Choongwon Park, Jaehyuk Kim, and Heesoo Park. 2025. MCS-SQL: Leveraging multiple prompts and multiple-choice selection for text-to-SQL generation. In Proceedings of the 31st International Conference on Computational Linguistics, pages 337–353, Abu Dhabi, UAE. Association for Computation…
- Fangyu Lei, Jixuan Chen, Yuxiao Ye, Ruisheng Cao, Dongchan Shin, Hongjin SU, Zhaoqing Suo, Hongcheng Gao, Wenjing Hu, Pengcheng Yin, Victor Zhong, Caiming Xiong, Ruoxi Sun, Qian Liu, Sida Wang, and Tao Yu. 2025. Spider 2.0: Evaluating language models on real-world enterprise text-to-sql workflows. I… find
- Haoyang Li, Jing Zhang, Hanbing Liu, Ju Fan, Xiaokang Zhang, Jun Zhu, Renjie Wei, Hongyan Pan, Cuiping Li, and Hong Chen. 2024. Codes: Towards building open-source language models for text-to-sql. Proc. ACM Manag. Data, 2(3). find
- Jinyang Li, Binyuan Hui, Ge Qu, Jiaxi Yang, Binhua Li, Bowen Li, Bailin Wang, Bowen Qin, Ruiying Geng, Nan Huo, Xuanhe Zhou, Chenhao Ma, Guoliang Li, Kevin C.C. Chang, Fei Huang, Reynold Cheng, and Yongbin Li. 2023. Can llm already serve as a database interface? a big bench for large-scale database…
- Xiping Liu and Zhao Tan. 2023. Divide and prompt: Chain of thought prompting for text-to-sql. arXiv preprint arXiv:2304.11556. — [arXiv:2304.11556](https://arxiv.org/abs/2304.11556) find
- Yifu Liu, Yin Zhu, Yingqi Gao, Zhiling Luo, Xiaoxia Li, Xiaorong Shi, Yuntao Hong, Jinyang Gao, Yu Li, Bolin Ding, and Jingren Zhou. 2026. Xiyan-sql: A novel multi-generator framework for text-to-sql. IEEE Transactions on Knowledge and Data Engineering, 38(4):2474–2487. find
- OpenAI. 2024. Gpt-4o system card. abs/2410.21276.
- CoRR, Mohammadreza Pourreza, Hailong Li, Ruoxi Sun, Yeounoh Chung, Shayan Talaei, Gaurav Tarlok Kakkar, Yu Gan, Amin Saberi, Fatma Ozcan, and Sercan Arik. 2025. Chase-sql: Multi-path reasoning and preference optimized candidate selection in text-to-sql. In International Conference on Learning Repres… find
- Mohammadreza Pourreza and Davood Rafiei. 2023. Din-sql: Decomposed in-context learning of text-to-sql with self-correction. In Advances in Neural Information Processing Systems, volume 36, pages 36339–36348. Curran Associates, Inc.
- Mohammadreza Pourreza and Davood Rafiei. 2024. DTS-SQL: Decomposed text-to-SQL with small large language models. In Findings of the Association for Computational Linguistics: EMNLP 2024, pages 8212–8220, Miami, Florida, USA. Association for Computational Linguistics. find
- Mohammadreza Pourreza, Ruoxi Sun, Hailong Li, Lesly Miculicich, Tomas Pfister, and Sercan O Arik. 2024. Sql-gen: Bridging the dialect gap for text-to-sql via synthetic data and model merging. arXiv preprint arXiv:2408.12733. — [arXiv:2408.12733](https://arxiv.org/abs/2408.12733) find
- Nitarshan Rajkumar, Raymond Li, and Dzmitry Bahdanau. 2022. Evaluating the text-to-sql capabilities of large language models. arXiv preprint arXiv:2204.00498. find
- Jiawei Shen, Chengcheng Wan, Ruoyi Qiao, Jiazhen Zou, Hang Xu, Yuchen Shao, Yueling Zhang, Weikai Miao, and Geguang Pu. 2025. A study of in-context-learning-based text-to-sql errors. arXiv preprint arXiv:2501.09310. — [arXiv:2501.09310](https://arxiv.org/abs/2501.09310) find
- Ruoxi Sun, Sercan O Arik, Alexandre Muzio, Lesly Miculicich, Satya Kesav Gundabathula, Pengcheng Yin, Hanjun Dai, Hootan Nakhost, Rajarishi Sinha, Zifeng Wang, and Tomas Pfister. 2024. SQL-paLM: Improved large language model adaptation for text-to-SQL. Transactions on Machine Learning Research. find
- Chang-Yu Tai, Ziru Chen, Tianshu Zhang, Xiang Deng, and Huan Sun. 2023. Exploring chain of thought style prompting for text-to-SQL. In Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing, pages 5376–5393, Singapore. Association for Computational Linguistics. find
- Shayan Talaei, Mohammadreza Pourreza, Yu-Chen Chang, Azalia Mirhoseini, and Amin Saberi. 2024. Chess: Contextual harnessing for efficient sql synthesis. arXiv preprint arXiv:2405.16755. — [arXiv:2405.16755](https://arxiv.org/abs/2405.16755) find
- Bailin Wang, Richard Shin, Xiaodong Liu, Oleksandr Polozov, and Matthew Richardson. 2020. RAT-SQL: Relation-aware schema encoding and linking for text-to-SQL parsers. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 7567–7578, Online. Association for…
- Bing Wang, Yan Gao, Zhoujun Li, and Jian-Guang Lou. 2023. Know what I don’t know: Handling ambiguous and unknown questions for text-to-SQL. In Findings of the Association for Computational Linguistics: ACL 2023, pages 5701–5714, Toronto, Canada. Association for Computational Linguistics. find
- Bing Wang, Changyu Ren, Jian Yang, Xinnian Liang, Jiaqi Bai, LinZheng Chai, Zhao Yan, Qian-Wen Zhang, Di Yin, Xing Sun, and Zhoujun Li. 2025. MAC-SQL: A multi-agent collaborative framework for text-to-SQL. In Proceedings of the 31st International Conference on Computational Linguistics, pages 540– 5…
- Jason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma, brian ichter, Fei Xia, Ed Chi, Quoc V Le, and Denny Zhou. 2022. Chain-of-thought prompting elicits reasoning in large language models. In Advances in Neural Information Processing Systems, volume 35, pages 24824–24837. Curran Associates, Inc.
- Wenxuan Xie, Gaochen Wu, and Bowen Zhou. 2024. Mag-sql: Multi-agent generative approach with soft schema linking and iterative sub-sql refinement for text-to-sql. arXiv preprint arXiv:2408.07930. — [arXiv:2408.07930](https://arxiv.org/abs/2408.07930) find
- Xiaojun Xu, Chang Liu, and Dawn Song. 2017. Sqlnet: Generating structured queries from natural language without reinforcement learning. arXiv preprint arXiv:1711.04436. find
- An Yang, Baosong Yang, Beichen Zhang, Binyuan Hui, Bo Zheng, Bowen Yu, Chengyuan Li, Dayiheng Liu, Fei Huang, Haoran Wei, Huan Lin, Jian Yang, Jianhong Tu, Jianwei Zhang, Jianxin Yang, Jiaxi Yang, Jingren Zhou, Junyang Lin, Kai Dang, Keming Lu, Keqin Bao, Kexin Yang, Le Yu, Mei Li, Mingfeng Xue, Pei… find
- Tao Yu, Rui Zhang, Kai Yang, Michihiro Yasunaga, Dongxu Wang, Zifan Li, James Ma, Irene Li, Qingning Yao, Shanelle Roman, Zilin Zhang, and Dragomir Radev. 2018. Spider: A large-scale human-labeled dataset for complex and cross-domain semantic parsing and text-to-SQL task. In Proceedings of the 2018…
- John M. Zelle and Raymond J. Mooney. 1996. Learning to parse database queries using inductive logic programming. In Proceedings of the Thirteenth National Conference on Artificial Intelligence - Volume 2, AAAI’96, pages 1050–1055. AAAI Press.
- Hanchong Zhang, Ruisheng Cao, Hongshen Xu, Lu Chen, and Kai Yu. 2024a. CoE-SQL: In-context learning for multi-turn text-to-SQL with chain-of-editions. In Proceedings of the 2024 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies (Vo… find
- Tingkai Zhang, Chaoyu Chen, Cong Liao, Jun Wang, Xudong Zhao, Hang Yu, Jianchao Wang, Jianguo Li, and Wenhui Shi. 2024b. Sqlfuse: Enhancing text-to-sql performance through comprehensive llm synergy. arXiv preprint arXiv:2407.14568. — [arXiv:2407.14568](https://arxiv.org/abs/2407.14568) find
- D • SELECT T2.name FROM orders AS T1 JOIN customers AS T2 ON T1.id = T2.id • SELECT T2.name FROM orders AS T1 JOIN customers AS T2 ON T1.id = T2.id WHERE T1.order_date \> '2023-01-01' • SELECT T2.name FROM orders AS T1 JOIN customers AS T2 ON T1.id = T2.id WHERE T2.customer_id = 100 • SELECT T2.name… find
Updated
This page in Markdown → https://md.research.elamur.ai/free/en/papers/xie-2026-sde-sql-enhancing-text-sql/