Combining Improvements for Exploiting Dependency Trees in Neural Semantic Parsing

Defeng Xie, Jianmin Ji, Jiafei Xu, Ran Ji

Abstract

Standard Transformer-based semantic parsers often treat natural language as flat sequences, neglecting the hierarchical structure inherent in human language. This paper explores the integration of dependency trees into these models through three distinct methods: Parent-Scaled Self-Attention (PASCAL), Syntax-Aware Word Representations (SAWRs), and Constituent Attention (CA). Our analysis reveals that while PASCAL and SAWRs provide redundant information, CA offers complementary structural constraints. By combining PASCAL and CA with Transductive Ensemble Learning (TEL), we achieve new state-of-the-art results on the ATIS, GEO, and JOBS benchmarks, demonstrating that structural syntax significantly enhances neural semantic parsing.

Introduction

Semantic parsing involves translating natural language queries into formal machine-executable code, such as $\lambda$-calculus or SQL. While deep learning has advanced this field, "vanilla" Transformers typically ignore the rich, hierarchical relationships between words. Linguists represent these relationships using dependency trees, which map how words relate to one another (e.g., identifying the head verb for a specific noun).

Example of a dependency tree illustrating word relationships in a query.

This research aims to identify the most effective combination of syntactic features to maximize parsing accuracy, moving beyond flat token sequences to leverage linguistic "common sense."

Methodology

The authors evaluate three primary architectural enhancements to the Transformer encoder:

  1. PASCAL (Parent-Scaled Self-Attention): This method modifies the attention mechanism using a Gaussian distribution to bias attention heads toward a word's direct dependency parent.
  2. SAWRs (Syntax-Aware Word Representations): This approach incorporates knowledge from a pre-trained neural dependency parser by concatenating its intermediate hidden states with standard word embeddings.
  3. CA (Constituent Attention): CA introduces a "constituent prior" matrix that encourages the model to respect phrase boundaries and sub-structures within the dependency tree.
Architectural comparison of the PASCAL, SAWRs, and CA methods for injecting syntax into Transformers.

To further boost performance, the researchers employ Transductive Ensemble Learning (TEL). Unlike traditional ensembles, TEL uses multiple models to label test data, creating a synthetic dataset for fine-tuning the best-performing individual model.

Key Insights

A critical finding of this study is the relationship between different syntactic injections. PASCAL and SAWRs were found to be redundant, as both primarily teach the model about parent-child relationships. In contrast, Constituent Attention (CA) is complementary to both. Because CA focuses on broader phrase structures rather than just immediate parents, it provides a distinct perspective that improves performance when paired with PASCAL or SAWRs.

Furthermore, the PASCAL + CA combination is highly efficient, achieving state-of-the-art results without significantly increasing parameter counts or training time. Qualitative analysis via attention heatmaps confirmed that these modifications force the model to attend to the tree structure, whereas baseline models often exhibit "flat" or scattered attention.

Experimental Results

The proposed PASCAL + CA + TEL model established new benchmarks across three gold-standard datasets using $\lambda$-calculus representations:

  • ATIS (Flight Bookings): Achieved 89.2% Exact Match accuracy, surpassing the previous neural state-of-the-art (87.1%).
  • GEO (U.S. Geography): Reached 87.1% Exact Match, a top-tier result for neural architectures.
  • JOBS (Job Listings): Attained 92.9% Exact Match, outperforming existing models like Graph2Seq.

Even without the ensemble component (TEL), the architectural improvements alone significantly outperformed the baseline Transformer across all datasets.

Conclusion

This work demonstrates that integrating structural syntax into neural semantic parsers is both effective and efficient. While some syntactic features are redundant, the combination of parent-scaled attention and constituent constraints provides a robust framework for exploiting dependency trees. Future research may extend these methods to larger datasets and diverse formal languages like SQL or Python.

Summary updated

BibTeX
@inproceedings{xie2021combining,
  author = {Defeng Xie and Jianmin Ji and Jiafei Xu and Ran Ji},
  title = {{Combining Improvements for Exploiting Dependency Trees in Neural Semantic Parsing}},
  booktitle = {PRICAI},
  year = {2021},
  url = {https://openreview.net/forum?id=FM9ZBQ7VO1},
}
Figure