SQLMorph:面向Text-to-SQL评估的查询变异与细粒度指标 SQLMorph: Query Mutation and Fine-Grained Metrics for Text-to-SQL Evaluation 预印本

⚠️ 本文为 预印本(arXiv 公开版本),尚未经过正式同行评审。作者自发公开,结论未经期刊审稿验证,阅读时请知悉。
发布时间:2026-09-08
⬇️ 4 次下载
👁️ 预览文献
💡 AI 中文简介
Text-to-SQL系统能将自然语言问题转成SQL查询,但现有评测基准难以反映企业真实场景,且私有评测集成本高、不可复现。本文提出SQLMorph框架,通过两种查询变异技术自动生成和扩展评测集:连接查询扩展(JQE)系统性地增加连接结构复杂度,文本查询增强(TQA)生成受控的语言扰动以测试鲁棒性。同时提出执行精确率(EXP)和执行召回率(EXR)等细粒度指标,弥补传统二元执行准确率的不足。实验表明,JQE能揭示随连接数增加系统准确率下降,TQA显示重度缩写可导致准确率下降高达17%。
领域自然语言处理 / 数据库与信息检索(Text-to-SQL)
适合谁读需要一定专业背景(了解Text-to-SQL任务和SQL基础)
核心贡献1. 提出SQLMorph框架,通过连接查询扩展(JQE)和文本查询增强(TQA)自动生成和扩展Text-to-SQL评测集,无需人工标注且可复现;2. 定义执行精确率(EXP)和执行召回率(EXR)等细粒度指标,克服传统二元执行准确率的局限,支持过预测和欠预测分析。
关键数据TQA显示重度缩写可导致准确率下降高达17%;JQE增加查询覆盖并揭示准确率随连接数增加而下降;EXP和EXR能区分二元指标掩盖的系统差异。
推荐理由如果你关心Text-to-SQL系统在真实企业场景下的鲁棒性和评测可靠性,这篇论文提供了自动生成挑战性测试和细粒度诊断指标的新思路,值得一读。
关键词["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.