A Generative Parser with a Discriminative Recognition Algorithm

Jianpeng Cheng, Adam Lopez, Mirella Lapata

Abstract

Generative models defining joint distributions over parse trees and sentences are useful for parsing and language modeling, but impose restrictions on the scope of features and are often outperformed by discriminative models. We propose a framework for parsing and language modeling which marries a generative model with a discriminative recognition model in an encoder-decoder setting. We provide interpretations of the framework based on expectation maximization and variational inference, and show that it enables parsing and language modeling within a single implementation. On the English Penn Treebank, our framework obtains competitive performance on constituency parsing while matching the state-of-the-art single-model language modeling score.

Introduction

In computational linguistics, a long-standing tension exists between generative and discriminative models. Generative models, which model the joint probability of a sentence and its tree, are theoretically elegant and useful for language modeling. However, they often struggle with accuracy due to strict independence assumptions required for mathematical tractability. Conversely, discriminative models, which model the probability of a tree given a sentence, are typically faster and more accurate for parsing because they can leverage global sentence context. However, they lack the ability to generate language or calculate the probability of a sentence in isolation.

Previous attempts to combine these approaches often relied on "re-ranking" pipelines, which lack a unified mathematical interpretation. This work introduces an integrated framework that treats the parse tree as a latent variable in an encoder-decoder setup, bridging the gap between these two paradigms.

Methodology

The proposed auto-encoder framework is based on Recurrent Neural Network Grammars (RNNGs) and consists of three primary components:

  1. The Encoder (Recognition Model): A discriminative parser that predicts the sequence of actions (e.g., "shift" or "reduce") to build a parse tree. This model features an "adaptive buffer" using an attention mechanism to look ahead at remaining words.
  2. The Decoder (Generative Model): A generative model that calculates the joint probability of the sentence and the tree, effectively reconstructing the sentence based on the encoder's structural decisions.
  3. The Training Objective: Utilizing Variational Inference, the model maximizes the Evidence Lower Bound (ELBO) for unsupervised learning and incorporates a supervised term to maximize the likelihood of correct parse trees when labels are available.

This approach allows for end-to-end training where the discriminative encoder provides a proposal for the generative decoder within a single implementation.

Experimental Results

Constituency Parsing

The model was evaluated on the English Penn Treebank (PTB) benchmark. The framework achieved a competitive F1 score of 90.1. While this is slightly lower than the 93.3 reported by the original generative RNNG—likely due to simplified subtree representations used to optimize memory—it remains robust compared to other top-tier discriminative and generative parsers.

Comparison of constituency parsing performance (F1 scores) on the PTB test set.

Language Modeling

The framework's most significant performance gain was observed in language modeling. It achieved a perplexity of 99.8 on the PTB test set, matching or exceeding the state-of-the-art for single-model scores at the time of publication and significantly outperforming standard LSTM baselines.

Language modeling performance (perplexity) on the PTB test set. Lower scores indicate better performance.

Conclusion and Future Work

By treating parsing as posterior inference, this framework successfully combines the speed and context-awareness of discriminative models with the generative capabilities required for language modeling. Future work will focus on unsupervised grammar induction, leveraging the variational inference foundation to learn linguistic structures directly from unlabeled text.

Summary updated

BibTeX
@inproceedings{cheng2017generative,
  author = {Jianpeng Cheng and Adam Lopez and Mirella Lapata},
  title = {{A Generative Parser with a Discriminative Recognition Algorithm}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2017},
  url = {https://openreview.net/forum?id=SJEdz2xO-r},
}
Figure