[Paper Review] Semantic Evaluation for Text-to-SQL with Distilled Test Suites
This paper proposes test suite accuracy as a reliable proxy for semantic accuracy in Text-to-SQL evaluation, using a distilled test suite of databases that achieve high code coverage by distinguishing neighbor queries—slightly modified versions of the gold query. The method reduces false negatives by 2.5% on average compared to the standard exact string match (ESM) metric, with 8.1% worst-case error, and is validated as correct on 100 manually verified examples.
We propose test suite accuracy to approximate semantic accuracy for Text-to-SQL models. Our method distills a small test suite of databases that achieves high code coverage for the gold query from a large number of randomly generated databases. At evaluation time, it computes the denotation accuracy of the predicted queries on the distilled test suite, hence calculating a tight upper-bound for semantic accuracy efficiently. We use our proposed method to evaluate 21 models submitted to the Spider leader board and manually verify that our method is always correct on 100 examples. In contrast, the current Spider metric leads to a 2.5% false negative rate on average and 8.1% in the worst case, indicating that test suite accuracy is needed. Our implementation, along with distilled test suites for eleven Text-to-SQL datasets, is publicly available.
Motivation & Objective
- To address the long-standing problem of unreliable semantic evaluation in Text-to-SQL, where exact string matching produces false negatives due to syntactic variation.
- To reduce false positives from single-database denotation evaluation by using a test suite that covers diverse query behaviors.
- To develop an efficient, scalable method to approximate semantic accuracy without requiring full equivalence checking across all possible databases.
- To create a high-coverage, compact test suite that can distinguish semantically incorrect predictions from the gold query with minimal computational cost.
- To provide a more accurate and reliable benchmark for evaluating Text-to-SQL models, especially as models produce increasingly complex and varied queries.
Proposed method
- Generate a large set of 1,000 random databases to serve as a fuzzing pool for testing query equivalence.
- Define neighbor queries as those differing from the gold query in only one syntactic component (e.g., a single WHERE condition), representing likely model errors.
- Select a small subset of databases from the pool that can distinguish all neighbor queries from the gold query, ensuring high code coverage.
- Formalize the search objective as maximizing the number of distinguishable neighbor queries to ensure test suite quality.
- Use the resulting distilled test suite to evaluate model predictions by measuring denotation accuracy across all test databases.
- Validate the method by comparing its judgments against manual verification on 100 model predictions where ESM and test suite accuracy disagree.
Experimental results
Research questions
- RQ1Can a small, automatically generated test suite of databases serve as an effective proxy for semantic accuracy in Text-to-SQL evaluation?
- RQ2How does test suite accuracy compare to exact string match (ESM) in terms of false negative rates across diverse model predictions?
- RQ3To what extent does test suite accuracy reflect true semantic equivalence, especially in cases where syntactic differences do not affect denotation?
- RQ4How well does the test suite capture code coverage of the gold query, and can it detect subtle semantic errors missed by ESM?
- RQ5Does the current ESM metric in Spider reliably reflect semantic accuracy, or does it systematically misrepresent model performance on complex queries?
Key findings
- Test suite accuracy reduces the false negative rate to 2.5% on average and 8.1% in the worst case, compared to the standard ESM metric.
- On 100 manually verified examples where ESM and test suite accuracy disagreed, test suite accuracy was correct in all cases, confirming its reliability.
- The ESM metric systematically underestimates model performance, particularly for models producing semantically correct but syntactically different queries.
- The ESM metric misrepresents state-of-the-art performance: a model with 61% semantic accuracy was undervalued by 8% under ESM, while five lower-performing models were favored.
- The discrepancy between ESM and semantic accuracy increases with query complexity, indicating that ESM becomes less reliable as models improve.
- The distilled test suite for Spider achieves over 99% coverage of neighbor queries, demonstrating high test quality and code coverage.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.