Abstract
This paper introduces a novel neural network architecture designed to automatically learn the latent structure of documents—such as dependency trees—without the need for pre-trained parsers or manual annotations. By incorporating a differentiable version of the Matrix-Tree Theorem, the model enables the induction of complex, non-projective structures that are both task-optimized and human-interpretable. Notably, the implementation leverages matrix inversion to achieve processing speeds significantly faster than previous structural attention methods.
Introduction
In Natural Language Processing (NLP), documents are recognized as hierarchical and logical structures rather than flat sequences of words. Traditionally, researchers have relied on external discourse parsers to extract these structures. However, this approach suffers from two primary drawbacks: the high cost of human-annotated data required for training parsers and the risk of error propagation from the parser to the downstream model.
While recent "structured attention" models attempt to induce structure directly from data, they often rely on the computationally expensive inside-outside algorithm ($O(n^3)$). Furthermore, these models frequently struggle with "non-projective" dependencies—where structural edges cross—which are prevalent in long documents and flexible-word-order languages.
Methods
The proposed model employs a hierarchical architecture that processes text from words to sentences and finally to document-level representations.
Key technical components include:
- Bidirectional LSTMs: These generate initial representations for words and sentences.
- Matrix-Tree Theorem: Instead of standard softmax attention, the model uses a differentiable variant of Kirchhoff’s Matrix-Tree Theorem. This treats attention weights as marginal probabilities of edges in a non-projective dependency tree.
- Matrix Inversion for Efficiency: By utilizing matrix inversion instead of traditional dynamic programming, the model benefits from the parallelization capabilities of modern GPUs. This makes the approach approximately 10 to 20 times faster than the inside-outside algorithm.
- Semantic vs. Structural Vectors: The model bifurcates the LSTM output into semantic vectors (carrying meaning) and structural vectors (used for calculating links).
Experiments and Datasets
The model's effectiveness was evaluated across several diverse NLP tasks, including Natural Language Inference (SNLI), sentiment analysis (Yelp, IMDB), and political discourse classification (Congressional Floor Debates). Additionally, the CZ Movies dataset (Czech) was included to test the model's ability to handle non-projective structures in a language with flexible word order.
Key Results
The model achieved state-of-the-art or highly competitive results across all benchmarks. On the SNLI task, it reached 86.9% accuracy, outperforming existing structured attention models.
Beyond accuracy, the computational efficiency of the matrix-inversion method is a standout result. As shown in the table below, the proposed method is nearly an order of magnitude faster than the inside-outside algorithm.
Qualitative analysis further revealed that the induced trees are human-interpretable. In sentiment tasks, the model successfully identified "root" sentences that encapsulated the core opinion of long reviews, demonstrating that the learned structure is highly relevant to the specific task.
Conclusion
This research demonstrates that task-specific document structures can be induced efficiently without external linguistic tools. By transitioning from $O(n^3)$ dynamic programming to parallelizable matrix operations, the authors provide a path for integrating linguistically inspired inductive biases into deep learning models without prohibitive computational costs.
Summary updated