Quasi-Destructive Graph Unification

Hideto TomabechiACL 1991

Abstract

Graph unification is a computationally intensive operation central to natural language parsing. Traditional algorithms often suffer from excessive memory allocation and redundant copying, particularly during failed unification attempts. This paper presents a "quasi-destructive" unification algorithm that utilizes a global timing clock to manage temporary graph modifications. By deferring memory copying until unification success is guaranteed, the proposed method achieves significant performance improvements, reducing memory overhead and doubling execution speed compared to standard approaches.

Introduction

In unification-based grammar formalisms such as HPSG, graph unification serves as the primary mechanism for merging linguistic features. Despite its utility, it remains a significant performance bottleneck, often accounting for over 90% of a parser's CPU time. The efficiency of a parser is thus inextricably linked to the efficiency of its unification engine.

The Bottleneck: Over-Copying and Early Copying

Existing unification algorithms typically encounter two major efficiency "sinks":

  1. Over-Copying: The creation of new graph structures even when they are not strictly required for the final result.
  2. Early Copying: Allocating memory and copying graphs before determining if the unification will actually succeed.

In typical natural language parsing, between 60% and 80% of unification attempts fail. Consequently, any resources spent on "early copying" for these failed attempts represent pure computational waste. The challenge lies in testing for compatibility without the overhead of upfront copying, while simultaneously avoiding the permanent destruction of the input graphs.

The Quasi-Destructive Approach

The proposed "quasi-destructive" algorithm addresses these issues by modifying graphs in-place during the unification check, but in a way that allows for near-instantaneous rollback.

Key Innovations

  • The Global Timing Clock: Every node in the graph contains specialized "mark" fields (e.g., forward-mark, copy-mark). When a temporary modification is made—such as adding a forwarding pointer—it is stamped with the current value of a global integer counter.
  • Instant Invalidation: To "undo" temporary changes after an attempt, the system simply increments the global counter. Any marks associated with the previous value are immediately treated as invalid. This reduces the cleanup phase to an $O(1)$ operation.
  • Copy on Success Only: Memory allocation and actual copying are deferred until the unification is guaranteed to be successful. This strategy optimizes for the most frequent case: failure.
The quasi-destructive unification process involves creating temporary forwarding pointers and composite arc lists, which are later used to generate a permanent copy only upon success.

Experimental Evaluation

The algorithm was evaluated using a large-scale HPSG-based Japanese grammar (2,324 nodes) developed for telephone dialogue domains. Testing was conducted on a Symbolics 3620 Lisp Machine using a set of 16 sentences of varying complexity.

Results and Discussion

The "Quasi-Destructive" (T) algorithm was compared against a modified version of the Wroblewski (W) algorithm. The results demonstrated substantial improvements across several metrics:

  • Execution Speed: For complex sentences requiring hundreds of unifications, the quasi-destructive approach was approximately twice as fast as the baseline.
  • Memory Efficiency: The number of nodes created (copies) was reduced by 40-60%, and the total number of memory allocations (conses) dropped significantly.
  • Success Rates: Empirical data confirmed that unification success rates (USrate) hovered between 33% and 50%, validating the "copy-only-on-success" design philosophy.
Comparative performance data for 16 test sentences, showing improvements in elapsed time, node copies, and memory allocation (conses) for the Quasi-Destructive (T) algorithm over the Wroblewski (W) algorithm.

Conclusion

By shifting the focus to optimizing for unification failure and utilizing a global clock for state management, the quasi-destructive algorithm provides a robust solution to the primary bottleneck in NLP parsing. The reduction in memory allocation not only speeds up the unification process itself but also minimizes the overhead of garbage collection in high-level programming environments.

Summary updated

BibTeX
@inproceedings{tomabechi1991quasi,
  author = {Hideto Tomabechi},
  title = {{Quasi-Destructive Graph Unification}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {1991},
  doi = {10.3115/981344.981385},
}
Figure