Skip to main content
QUICK REVIEW

[Paper Review] Global Reasoning over Database Structures for Text-to-SQL Parsing

Ben Bogin, Matt Gardner|arXiv (Cornell University)|Aug 29, 2019
Natural Language Processing TechniquesComputer Science17 references10 citations
TL;DR

This paper proposes a global reasoning framework for zero-shot text-to-SQL parsing that improves database constant selection by leveraging graph neural networks (GNNs) for schema-aware attention and a re-ranking module based on global alignment between question words and DB constants. The method boosts accuracy on the Spider benchmark from 39.4% to 47.4% by enabling context-aware, joint selection of relevant DB constants, outperforming autoregressive baselines that rely on local similarity scores.

ABSTRACT

State-of-the-art semantic parsers rely on auto-regressive decoding, emitting one symbol at a time. When tested against complex databases that are unobserved at training time (zero-shot), the parser often struggles to select the correct set of database constants in the new database, due to the local nature of decoding. In this work, we propose a semantic parser that globally reasons about the structure of the output query to make a more contextually-informed selection of database constants. We use message-passing through a graph neural network to softly select a subset of database constants for the output query, conditioned on the question. Moreover, we train a model to rank queries based on the global alignment of database constants to question words. We apply our techniques to the current state-of-the-art model for Spider, a zero-shot semantic parsing dataset with complex databases, increasing accuracy from 39.4% to 47.4%.

Motivation & Objective

  • To address the challenge of selecting correct database constants in zero-shot text-to-SQL parsing when new databases are unseen during training.
  • To overcome the limitations of autoregressive decoders that make local, isolated decisions about DB constants based on word-level similarity.
  • To improve generalization on complex, unseen databases by incorporating global structural and semantic cues from the DB schema and question.
  • To design a method that jointly reasons over DB constants and question words to reduce errors from ambiguous or misleading lexical matches.
  • To demonstrate that global reasoning—via GNN-based gating and re-ranking—significantly enhances performance on the Spider benchmark.

Proposed method

  • A graph neural network (GNN) is used to encode the DB schema into node representations, where nodes represent tables, columns, and foreign key relationships.
  • A gating mechanism applies message-passing through the schema graph to softly select a subset of DB constants likely to appear in the output query, conditioned on the input question.
  • The model computes a global attention score between question words and DB constants using a learned similarity function, enabling context-aware selection beyond local word matches.
  • A separate re-ranker model evaluates the top-K candidate queries from the autoregressive decoder, ranking them based on the global alignment of selected DB constants with the question.
  • The re-ranker uses a representation of unaligned question words and learns to prioritize queries where DB constants are semantically aligned with the full question context.
  • The final prediction uses the re-ranked list, with ties broken by the original decoder’s autoregressive scores to preserve structural correctness.

Experimental results

Research questions

  • RQ1Can global reasoning over the DB schema and question improve zero-shot text-to-SQL accuracy beyond local similarity-based decoding?
  • RQ2How effective is a GNN-based gating mechanism in identifying relevant DB constants by modeling schema structure and question context?
  • RQ3Does re-ranking top-K autoregressive outputs based on global DB constant alignment lead to significant performance gains?
  • RQ4To what extent do global cues reduce errors from incorrect table joins or column selections due to lexical ambiguity?
  • RQ5Can the proposed method be applied as a plug-in to existing semantic parsers without architectural overhaul?

Key findings

  • The proposed Global-GNN model achieves 47.4% exact match accuracy on the Spider test set, representing a 8 percentage point improvement over the prior state-of-the-art of 39.4%.
  • The development set accuracy reaches 52.1%, significantly outperforming previous models, especially on multi-table queries where complexity is highest.
  • Removing either the global gating or the re-ranking component leads to a 4% drop in performance, demonstrating the necessity of both components.
  • Training without the relevance loss for the re-ranker results in a 2% accuracy decrease, confirming the importance of aligning DB constants with question semantics.
  • The model reduces errors due to poor column coverage and incorrect table joins—common failure modes in baseline models—by leveraging global context.
  • An oracle analysis shows that perfect global gating and re-ranking could push accuracy to 63.2% and 73.5%, respectively, indicating substantial headroom for future improvements.

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.