Table of Contents
Fetching ...

Global Reasoning over Database Structures for Text-to-SQL Parsing

Ben Bogin, Matt Gardner, Jonathan Berant

TL;DR

The paper tackles zero-shot text-to-SQL parsing where unseen DB schemas hinder constant selection. It introduces a globally-aware parser that uses a gating graph neural network to softly select relevant DB constants by reasoning over the schema-question graph, and a re-ranking module that scores candidate queries based on the global alignment of constants to the question. On the Spider dataset, these components raise accuracy from 39.4% to 47.4%, surpassing prior state-of-the-art. The work demonstrates that integrating global structural reasoning with constant selection and query-level evaluation yields substantial improvements and offers a broadly applicable framework for zero-shot semantic parsing.

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%.

Global Reasoning over Database Structures for Text-to-SQL Parsing

TL;DR

The paper tackles zero-shot text-to-SQL parsing where unseen DB schemas hinder constant selection. It introduces a globally-aware parser that uses a gating graph neural network to softly select relevant DB constants by reasoning over the schema-question graph, and a re-ranking module that scores candidate queries based on the global alignment of constants to the question. On the Spider dataset, these components raise accuracy from 39.4% to 47.4%, surpassing prior state-of-the-art. The work demonstrates that integrating global structural reasoning with constant selection and query-level evaluation yields substantial improvements and offers a broadly applicable framework for zero-shot semantic parsing.

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%.

Paper Structure

This paper contains 7 sections, 1 equation, 3 figures, 3 tables.

Figures (3)

  • Figure 1: An example where choosing a DB constant based on local similarities is difficult, but the ambiguity can be resolved through global reasoning (see text).
  • Figure 2: High-level overview, where our contributions are in thick orange boxes. First, a relevance score is predicted for each of the DB constants using the gating GCN. Then, a learned representation is computed for each DB constant using the encoder GCN, which is then used by the decoder to predict $K$ candidates queries. Finally, the re-ranking GCN scores each one of these candidates, basing its score only on the selected DB constants. The dashed line and arrow indicate no gradients are propagated from the re-ranking GCN to the decoder, as the decoder outputs SQL queries. Names of loss terms are written below models that are trained with a loss on their output.
  • Figure 3: The re-ranking GCN architecture (see text).