Skip to main content
QUICK REVIEW

[Paper Review] RESDSQL: Decoupling Schema Linking and Skeleton Parsing for Text-to-SQL

Haoyang Li, Jing Zhang|arXiv (Cornell University)|Feb 12, 2023
Natural Language Processing TechniquesComputer Science6 citations
TL;DR

RESDSQL proposes a decoupled approach to Text-to-SQL by separating schema linking from skeleton parsing: it uses a cross-encoder to rank and inject only relevant schema items into the encoder, and a skeleton-aware decoder that first generates SQL skeletons before full queries. This design improves both performance and robustness, achieving state-of-the-art results on Spider and its robustness variants.

ABSTRACT

One of the recent best attempts at Text-to-SQL is the pre-trained language model. Due to the structural property of the SQL queries, the seq2seq model takes the responsibility of parsing both the schema items (i.e., tables and columns) and the skeleton (i.e., SQL keywords). Such coupled targets increase the difficulty of parsing the correct SQL queries especially when they involve many schema items and logic operators. This paper proposes a ranking-enhanced encoding and skeleton-aware decoding framework to decouple the schema linking and the skeleton parsing. Specifically, for a seq2seq encoder-decode model, its encoder is injected by the most relevant schema items instead of the whole unordered ones, which could alleviate the schema linking effort during SQL parsing, and its decoder first generates the skeleton and then the actual SQL query, which could implicitly constrain the SQL parsing. We evaluate our proposed framework on Spider and its three robustness variants: Spider-DK, Spider-Syn, and Spider-Realistic. The experimental results show that our framework delivers promising performance and robustness. Our code is available at https://github.com/RUCKBReasoning/RESDSQL.

Motivation & Objective

  • To reduce the complexity of Text-to-SQL by decoupling schema linking and skeleton parsing, which are often intertwined in seq2seq models.
  • To alleviate the burden of schema linking by filtering irrelevant schema items before model input.
  • To improve SQL parsing accuracy by guiding the decoder with intermediate skeleton generation.
  • To enhance robustness on challenging, out-of-distribution variants of Spider, such as Spider-DK, Spider-Syn, and Spider-Realistic.
  • To provide a simple yet effective framework that improves performance without adding complex modules.

Proposed method

  • A cross-encoder is trained to classify and rank all tables and columns based on their relevance to the input question.
  • Only the top-k most relevant schema items are selected and injected into the encoder, replacing the full unordered schema sequence.
  • The decoder is modified to first generate a skeleton (e.g., 'SELECT _ FROM _ WHERE _') before generating the full SQL query.
  • The masked self-attention mechanism in the decoder implicitly guides the generation of correct syntax by conditioning on the skeleton.
  • The framework is implemented on a T5-based seq2seq model, with no additional modules beyond the ranking and decoding strategy.
  • The schema item classifier is trained independently and used to reorganize the input schema sequence before decoding.

Experimental results

Research questions

  • RQ1Can decoupling schema linking and skeleton parsing improve Text-to-SQL performance?
  • RQ2Does filtering irrelevant schema items reduce the difficulty of schema linking in seq2seq models?
  • RQ3Can generating SQL skeletons as an intermediate step improve the accuracy of full SQL generation?
  • RQ4How does the proposed framework perform on robustness benchmarks like Spider-DK, Spider-Syn, and Spider-Realistic?
  • RQ5Is the ranking-enhanced encoding and skeleton-aware decoding approach more effective than end-to-end joint learning?

Key findings

  • RESDSQL achieves state-of-the-art performance on the Spider benchmark, outperforming previous methods.
  • The model demonstrates strong robustness on Spider-DK, Spider-Syn, and Spider-Realistic, indicating improved generalization.
  • The skeleton-aware decoding strategy improves generation accuracy by implicitly constraining syntactic correctness.
  • The ranking-enhanced encoder reduces noise from irrelevant schema items, improving schema linking efficiency.
  • The framework achieves ~80% exact match accuracy on the skeleton parsing task alone, suggesting that skeleton parsing is significantly easier than full SQL generation.
  • The ablation study confirms that both the ranking module and the skeleton-aware decoding contribute to the overall performance gain.

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.