Exploring Underexplored Limitations of Cross-Domain Text-to-SQL Generalization

Yujian Gan, Xinyun Chen, Matthew Purver

Introduction

While modern text-to-SQL models boast high accuracy on standard benchmarks, they often rely on "surface-level" string matching rather than true semantic understanding. This paper introduces Spider-DK, a new challenge dataset designed to expose these limitations. The findings reveal a significant 20-30% performance drop in state-of-the-art models when they are forced to utilize implicit domain knowledge—such as understanding that "old to young" implies an ascending sort by birth date.

The Problem: Deceptive Benchmark Performance

The goal of cross-domain text-to-SQL is to build systems capable of translating natural language (NL) questions into SQL queries for any database, including those unseen during training. Recent models have achieved over 70% accuracy on the popular Spider benchmark, suggesting the problem is nearing a solution. However, the authors argue these scores are deceptive because models rely heavily on schema linking—matching words in a question directly to column names. In real-world scenarios, users often use synonyms, omit obvious details, or use domain-specific jargon, breaking this direct link.

Methodology: A Diagnostic Framework

Instead of a new architecture, the authors provide a diagnostic framework identifying five specific types of domain knowledge (T1 through T5) that models struggle to handle. These categories represent common-sense inferences that humans make intuitively but which challenge the pattern-matching capabilities of current models.

Examples of the five types of domain knowledge (T1-T5) introduced in Spider-DK.
  • T1: Omitted Columns: Questions implying multiple columns (e.g., "name" for firstname and lastname).
  • T2: Simple Inference: Phrases like "old to young" implying ORDER BY ... ASC logic.
  • T3: Synonyms: Substituting cell values (e.g., "US" for "USA").
  • T4: Implicit Conditions: Words like "accepted" triggering hidden filters like WHERE decision = 'yes'.
  • T5: Domain Conflicts: Distinguishing between column names (e.g., max_speed) and SQL functions (e.g., MAX()).

The Spider-DK Dataset

Spider-DK is a human-curated variant of the Spider development set containing 535 NL-SQL pairs. While 270 are original Spider samples, 265 are manually modified to incorporate the five types of domain knowledge. Crucially, Spider-DK maintains the same SQL logic as the original benchmark but alters the natural language to be more realistic and less "schema-heavy."

Key Results and Analysis

The performance degradation across all evaluated models—including RAT-SQL, IRNet, and GNN—was significant. The best-performing model, RAT-SQL + GAP, saw its accuracy plummet from 67.8% on the standard Spider dev set to 44.1% on Spider-DK. When looking specifically at the modified samples, the results are even more stark.

Performance of state-of-the-art models across the five domain knowledge categories on modified samples.

Models struggled most with T1 (Omitted Columns) and T4 (Implicit Conditions), where top-tier model accuracy fell as low as 7.9% and 9.1%, respectively. Analysis suggests several key insights:

  • The Schema Linking Crutch: Models fail when the "pointing" mechanism to explicit schema mentions is removed. They are excellent at pointing but poor at reasoning.
  • The "Max" Trap: Models often learn templates (e.g., seeing "max" and reflexively using MAX()) rather than semantic meaning, as seen in the T5 category.
  • Generalization Gaps: Even when specific domain knowledge was present in the training set, models failed to generalize it to new test questions, indicating they are fitting to specific samples rather than learning underlying concepts.

Conclusion

The results from Spider-DK demonstrate that the path forward for text-to-SQL requires a shift in focus. Rather than simply scaling transformers, the field must prioritize robust semantic reasoning, better integration of common-sense and domain-specific knowledge, and the use of more challenging benchmarks to ensure models are not merely memorizing training patterns. Spider-DK serves as a vital tool for diagnosing these underexplored limitations.

Summary updated

BibTeX
@inproceedings{gan2021exploring,
  author = {Yujian Gan and Xinyun Chen and Matthew Purver},
  title = {{Exploring Underexplored Limitations of Cross-Domain Text-to-SQL Generalization}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2021},
  url = {https://openreview.net/forum?id=BFE0DZH2gcB},
}
Figure