Parsing with Treebank Grammars: Empirical Bounds, Theoretical Models, and the Structure of the Penn Treebank

Dan Klein, Christopher D. Manning

Abstract

While context-free grammar (CFG) parsing is theoretically $O(n^3)$, empirical tests on the Penn Treebank (PTB) often reveal "super-cubic" time behavior. This paper demonstrates that this slowdown is not merely an implementation quirk but a fundamental result of the grammar's structure. As sentences grow longer, more regions of the grammar are "unlocked," causing the effective grammar size to increase with sentence length, leading to empirical time exponents as high as 3.8.

Introduction

In computational linguistics, the $O(n^3)$ bound for chart parsing is a standard benchmark. However, researchers have frequently observed that parsing the Penn Treebank with its own induced grammar yields performance significantly slower than this theoretical expectation. This study bridges the gap between theory and practice by investigating why the "constant" factors in complexity equations—specifically the number of non-terminals and grammar rules—effectively grow in real-world scenarios.

Methodology

The authors utilized an exhaustive active chart parser to analyze the Wall Street Journal (WSJ) section of the Penn Treebank (Release 3). They systematically varied three categories of parameters to isolate the drivers of computational load:

  1. Tree Transforms: Pre-processing steps such as removing empty nodes and collapsing unary chains (e.g., NP -> NP).
  2. Grammar Rule Encodings: Comparing three ways to store rules in memory: LIST (standard dotted rules), TRIE (prefix-compacted rules), and MIN (state-minimized Finite State Automata).
  3. Rule Introduction: Evaluating Top-Down versus Bottom-Up strategies.
Visual comparison of LIST, TRIE, and MIN rule encodings, showing how state minimization reduces the search space.

To explain the observed performance, the authors developed a theoretical model based on "Saturation": the number of passive or active edges that exist over a span of a certain size. By modeling how many grammar states are "unlocked" as a span grows, they could accurately predict the total number of traversals required.

Key Insights and Structural Analysis

The "Super-Cubic" Mystery

The study found that the "effective" grammar size grows with sentence length. In short sentences, many complex rules never get triggered. However, as sentences lengthen, more of the grammar's state space becomes reachable. This structural property of the PTB grammar is what drives the empirical time exponents beyond 3.0.

Phrasal Categories and POS Tags

The PTB grammar is highly interconnected, forming large Strongly Connected Components. Once a phrasal category (like an NP) is found over a span, "passive saturation" occurs quickly, meaning almost all other categories are likely to be found. Conversely, Part-of-Speech (POS) tags act as the primary constraints. An active grammar state only progresses if it matches a specific tag. As spans get longer, the mathematical probability of matching these tag sequences increases, "unlocking" more active states.

Encoding and Filtering

Moving from a simple LIST of rules to a TRIE or MINimized FSA provides the single most significant boost to performance by drastically reducing the number of active states. Interestingly, the authors found that top-down filtering provides almost no benefit in broad-coverage grammars like the PTB; the grammar is so permissive that nearly any category can appear anywhere, making bottom-up parsing equally efficient.

Empirical Results

The choice of encoding has a massive impact on the grammar's state space. For instance, the NOTRANSFORM grammar contains over 80,000 active states in a LIST encoding, but this drops to ~17,000 in a TRIE and only ~2,600 in a MINimized FSA.

Empirical time complexity across different grammar encodings and transforms, illustrating the super-cubic growth as sentence length increases.

As shown in the performance data, most configurations exhibited growth significantly greater than $O(n^3)$. For example, the Trie-NoEmpties setting showed an empirical exponent of 3.47. The authors' mathematical models for active and passive saturation closely matched these observed traversal counts, confirming that the super-cubic behavior is a predictable consequence of the grammar's inherent structure.

Conclusion

This research highlights that the complexity of parsing is as much a function of grammar structure as it is of algorithm design. While exhaustive parsing remains the focus here, the insights into grammar saturation and encoding efficiency provide a theoretical foundation for understanding the performance of more complex, pruned, or refined parsing systems. Future work may explore how manual grammar refinement or parent annotation alters these saturation patterns.

Summary updated

BibTeX
@inproceedings{klein2001parsing,
  author = {Dan Klein and Christopher D. Manning},
  title = {{Parsing with Treebank Grammars: Empirical Bounds, Theoretical Models, and the Structure of the Penn Treebank}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2001},
  doi = {10.3115/1073012.1073056},
}
Figure