Skip to main content
QUICK REVIEW

[Paper Review] SADGA: Structure-Aware Dual Graph Aggregation Network for Text-to-SQL

Ruichu Cai, Jinjie Yuan|arXiv (Cornell University)|Nov 1, 2021
Topic ModelingComputer Science27 citations
TL;DR

SADGA introduces a unified dual-graph encoder with global/local structure-aware aggregation for cross-domain Text-to-SQL, achieving competitive results and 3rd place on Spider during publication.

ABSTRACT

The Text-to-SQL task, aiming to translate the natural language of the questions into SQL queries, has drawn much attention recently. One of the most challenging problems of Text-to-SQL is how to generalize the trained model to the unseen database schemas, also known as the cross-domain Text-to-SQL task. The key lies in the generalizability of (i) the encoding method to model the question and the database schema and (ii) the question-schema linking method to learn the mapping between words in the question and tables/columns in the database schema. Focusing on the above two key issues, we propose a Structure-Aware Dual Graph Aggregation Network (SADGA) for cross-domain Text-to-SQL. In SADGA, we adopt the graph structure to provide a unified encoding model for both the natural language question and database schema. Based on the proposed unified modeling, we further devise a structure-aware aggregation method to learn the mapping between the question-graph and schema-graph. The structure-aware aggregation method is featured with Global Graph Linking, Local Graph Linking, and Dual-Graph Aggregation Mechanism. We not only study the performance of our proposal empirically but also achieved 3rd place on the challenging Text-to-SQL benchmark Spider at the time of writing.

Motivation & Objective

  • Motivate cross-domain Text-to-SQL by addressing generalization to unseen schemas.
  • Eliminate the structure gap between question and schema encodings by using a unified graph-based model.
  • Develop a structure-aware dual-graph aggregation mechanism to improve question-schema linking.
  • Evaluate SADGA on the Spider benchmark and compare with strong baselines.

Proposed method

  • Represent both question and schema as graphs (question-graph and schema-graph) and construct cross-graph relations.
  • Encode dual graphs with a gated graph neural network (GGNN) while representing predefined relations as relation nodes.
  • Apply Global Graph Linking to compute cross-graph attention between query nodes and key nodes.
  • Apply Local Graph Linking to attend from query nodes to neighbors of key nodes across the dual graph.
  • Aggregate via a Dual-Graph Aggregation Mechanism with gating to produce unified node representations.
  • Optionally integrate with Relation-Aware Transformer (RAT) to further align representations; decoder follows a tree-structured SQL generation via an LSTM.

Experimental results

Research questions

  • RQ1How can a unified dual-graph encoding framework improve cross-domain Text-to-SQL generalization?
  • RQ2Can structure-aware global and local linking across question and schema graphs yield better question-schema alignment than traditional methods?
  • RQ3What is the impact of the proposed aggregation mechanism on parsing harder SQL queries?

Key findings

  • SADGA achieves competitive development/test accuracy on Spider, surpassing several baselines and yielding 3rd place on the Spider leaderboard with SADGA+GAP.
  • The structure-aware dual-graph aggregation improves performance, especially on Extra-Hard queries, indicating better handling of complex SQL.
  • Ablation shows both Global/Local Graph Linking and the aggregation gate are beneficial; removing them degrades performance, particularly on harder levels.
  • Integrating BERT-base/BERT-large or GAP further boosts performance, with SADGA+GAP achieving strong results.
  • Global Graph Linking aligns question words to relevant schema parts, while Local Graph Linking captures latent associations via neighbors, aiding correct linking beyond surface-string matches.
  • Case studies illustrate interpretable alignments between question terms and schema components.

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.