NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Dynamic Programming for Linear-Time Incremental Parsing

Liang Huang, Kenji SagaeACL 2010

Abstract

This paper bridges the gap between fast-but-greedy incremental parsing and slow-but-exact dynamic programming. By merging "equivalent" parser states based on local feature windows, the authors create a shift-reduce parser that explores an exponentially large search space in linear time, achieving a 5x speedup over traditional beam-search parsers while setting new accuracy records for English and Chinese dependency parsing.

Introduction

In natural language parsing, researchers typically face a trade-off between speed, accuracy, and search completeness. Dynamic Programming (DP) methods like the CKY algorithm are exhaustive and exact but suffer from $O(n^3)$ complexity. Conversely, incremental parsing (e.g., Shift-Reduce) is $O(n)$ but often greedy. Even with beam search, these parsers explore only a fraction of possible trees, leading to search errors where the correct parse is discarded prematurely. This work introduces a method to integrate DP into incremental parsing to achieve exhaustive search without sacrificing linear-time efficiency.

Methodology: State Merging and Kernel Features

The core innovation of this approach is State Merging. In a standard shift-reduce parser, every unique sequence of actions results in a unique stack. However, modern parsers utilize feature templates that only inspect a small "window" of the stack. The authors observed that if two different stacks share the same "kernel features"—the specific information the parser uses to decide its next action—they are effectively equivalent.

Feature templates and kernel features used to define state equivalence.

Key technical components include:

  • Graph-Structured Stack (GSS): Instead of a simple list, the parser uses a GSS to represent multiple possible stacks efficiently. When two states are equivalent, their paths in the GSS are merged.
  • Kernel Features: These formally define the minimal set of information (roots, tags, and children of the top stack items) needed to determine future actions.
  • Prefix Cost: To maintain efficiency, the system uses "prefix costs" to prune the search space, a technique borrowed from speech recognition.
  • Early Update: During Perceptron training, the model is updated as soon as the correct parse falls out of the beam. Because DP explores more paths, it triggers these updates more frequently, leading to more robust learning.

Experimental Setup

The authors evaluated the parser on two major benchmarks:

  • Penn Treebank (PTB): The standard gold-standard for English dependency parsing (Sections 02-21 for training, 22 for dev, 23 for testing).
  • Chinese Treebank (CTB5): A standard benchmark for Chinese parsing, using the same splits as previous competitive work.

Key Results

The DP-based incremental parser demonstrated significant improvements in both speed and accuracy. It achieved a 5x speedup over state-of-the-art non-DP beam search parsers when matched for search quality. For simpler "edge-factored" models, the speedup reached 8x.

Average model score comparison between DP and non-DP parsers, showing DP reaches higher scores with less search effort.

In terms of accuracy, the parser achieved an unlabeled attachment score (UAS) of 92.1% on the Penn Treebank, outperforming all previously reported dependency parsers. For Chinese parsing, it set a new high bar with 85.2% word accuracy. Remarkably, the algorithmic efficiency was so high that a pure Python implementation outperformed many major parsers written in C++ or Java.

Conclusion

By leveraging the boundedness of modern feature templates, this work shows that DP for shift-reduce parsing is not only possible in polynomial time but highly efficient in practice. This approach produces a packed forest encoding an exponential number of trees, significantly reducing search errors. Future work includes extending this framework to phrase-structure (constituency) parsing and handling non-projective languages.

Summary updated

BibTeX
@inproceedings{huang2010dynamic,
  author = {Liang Huang and Kenji Sagae},
  title = {{Dynamic Programming for Linear-Time Incremental Parsing}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2010},
}
Figure