Comparing Two Grammar-Based Generation Algorithms: A Case Study

Miroslav Martinovic, Tomek StrzalkowskiACL 1992

Introduction

In the field of Computational Linguistics, Natural Language Generation (NLG) involves the complex task of transforming structured "meaning" representations into natural language sentences. This paper presents a comparative analysis of two significant algorithms from the early 1990s: the Semantic-Head-Driven Generation Algorithm (SHDGA) and the Essential Arguments Algorithm (EAA). The study demonstrates that EAA offers superior efficiency and generality by utilizing compile-time grammar normalization.

The Challenges of Unification-Based Generation

Generating sentences from logical forms within unification-based grammars is fraught with computational hurdles. Key among these are:

  1. Left-recursion: Grammar rules that can trap algorithms in infinite loops.
  2. Non-monotonicity: Instances where the semantic content of a whole expression is not a simple summation of its constituents.
  3. Deadlock-prone rules: Situations where generation cannot proceed because required information has not yet been instantiated.

To overcome these, an algorithm must employ an effective traversal strategy—the order in which grammar tree nodes are visited—to ensure efficiency and determinism.

Methodological Comparison

SHDGA: The Hybrid Approach

SHDGA relies on manually designated "semantic heads" to guide its search. It employs a mixed strategy, moving top-down for certain rules and bottom-up for others (specifically chain rules). By identifying a "pivot" literal in a rule that carries the core meaning, it attempts to work outward to complete the derivation.

EAA: The Pre-processor Approach

In contrast, EAA shifts the computational burden to a compile-time phase. It analyzes the grammar to identify Minimal Sets of Essential Arguments (msea's) for every literal. This analysis determines exactly what information must be present before a rule can be safely triggered. EAA then reorders the grammar rules so that a standard top-down search can proceed deterministically without the risk of entering "deadlock" states.

Experimental Setup and Datasets

The algorithms were evaluated using curated grammar fragments and specific case studies, including wh-questions and yes/no questions. To ensure practical relevance, the authors tested the algorithms against fragments of Sager’s String Grammar, a comprehensive computer grammar for English.

Figure 2: A derivation tree for a wh-question ('who wrote this') illustrating the complexity of the grammar fragments used in the study.

Key Insights and Results

The Concept of "Readiness"

A central finding is the importance of the "ready" literal. EAA is inherently more robust because it only expands a node when it is "ready" (i.e., sufficiently instantiated). SHDGA, by contrast, often defaults to the leftmost literal; if that literal lacks necessary data, the algorithm suffers from excessive backtracking.

Efficiency and Generality

In test cases involving complex structures like yes/no questions, SHDGA frequently backtracks due to suboptimal starting points. EAA avoids this by identifying essential arguments, resulting in a linear, deterministic path. Furthermore, while SHDGA requires labor-intensive manual tagging of semantic heads, EAA processes the same grammars automatically.

Figure 3: A derivation tree for a yes/no question ('do you see him often'). EAA handles such complex structures deterministically, whereas SHDGA may require significant backtracking.

Multi-directionality

EAA achieves true multi-directionality, allowing the same optimized grammar to be used for both parsing (text-to-meaning) and generation (meaning-to-text). SHDGA is primarily optimized for one-way generation.

Conclusion

The comparison reveals that EAA is a more general and efficient framework than SHDGA. By moving rule-ordering logic to the compilation phase, EAA eliminates run-time overhead and ensures a more stable generation process. This study underscores the value of sophisticated pre-processing in language processing tasks, though the authors note that further work is needed to formally characterize the full class of grammars these algorithms can handle.

Summary updated

BibTeX
@inproceedings{martinovic1992comparing,
  author = {Miroslav Martinovic and Tomek Strzalkowski},
  title = {{Comparing Two Grammar-Based Generation Algorithms: A Case Study}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {1992},
  doi = {10.3115/981967.981978},
}
Figure