arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2604.06736cs.CLcs.DB
收藏

SQLStructEval: 对LLM文本到SQL生成的结构评估

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

ShanghaiTech University(上海科技大学);The University of Tokyo(东京大学);MBZUAI(穆罕默德·本·扎耶德人工智能大学)

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

AI总结:

本文提出SQLStructEval框架,通过抽象语法树分析LLM生成的SQL查询结构,发现现代LLM在相同输入下生成的查询结构多样且易受输入变化影响,通过编译式流程提升执行准确性和结构一致性。

摘要:

尽管在文本到SQL基准测试中表现强劲,但LLM生成的SQL程序结构可靠性仍不明确。本文研究了LLM生成SQL查询的结构行为,引入SQLStructEval框架,通过规范化的抽象语法树(AST)表示分析程序结构。在Spider基准测试中,实验表明现代LLM在相同输入下常生成结构多样的查询,即使执行结果正确,这种差异常由表面输入变化如改写或模式呈现触发。进一步表明,通过编译式流程生成结构化查询可提升执行准确性和结构一致性。这些发现表明,结构可靠性是评估基于LLM的程序生成系统的重要但被忽视的维度。代码可在https://anonymous.4open.science/r/StructEval-2435获取。

英文摘要:

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

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑