Stack-based Multi-layer Attention for Transition-based Dependency Parsing

Zhirui Zhang, Shujie Liu, Mu Li, Ming Zhou, Enhong Chen

Introduction

Dependency parsing is a fundamental task in natural language processing that involves mapping grammatical relationships between words in a sentence. Transition-based parsing approaches this by executing a sequence of actions, such as "SHIFT" or "ARC," to build a dependency tree. While sequence-to-sequence (seq2seq) models have seen immense success in tasks like machine translation, they have historically lagged behind specialized architectures in dependency parsing. This gap is primarily due to "structural blindness"—a lack of explicit mechanisms to track the parsing stack—and the limitations of "flat" attention mechanisms in capturing complex, multi-word dependencies.

This paper introduces a stack-based multi-layer attention mechanism designed to bridge this gap. By integrating symbolic state information directly into the neural architecture, the proposed model achieves state-of-the-art performance on standard benchmarks, effectively mimicking the logic of traditional transition-based algorithms within a neural framework.

Proposed Architecture

The authors enhance the standard encoder-decoder framework with three key components to better handle the nuances of syntactic structure:

  1. Simulated Stack Information: To provide the model with a sense of the current parsing state, two binary vectors, $s$ and $r$, are introduced. Vector $s$ tracks whether a word is currently on the stack, while $r$ indicates if it has been removed. These vectors guide the attention mechanism to focus on "active" words.
  2. Multi-layer Attention: Instead of a single attention pass, the model employs $l$ layers of attention. Each layer refines the context from the previous one, allowing the network to automatically learn hierarchical features similar to the manual templates (unigrams, bigrams, etc.) used in traditional parsers.
  3. Constrained Decoding: Hard constraints are implemented via indicator functions in the decoder to ensure the generation of valid trees by preventing illegal transitions, such as performing a "LEFT-ARC" when the stack contains fewer than two words.
The proposed architecture featuring an encoder-decoder setup with simulated stack information and multi-layer attention.

Experimental Setup

The model was evaluated on two primary benchmarks: the Penn Treebank (PTB) for English and the Chinese Treebank 5.1 (CTB). The experiments utilized the arc-standard transition algorithm and initialized word embeddings with pre-trained GloVe vectors. Part-of-Speech (POS) tags were also included as critical input features.

Results and Analysis

The proposed model significantly outperformed baseline seq2seq models and matched or exceeded the performance of specialized state-of-the-art parsers across both English and Chinese datasets.

Performance comparison of the proposed model against various state-of-the-art parsers on PTB and CTB datasets.

Key Findings:

  • Performance Gains: On the English PTB dataset, the single model achieved an Unlabeled Attachment Score (UAS) of 93.71, while an ensemble reached 94.16—a 1.87 point improvement over the vanilla seq2seq baseline. Similar gains were observed on the Chinese CTB dataset (+1.61 UAS).
  • Optimal Depth: Ablation studies indicated that three layers of attention provide the best balance between accuracy and computational efficiency. Adding more layers increased the risk of overfitting and significantly extended training time (roughly doubling it compared to a vanilla model).
  • Feature Importance: While stack vectors improved performance, POS tags remained a vital input feature. Removing them caused a larger performance drop than removing the stack vectors, highlighting that syntactic category information is still a primary driver for parsing accuracy.

Conclusion

This work demonstrates that seq2seq models can be highly effective for transition-based dependency parsing when augmented with structural "hints" and hierarchical attention. By bridging the gap between symbolic logic and neural representation, the model achieves competitive results without requiring highly specialized, task-specific architectures. Future work includes exploring other transition systems like arc-eager and reducing the computational overhead of the multi-layer attention mechanism.

Summary updated

BibTeX
@inproceedings{zhang2017stack,
  author = {Zhirui Zhang and Shujie Liu and Mu Li and Ming Zhou and Enhong Chen},
  title = {{Stack-based Multi-layer Attention for Transition-based Dependency Parsing}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2017},
  doi = {10.18653/v1/d17-1175},
}
Figure