Skip to main content
QUICK REVIEW

[Paper Review] RYANSQL: Recursively Applying Sketch-based Slot Fillings for Complex Text-to-SQL in Cross-Domain Databases

Dong-Hyun Choi, Myeong Cheol Shin|arXiv (Cornell University)|Apr 7, 2020
Web Data Mining and AnalysisComputer Science11 citations
TL;DR

RYANSQL proposes a sketch-based, recursively structured neural network for complex cross-domain Text-to-SQL, using Statement Position Code (SPC) to decompose nested queries into non-nested components and apply slot filling per component. It achieves 58.2% exact match accuracy on the Spider benchmark, a 3.2 percentage point improvement over prior state-of-the-art systems.

ABSTRACT

Text-to-SQL is the problem of converting a user question into an SQL query, when the question and database are given. In this paper, we present a neural network approach called RYANSQL (Recursively Yielding Annotation Network for SQL) to solve complex Text-to-SQL tasks for cross-domain databases. State-ment Position Code (SPC) is defined to trans-form a nested SQL query into a set of non-nested SELECT statements; a sketch-based slot filling approach is proposed to synthesize each SELECT statement for its corresponding SPC. Additionally, two input manipulation methods are presented to improve generation performance further. RYANSQL achieved 58.2% accuracy on the challenging Spider benchmark, which is a 3.2%p improvement over previous state-of-the-art approaches. At the time of writing, RYANSQL achieves the first position on the Spider leaderboard.

Motivation & Objective

  • To address the challenge of generating complex, nested SQL queries in cross-domain Text-to-SQL, where training and test databases differ.
  • To overcome limitations of existing sketch-based methods in handling nested queries and complex syntax found in the Spider benchmark.
  • To improve performance on complex, multi-table, multi-clause queries through structured decomposition and enhanced input encoding.
  • To develop a scalable, recursive framework that maintains grammatical correctness while improving generalization across unseen databases.

Proposed method

  • Introduces Statement Position Code (SPC) to recursively encode the hierarchical structure of nested SQL queries, enabling component-wise generation.
  • Designs a detailed sketch template for complex SELECT statements, defining slots for key clauses like SELECT, FROM, WHERE, HAVING, GROUP BY, and ORDER BY.
  • Applies a sketch-based slot-filling mechanism using BERT-encoders to predict values for each slot in a structured, grammatically constrained manner.
  • Employs two input manipulation techniques: JOIN Table Filtering (JTF) to reduce irrelevant table candidates and Supplemented Column Names (SCN) to improve column representation in encoding.
  • Uses a recursive generation strategy: each component query is generated independently based on its SPC, enabling modular and scalable query synthesis.
  • Leverages BERT for contextual encoding of questions and database schemas, with enhanced input processing to improve alignment between natural language and schema elements.

Experimental results

Research questions

  • RQ1Can a sketch-based approach effectively handle complex, nested SQL queries in cross-domain Text-to-SQL, where training and test databases are disjoint?
  • RQ2How can recursive decomposition of nested queries be formalized to enable modular, component-wise generation with grammatical consistency?
  • RQ3To what extent do input manipulation techniques like JOIN Table Filtering and Supplemented Column Names improve slot-filling accuracy in complex schema environments?
  • RQ4Does the use of Statement Position Code (SPC) significantly enhance the system’s ability to predict hard, nested queries compared to flat slot-filling approaches?
  • RQ5Can a sketch-based method outperform grammar-based or sequence-to-sequence models on the challenging Spider benchmark, which includes multi-join, multi-clause queries?

Key findings

  • RYANSQL achieved 58.2% exact match accuracy on the Spider benchmark, marking a 3.2 percentage point improvement over the previous state-of-the-art.
  • The ablation study showed that removing SPC reduced performance most significantly, especially on hard and extra-hard queries, confirming its role in handling nesting.
  • Supplemented Column Names (SCN) provided the largest performance gain among the three proposed features, indicating that better column representation is critical for accuracy.
  • JOIN Table Filtering (JTF) improved performance on medium and hard queries, suggesting it helps reduce noise in table selection during decoding.
  • Error analysis revealed that column selection failure (34.9% of failures) and table number misclassification (25.2%) were the top causes of errors, highlighting the need for cross-slot consistency.
  • The system outperformed all prior slot-filling and grammar-based models on the Spider leaderboard at the time of publication, establishing a new SOTA.

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.