SQLMorph: Query Mutation and Fine-Grained Metrics for Text-to-SQL Evaluation

📄 arXiv: 2609.08950v1 📥 PDF

作者: Mohammadhossein Malekpour, Mohamed Riahi, Maxime Lamothe, Amine Mhedhbi

分类: cs.DB, cs.AI

发布日期: 2026-09-08

期刊: 2026 IEEE 42nd International Conference on Data Engineering (ICDE), pp. 2628-2640

DOI: 10.1109/ICDE65706.2026.00196


💡 一句话要点

提出SQLMorph以解决Text-to-SQL评估中的复杂性问题

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: Text-to-SQL 查询变异 评估框架 执行指标 自然语言处理 企业数据库 鲁棒性评估

📋 核心要点

  1. 现有的Text-to-SQL评估方法无法有效捕捉企业数据库的复杂性,导致评估结果难以重现。
  2. SQLMorph通过查询变异技术生成多样化的评估集,采用JQE和TQA来提高评估的全面性和鲁棒性。
  3. 实验结果表明,JQE能显著增加查询覆盖率,而TQA显示出语言简化对准确率的负面影响,最高可达17%的下降。

📝 摘要(中文)

SQLMorph是一个用于Text-to-SQL评估的框架,通过查询变异来解决现有评估方法的不足。现有公共基准未能捕捉企业模式的复杂性,构建私有评估集成本高且不可重复。SQLMorph引入了两种技术:连接查询扩展(JQE)和文本查询增强(TQA),前者通过有效的连接添加系统地增加结构复杂性,后者生成受控的自然语言扰动以评估对语言变化的鲁棒性。此外,SQLMorph还提出了一系列执行级别指标,克服了当前二元度量的局限性,支持更细致的调试和评估实践。

🔬 方法详解

问题定义:现有的Text-to-SQL评估方法在处理复杂企业模式时存在显著不足,公共基准无法反映真实场景的复杂性,私有评估集的构建成本高且结果不可重复。

核心思路:SQLMorph的核心思路是通过查询变异技术生成多样化的评估集,以便更全面地评估Text-to-SQL系统的性能,特别是在面对复杂查询时的表现。

技术框架:SQLMorph的整体框架包括两个主要模块:连接查询扩展(JQE)和文本查询增强(TQA)。JQE通过有效的连接添加来增加查询的结构复杂性,而TQA则通过生成自然语言的扰动来评估系统的鲁棒性。

关键创新:SQLMorph的主要创新在于引入了执行精度(EXP)和执行召回(EXR)等新的执行级别指标,这些指标能够更细致地分析系统的预测能力,克服了传统二元度量的局限性。

关键设计:在设计上,SQLMorph采用了灵活的参数设置和损失函数,以支持不同类型的查询变异,同时确保生成的评估集能够有效挑战系统的特定组件。

🖼️ 关键图片

fig_0
fig_1

📊 实验亮点

实验结果显示,JQE技术显著提高了查询覆盖率,并揭示了随着连接数量增加,系统准确率的下降趋势。同时,TQA的应用表明,语言简化可能导致准确率下降高达17%,这为系统的鲁棒性评估提供了新的视角。

🎯 应用场景

SQLMorph的研究成果在多个领域具有潜在应用价值,尤其是在企业数据分析、智能问答系统和数据库管理等场景中。通过提供更准确的评估手段,SQLMorph能够帮助开发者优化Text-to-SQL系统,提高其在实际应用中的表现和可靠性。

📄 摘要(原文)

Text-to-SQL systems translate natural language queries into executable SQL, democratizing access to structured data. Despite recent advances driven by large language models (LLMs), evaluation remains a major bottleneck: public benchmarks fail to capture the complexity of enterprise schema, while building private evaluation sets is costly and nondeterministic, making evaluation results difficult to reproduce. To address this issue, we present SQLMorph, a framework for Text-to-SQL evaluation via query mutation. SQLMorph introduces two techniques to automatically generate and expand evaluation sets: Join Query Expansion (JQE), which systematically increases structural complexity through valid join additions, and Textual Query Augmentation (TQA), which generates controlled natural language perturbations to assess robustness to linguistic variation. JQE and TQA create targeted choke points to challenge specific system components. When applied to state-of-the-art systems, JQE increases query coverage and reveals accuracy degradation as the number of joins grows. Meanwhile, TQA shows that linguistic brittleness induced by heavy abbreviation can reduce accuracy by up to 17%. Beyond evaluation sets, SQLMorph introduces a family of execution-level metrics that address the limitations of current binary measures, such as Execution Accuracy. We define Execution Precision (EXP) and Execution Recall (EXR) to quantify the fraction of correct and recovered results, respectively, and combine them via F1 for unified scoring. Our experiments show that these relaxed metrics enable fine-grained analysis of over- and under-prediction, revealing differences across systems that binary metrics obscure. Together, SQLMorph's query mutation and fine-grained metrics support debugging and better align Text-to-SQL evaluation practices with real-world deployments.