Abstract: Peter Shaw, Philip Massey, Angelica Chen, Francesco Piccinno, Yasemin Altun. Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics.
2019.
This paper offers an elegant solution to one of the "last mile" problems in semantic parsing: effectively bridging the gap between natural language and the rigid, structured world of entities and databases. The authors propose a Graph Neural Network (GNN) architecture that treats natural language tokens and potential entity candidates as nodes in a unified graph. By extending the Transformer's self-attention mechanism to incorporate edge relations, the model learns to generate logical forms while jointly disambiguating entities, achieving state-of-the-art results on benchmarks like GEO and ATIS.
Introduction
Semantic parsing is the task of translating a natural language utterance (e.g., "What is the capital of Texas?") into a machine-readable logical form (e.g., answer(capital(stateid('texas'))).
A major hurdle in this field is entity handling. Real-world queries are full of entities (cities, dates, table names) that might be unseen during training or highly ambiguous. Traditional approaches usually handle this via preprocessing (replacing entities with placeholders) or post-processing (generating a logic "sketch" to be filled later). The authors argue that entities and their relationships should instead be treated as first-class citizens within the model's encoder to leverage rich contextual information during the parsing process.
Methodology
The core innovation is the GNN Sub-layer, which evolves the standard Transformer self-attention layer to handle structured relational data.
Graph Representation
The input is represented as a fully connected graph where nodes are either tokens from the utterance or "entity candidates" retrieved from a knowledge base.
Unlike a standard Transformer where every word attends to every other word equally, this model uses edge labels to define specific relationships, including sequential position between tokens, span relations (linking tokens to entity surface forms), and schema relations (defining table-column or foreign key relationships in SQL tasks).
Model Architecture
The self-attention mechanism is modified to incorporate these edge labels as additive vectors. The authors found this approach more parameter-efficient and effective than complex matrix transformations.
The decoder is a sequence-to-sequence model augmented with a copy mechanism. At each step, the decoder can either select a word from a fixed vocabulary or "copy" one of the entity nodes directly from the input graph.
Evaluation and Results
The model was evaluated on three classic semantic parsing benchmarks: GEO (US geography), ATIS (flight bookings), and SPIDER (complex text-to-SQL).
- SPIDER: The GNN approach reached 32.1% accuracy, a massive jump over the previous state-of-the-art (24.8%) for models not using data augmentation.
- GEO & ATIS: Incorporating BERT-Large provided a significant boost, with the model achieving 92.5% accuracy on GEO and 89.7% on ATIS.
- Ablation Study: On the ATIS dataset, removing "entity span edges" (the links between words and the entities they represent) caused accuracy to crater from 87.1% to 34.2%, proving the graph structure is the primary driver of the model's success.
Discussion
The results highlight the power of Relational Inductive Bias. In the SPIDER dataset, the graph structure allows the model to "know" the database schema; if the model attends to a column, information from the parent table naturally flows into that column's representation.
However, limitations remain. BERT surprisingly did not improve performance on SPIDER, likely because the pre-trained representations were too sensitive to training-specific vocabulary, hindering generalization to unseen schemas. Additionally, the current $O(N^2)$ complexity of the fully connected graph may present scaling challenges for extremely large knowledge bases.
Summary updated