SQLStructEval: Structural Evaluation of LLM Text-to-SQL Generation

Yixi Zhou, Fan Zhang, Zhiqiao Guo, YU Chen, Haipeng Zhang, Preslav Nakov, Zhuohan Xie


Abstract
In Text-to-SQL tasks, large language models can generate structurally different SQL queries that return correct answers for the same intent. We call this phenomenon execution-correct structural divergence (ECSD). We introduce SQLStructEval, a framework that analyzes this behavior through canonical abstract syntax tree representations. We quantify structural diversity and agreement across generations. Experiments with different LLMs on multiple Text-to-SQL datasets, including Spider, document ECSD across models and datasets. Furthermore, our experiments demonstrate that generated queries are sensitive to question paraphrases and schema presentation. To address ECSD, we adopt a pipeline that first generates structured intermediate representations and then deterministically compiles them into SQL, improving execution accuracy and structural agreement among correct outputs. Structural analysis thus provides an additional diagnostic perspective that complements execution-based evaluation. Code is available at https://xanderzhou2022.github.io/AACL2026-SQLSTRUCTEVAL/.
Anthology ID:
2026.findings-aacl.122
Volume:
Findings of the Association for Computational Linguistics: IJCNLP-AACL 2026
Month:
November
Year:
2026
Address:
Hengqin, China
Editors:
Yue Zhang, Ruifeng Xu, Ayu Purwarianti, Tong Rong, Jun Suzuki
Venue:
Findings
SIG:
Publisher:
Association for Computational Linguistics
Note:
Pages:
2404–2422
Language:
URL:
https://aclanthology.org/2026.findings-aacl.122/
DOI:
Bibkey:
Cite (ACL):
Yixi Zhou, Fan Zhang, Zhiqiao Guo, YU Chen, Haipeng Zhang, Preslav Nakov, and Zhuohan Xie. 2026. SQLStructEval: Structural Evaluation of LLM Text-to-SQL Generation. In Findings of the Association for Computational Linguistics: IJCNLP-AACL 2026, pages 2404–2422, Hengqin, China. Association for Computational Linguistics.
Cite (Informal):
SQLStructEval: Structural Evaluation of LLM Text-to-SQL Generation (Zhou et al., Findings 2026)
Copy Citation:
PDF:
https://aclanthology.org/2026.findings-aacl.122.pdf