Skip to main content
QUICK REVIEW

[Paper Review] Spider: A Large-Scale Human-Labeled Dataset for Complex and Cross-Domain Semantic Parsing and Text-to-SQL Task

Changyuan Yu, Rui Zhang|arXiv (Cornell University)|Sep 24, 2018
Natural Language Processing TechniquesComputer Science153 citations
TL;DR

Spider introduces a large, cross-domain text-to-SQL dataset with 200 databases and 10k+ questions to test generalization to unseen SQL queries and new database schemas; state-of-the-art models show substantial gaps.

ABSTRACT

We present Spider, a large-scale, complex and cross-domain semantic parsing and text-to-SQL dataset annotated by 11 college students. It consists of 10,181 questions and 5,693 unique complex SQL queries on 200 databases with multiple tables, covering 138 different domains. We define a new complex and cross-domain semantic parsing and text-to-SQL task where different complex SQL queries and databases appear in train and test sets. In this way, the task requires the model to generalize well to both new SQL queries and new database schemas. Spider is distinct from most of the previous semantic parsing tasks because they all use a single database and the exact same programs in the train set and the test set. We experiment with various state-of-the-art models and the best model achieves only 12.4% exact matching accuracy on a database split setting. This shows that Spider presents a strong challenge for future research. Our dataset and task are publicly available at https://yale-lily.github.io/spider

Motivation & Objective

  • Create a large, high-quality, cross-domain text-to-SQL dataset with complex SQL queries and multiple-table databases.
  • Enable evaluation of models on generalization to new databases, not just new queries within a fixed schema.
  • Promote a realistic semantic parsing task that requires understanding both natural language and database schemas across domains.
  • Provide multiple SQL patterns and a range of database schemas to assess model robustness.

Proposed method

  • Assemble 200 databases with multiple tables spanning 138 domains.
  • Annotate 10,181 natural language questions with 5,693 complex SQL queries across these databases.
  • Ensure questions cover a wide range of SQL patterns including joins, nesting, GROUP BY, HAVING, and set operations.
  • Review and paraphrase process to maintain clarity and consistency of SQL templates across equivalent questions.
  • Evaluate models using exact matching, component-wise F1, and note database-split vs example-split generalization.
  • Adapt existing text-to-SQL models (Seq2Seq, Seq2Seq+Attention, Seq2Seq+Copying, SQLNet, TypeSQL) to handle cross-database schemas and complex queries.

Experimental results

Research questions

  • RQ1Can a model generalize to unseen SQL queries on new databases with complex schemas?
  • RQ2How do state-of-the-art text-to-SQL models perform when trained and tested across different databases (cross-domain split)?
  • RQ3What aspects of SQL (e.g., WHERE, JOIN, nested queries) are most challenging under cross-domain evaluation?
  • RQ4How does database schema complexity (e.g., number of foreign keys) affect model performance?
  • RQ5Does incorporating schema/content information (as in TypeSQL) improve cross-database generalization?

Key findings

  • Best-performing models still struggle on Spider, with only 12.4% exact matching under database-split evaluation.
  • SQLNet and TypeSQL substantially outperform Seq2Seq baselines across splits and components.
  • WHERE clause and column prediction are most error-prone across models, reflecting their combinatorial difficulty.
  • Model performance degrades as database schema complexity increases (more foreign keys).
  • Example-split (same database in train/test) yields higher accuracy than database-split (no overlap of databases), highlighting cross-domain generalization challenges.
  • Spider's cross-domain setup reveals large gaps between current models and true semantic parsing generalization.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.