Abstract
Natural language processing faces a significant challenge in the exponential explosion of interpretations for ambiguous sentences. This paper introduces a polynomial-time algorithm that constructs compact, "packed" semantic representations directly from syntactic parse forests. By utilizing anti-unification to factor out common logical constraints and a naming system for structural sharing, the approach achieves remarkable efficiency, processing sentences with over 129 million readings in approximately one second.
Introduction: The Challenge of Massive Ambiguity
Natural language is inherently ambiguous. A classic example is the sentence, "I saw a man on the hill with a telescope," which can be interpreted in numerous ways depending on how the prepositional phrases (PPs) are attached. Does the telescope belong to the man, the hill, or the act of seeing? As sentences grow longer and include more PPs, the number of possible interpretations—the "massive ambiguity"—explodes exponentially.
Traditionally, semantic analysis might attempt to build a separate representation for every possible syntactic parse. However, for complex sentences, this "naive" approach is computationally infeasible. While syntactic "parse forests" can compactly represent many trees at once, converting these forests into useful, compact semantic representations without "unpacking" them has remained a significant hurdle in computational linguistics.
Methodology
The proposed algorithm processes a syntactic parse forest in a bottom-up fashion to construct a Packed Underspecified Discourse Representation Structure (UDRS). This representation maintains the ambiguity of the input without explicitly enumerating every possible reading.
The "Generalise" Operation and Anti-Unification
The core innovation of this approach is the "Generalise" operation. When the algorithm encounters an OR-node in the parse forest—representing a choice between different syntactic structures—it does not simply store both options. Instead, it employs anti-unification to identify the "common part" shared by the competing meanings. The algorithm then stores only the unique "remainders" as disjunctions, effectively factoring out redundant logical information.
Functional Abstraction and Naming
To prevent the semantic representation from growing exponentially when sub-structures are shared across different branches, the algorithm introduces a naming system (def). This system allows a complex constraint to be defined once and referenced by a unique name elsewhere, similar to variable assignment in programming. This ensures that the size of the semantic structure remains manageable even as the number of represented readings increases.
Computational Complexity
By maintaining these structures in a "packed" state, the algorithm achieves a polynomial time complexity of $O(n^4 \log n)$ relative to the sentence length $n$. This is a massive improvement over the exponential complexity required by non-packed methods.
Evaluation and Results
The algorithm was evaluated using a synthetic benchmark designed to test extreme ambiguity: sentences of the form "I saw a man (on a hill)^n", where $n$ represents the number of prepositional phrases. This allowed for precise measurement of scaling as the number of possible readings grew from a handful to over 129 million.
The implementation, tested in Prolog, demonstrated remarkable efficiency:
- Massive Scaling: For a sentence with 16 prepositional phrases—translating to 129,644,790 distinct readings—the algorithm constructed a packed semantic representation in just 1.14 seconds.
- Linear Growth: While the number of readings grows exponentially, the number of nodes in the packed semantic structure and the time taken to build it grow near-linearly or polynomially.
- Optimization: An optimized version utilizing "n-ary anti-unification" (generalizing across multiple branches simultaneously) further reduced the processing time for the 16-PP sentence to 750 milliseconds.
Discussion and Future Work
The algorithm relies on the "rule-to-rule" hypothesis and the assumption of monotonicity, meaning semantic construction is a purely additive process of gathering constraints. A current limitation is the "no-fail" assumption; in real-world systems, some parses may be semantically impossible (e.g., "The rock ate the sandwich"). If semantic constraints can fail, the algorithm would require modifications to handle the resulting search space pruning.
Future work involves integrating this method with "sortal filtering"—using world knowledge to prune impossible meanings—to determine if the packed structures remain efficient when such filters are applied. Additionally, the common logical components identified during anti-unification could serve as a fast approximation of the "core meaning" of a sentence before full disambiguation is attempted.
Summary updated