cs.CLApr 8, 2026

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

Authors: Yixi Zhou, Fan Zhang, Zhiqiao Guo, Yu Chen, Haipeng Zhang, Preslav Nakov, Zhuohan Xie

Organizations: Hong Kong Baptist University · ShanghaiTech University · The University of Tokyo · University of Michigan · 

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/.

Figures & tables

Appendix figures & tables3 assets

Supplementary material from the paper’s appendix.

Appendix

Explore similar work

CardsList
  1. PExA: Parallel Exploration Agent for Complex Text-to-SQL

    Apr 24, 2026Tanmay Parekh, Ella Hofmann-Coyle, Shuyi Wang +3LLM Inference EfficiencyText-to-SQL

  2. PremiseSQL: Evaluating Premise Critique and Abstention in Text-to-SQL Systems

    Oct 15, 2026Shuo Lin, Jinzhe Li, Chenlu Guo +3Text-to-SQLText-to-SQL Evaluation

  3. Test-Time Verification for Text-to-SQL via Outcome Reward Models

    Jun 29, 2026Mattia Tritto, Giuseppe Farano, Dario Di Palma +4Reward ModelingLLM Answer Verification