Abstract
Text-to-SQL semantic parsing has made significant progress in recent years, with various models demonstrating impressive performance on the challenging Spider benchmark. However, it has also been shown that these models often struggle to generalize even when faced with small perturbations of previously (accurately) parsed expressions. This is mainly due to the linguistic form of questions in Spider which are overly specific, unnatural, and display limited variation. In this work, we use data augmentation to enhance the robustness of text-to-SQL parsers against natural language variations. Existing approaches generate question reformulations either via models trained on Spider or only introduce local changes. In contrast, we leverage the capabilities of large language models to generate more realistic and diverse questions. Using only a few prompts, we achieve a two-fold increase in the number of questions in Spider. Training on this augmented dataset yields substantial improvements on a range of evaluation sets, including robustness benchmarks and out-of-domain data.
Introduction: The "SQL-in-English" Problem
Semantic parsing—specifically the translation of natural language into SQL—has seen massive gains on benchmarks like Spider. However, these models are notoriously brittle. If a user phrases a question slightly differently or omits a specific column name that the model expects, performance often craters.
The root cause lies in the Spider dataset itself. Because of its construction, many questions are essentially "SQL-in-English": they are overly explicit, mention every table and column involved, and lack the ambiguity and conciseness of real-world human speech. Consequently, models learn to "ground" queries by simple string matching rather than true reasoning. This research seeks to break that dependency by introducing natural language variation into the training pipeline.
Methodology: LLM-Driven Data Augmentation
To address this, the researchers leverage Large Language Models (LLMs), specifically gpt-3.5-turbo, as automatic data augmenters. Rather than simple paraphrasing, they utilize seven distinct, few-shot prompt instructions to force linguistic diversity:
- Simplify: Stripping the question to its core intent.
- Hide Details: Removing explicit mentions of database entities not strictly necessary for meaning.
- Synonyms: Replacing technical schema terms with natural language equivalents.
- Substitutions: Replacing complex phrases with simpler ones.
- Express Differently: Generating semantically equivalent but syntactically different questions.
- Examples: Providing the LLM with specific examples of "drastic" simplifications.
- Paraphrase: A standard, conservative rewriting.
By applying these to the Spider training set, the authors generated nearly 8,000 new examples at a minimal cost. Three state-of-the-art parsers (T5-3B, PICARD, and RESDSQL) were then fine-tuned on this augmented data.
The Prior Knowledge Trap
A key insight of this work is the categorization of utterances based on how much "prior knowledge" of the database they reveal. Spider is heavily biased toward questions that look like instructions, whereas real users ask questions requiring common-sense reasoning to map to a schema.
As shown in the figure above, a single intent can be expressed with varying degrees of explicitness. Models trained only on explicit "Prior SQL" style questions fail when faced with natural, concise queries that omit schema headers.
Key Results and Generalization
The benefits of augmentation were consistent across different architectures, proving that the bottleneck was data quality rather than model capacity:
- Robustness Boost: Augmented models showed a significant increase in "absolute robustness." For example, the RESDSQL model's accuracy on perturbed questions in the Dr.Spider benchmark rose to 72.5%.
- Closing the Generalization Gap: On the challenging KaggleDBQA dataset—which features "dirty" real-world data and abbreviations—the augmented RESDSQL model improved average execution accuracy from 31.8% to 34.1%.
- LLM Vulnerability: Interestingly, the authors found that ChatGPT itself (in a zero-shot setting) is highly vulnerable to the same linguistic variations it helps generate, often performing worse than smaller, fine-tuned models.
Conclusion
By doubling the Spider training data with diverse, LLM-generated reformulations, this work demonstrates that semantic parsers can be made significantly more robust to real-world language. Moving away from "SQL-in-English" prompts toward more natural, varied inputs is essential for deploying reliable text-to-SQL systems in out-of-domain environments.
Summary updated