Relating Complexity to Practical Performance in Parsing with Wide-Coverage Unification Grammars

John CarrollACL 1994

Introduction

In the early 1990s, computational linguistics faced a significant challenge: theoretical complexity analysis suggested that advanced parsing with unification-based grammars was exponentially hard ($O(2^n)$). However, John Carroll's research provided a crucial reality check, demonstrating that for realistic, wide-coverage English grammars, practical performance is surprisingly efficient—scaling closer to a quadratic curve than an exponential one.

The Gap Between Theory and Practice

By the late 80s, Natural Language Processing (NLP) had shifted toward "unification-based" grammars. These grammars utilize feature structures (e.g., person, number, case) that must match for a rule to apply, making them highly expressive. The concern was that parsing with these grammars was theoretically $O(2^n)$ relative to grammar size and sentence length. Most studies at the time used "toy" grammars, leaving it unclear how algorithms would behave with the complex, wide-coverage grammars required for real-world applications. Carroll's work investigates whether this theoretical "complexity monster" actually manifests in practice.

Methodology

Carroll implemented and compared three distinct parsing architectures adapted for the ANLT (Alvey Natural Language Tools) formalism:

  1. Bottom-Up Left-Corner (BU-LC): A chart-based parser optimized with rule indexing and "lazy" structure copying.
  2. Non-deterministic LR: A table-driven parser using a context-free backbone to guide parsing, handling unification "on-line" during reductions.
  3. Compiled-Earley (CE): Based on Schabes (1991), this uses a table to compile the predictive component of Earley parsing to optimize for large grammars.

These were benchmarked against the SRI Core Language Engine (CLE) using the CLARE2.5 grammar. The evaluation used the ANLT Grammar (782 rules, 84 features) and two test sets: 129 representative short sentences (1–12 words) and 100 hand-crafted longer sentences (13–30 words) to test scaling.

Empirical Performance and Scaling

The study's most significant finding was that theoretical exponential bounds are largely irrelevant for real-world grammars. The "pathological" cases causing exponential slowdowns do not typically appear in standard English syntax.

Comparison of parser performance on CPU time and storage.

As shown in the performance comparison, the LR parser emerged as the most efficient overall for the ANLT grammar, being approximately 35% faster than the BU-LC parser and twice as fast as the CE parser on short sentences. It also proved more memory-efficient, allocating 30% less storage than BU-LC.

Mean CPU time vs. sentence length showing near-quadratic scaling.

Empirical data reveals that the BU-LC parser's performance scales roughly quadratically ($O(n^2)$) with sentence length, as illustrated in the figure above. While the LR parser initially outperformed BU-LC, the gap narrowed on longer sentences, where the LR parser eventually faced challenges with specific constructions like multiple passives, leading to a spike in CPU time for the longest sentences.

Key Insights

  • Grammar Size vs. State Space: The Compiled-Earley (CE) parser, despite being designed for large grammars, was the slowest. Conversely, the LR parser performed best because the actual number of states visited during real-world parsing is much smaller than the theoretical maximum.
  • Structural Constraints: Real-world grammars often have constraints that limit complexity, such as rarely using more than two daughters per rule and using recursion sparingly.
  • Efficiency over Baseline: All experimental parsers significantly outperformed the SRI CLE baseline, highlighting the effectiveness of these optimized architectures.

Conclusion and Future Directions

Carroll concludes that current complexity theory is a "blunt" instrument for predicting parser performance. He advocates for a more fine-grained theory based on the specific properties of natural language grammars.

Future work remains to address lexical ambiguity; this study used a restricted lexicon (600 words), and a full-scale lexicon (e.g., 40,000 words) might introduce more significant performance degradation. Additionally, while performance was strong up to 20 words, it began to dip significantly as sentences approached the 30-word mark, suggesting a practical limit for these specific implementations.

Summary updated

BibTeX
@inproceedings{carroll1994relating,
  author = {John Carroll},
  title = {{Relating Complexity to Practical Performance in Parsing with Wide-Coverage Unification Grammars}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {1994},
  doi = {10.3115/981732.981772},
}
Figure