SQLMorph: Query Mutation and Fine-Grained Metrics for Text-to-SQL Evaluation
Mohammadhossein Malekpour, Mohamed Riahi, Maxime Lamothe, Amine Mhedhbi
Abstract
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.
Create a lesson
Related papers
A Fine-Grained Dichotomy for Bounded-Variable Query Evaluation: The Calculus of Relations, a Boolean Modal Logic, and One-Variable Counting Logic
Shared title terminology · Yoshiki Nakamura, Yuya Uezato
The Stochastic Shift: A New Evaluation Paradigm for Text-to-SQL with AI Operators
Shared title terminology · Tarfah Alrashed, Fatma Ozcan, Per Jacobsson et al.
SKYE: Write-Optimized Key-Value Store with Fine-Grained Control over Persistent Memory Accesses
Shared title terminology · Soujanya Ponnapalli, Sekwon Lee, Rohan Kadekodi et al.
AskWise: Execution-Guided Clarification of Intent and Data in Text-to-SQL
Shared title terminology · Yuru Liang, Guangyinan Mei, Miles Fan
MoL-SQL: A Controlled Benchmark for Mixture-of-Language Text-to-SQL
Shared title terminology · Tianqi Luo, Boyan Li, Yuyu Luo
Adaptive-Elbow Graph Traversal for Schema Retrieval in Text-to-SQL
Shared title terminology · Fabio Picariello, Salvatore Cipolla, Susanna Bonura et al.