Parsing as Language Modeling

Do Kook Choe, Eugene CharniakEMNLP 2016

Abstract

This paper demonstrates that syntactic parsing—traditionally viewed as a complex structural prediction task—can be effectively solved by treating it as a simple language modeling problem. By linearizing trees into sequences and using a large LSTM-based language model to rerank candidates, the authors achieved a new state-of-the-art F1 score of 93.8 on the Penn Treebank. The success of this approach highlights the capacity of standard sequence models to capture hierarchical structures when trained on large-scale semi-supervised data.

Introduction

Syntactic parsing involves uncovering the hierarchical structure (the "tree") of a sentence. Historically, this required specialized algorithms and complex, linguistically-driven architectures. While deep learning has significantly improved results, many models still rely on specialized components like transition-based systems or tree-structured neural networks to handle the hierarchy.

The authors of this paper challenge the need for such specialized machinery. They ask: Can a standard neural language model, designed to predict the next word in a sequence, learn to "speak" the language of syntactic trees? By reducing parsing to a sequence modeling task, researchers can leverage the rapid advances in general-purpose language modeling and move away from complex, task-specific architectures.

Methods

The proposed approach consists of three main components: linearization, a large-scale LSTM language model, and a reranking framework.

Linearization and Modeling

To treat a tree as a sequence, the authors flatten it into a string of tokens. For example, a simple sentence like "dogs chase cats" is represented as a sequence of brackets and labels.

Example of a syntactic tree structure before linearization.

The model is a standard LSTM-Language Model (LSTM-LM) with a large architecture (3 layers, 1500 units per layer) and dropout. It is trained to predict the next token in these linearized tree sequences, effectively modeling the joint probability of the words and the structure.

Reranking and Semi-Supervision

Because the space of all possible trees is astronomically large, the model is used as a reranker. A "base" parser (the Charniak parser) generates the top 50 most likely candidate trees for a sentence, and the LSTM-LM then scores these candidates to select the best one.

To overcome the limited size of human-annotated data (the ~40,000 sentences in the Wall Street Journal/Penn Treebank), the authors employed tri-training. They took millions of unlabeled sentences from the New York Times and parsed them with two different existing parsers. If both parsers agreed on the structure, that "silver" tree was added to the training set, resulting in up to 24 million additional training examples.

Key Results

The model achieved a new state-of-the-art F1 score of 93.8 on the Penn Treebank (Section 23), surpassing previous high-water marks from models like the RNNG (92.4) and Grammar as a Foreign Language (92.8).

Comparison of the LSTM-LM parser against previous state-of-the-art models and the impact of silver data.

As shown in the results table, the performance improves significantly as more "silver" data is added. When converted to Stanford Dependencies, the model also achieved exceptional results: 95.9% UAS (Unlabeled Attachment Score) and 94.1% LAS (Labeled Attachment Score), outperforming direct dependency parsers of the time.

Discussion and Insights

The most striking insight is that LSTMs are remarkably good at capturing deeply nested hierarchical structures even when presented as flat sequences. This suggests that "tree-shaped" networks may not be strictly necessary for syntactic tasks. Furthermore, the generative nature of the model—modeling the probability of the whole tree sequence—outperformed discriminative models that only predict the tree given the sentence.

However, the approach has limitations. As a reranker, the model is bottlenecked by the base parser; if the correct tree is not in the top 50 candidates, the LSTM-LM cannot recover it. Additionally, training on 24 million trees is computationally intensive. Future work aims to develop efficient ways for the LSTM-LM to search the tree space directly and to incorporate character-level embeddings to better handle out-of-vocabulary words.

Conclusion

By reducing parsing to language modeling, this work demonstrates that simplicity can be a powerful feature. Standard, well-optimized LSTM implementations, combined with large-scale semi-supervised data, can outperform highly specialized architectures, paving the way for more unified approaches to natural language understanding.

Summary updated

BibTeX
@inproceedings{choe2016parsing,
  author = {Do Kook Choe and Eugene Charniak},
  title = {{Parsing as Language Modeling}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2016},
  doi = {10.18653/v1/d16-1257},
}
Figure