Abstract
Sequence labeling is a fundamental problem in machine learning, natural language processing and many other fields. A classic approach to sequence labeling is linear chain conditional random fields (CRFs). When combined with neural network encoders, they achieve very good performance in many sequence labeling tasks. One limitation of linear chain CRFs is their inability to model long-range dependencies between labels. High order CRFs extend linear chain CRFs by modeling dependencies no longer than their order, but the computational complexity grows exponentially in the order. In this paper, we propose the Neural Latent Dependency Model (NLDM) that models dependencies of arbitrary length between labels with a latent tree structure. We develop an end-to-end training algorithm and a polynomial-time inference algorithm of our model. We evaluate our model on both synthetic and real datasets and show that our model outperforms strong baselines.
Introduction
Sequence labeling—the task of assigning a tag to every token in a sequence—is a cornerstone of natural language processing. Traditionally, Linear Chain Conditional Random Fields (CRFs) have been the standard choice for these tasks. However, these models are inherently limited by their "short memory," typically only capturing dependencies between a label and its immediate neighbor.
While high-order CRFs can capture longer-range dependencies, they suffer from exponential computational complexity relative to the dependency length. This paper introduces the Neural Latent Dependency Model (NLDM), which overcomes these limitations by modeling arbitrary-length relationships between labels using a latent projective tree structure, maintaining polynomial-time complexity.
Methodology
The NLDM architecture integrates a neural encoder with a latent dependency structure to capture non-local relationships.
The core components include:
- Latent Tree Structure: The model assumes a hidden tree structure connects labels. Unlike linear chains, edges can exist between any two labels in the sequence, regardless of distance.
- Projectivity Constraint: To ensure computational tractability, the latent tree is required to be projective (meaning edges do not cross when drawn above the sequence). This allows the use of efficient dynamic programming algorithms like the Inside-Outside and Eisner’s algorithms.
- Neural Scoring: A Bi-LSTM encodes input tokens. Edge scores between labels are computed via a trilinear function combining token representations and label embeddings.
- Training and Inference: The model is trained to maximize the marginal log-likelihood of the correct label sequence by summing over all possible latent trees. For inference, an efficient approximate decoding algorithm is used, replacing the "sum" operation with a "max" operation.
Experimental Setup
The NLDM was evaluated on both synthetic and real-world datasets to test its ability to handle long-range dependencies:
- Synthetic Data: Generated from a neural infinite-order generative model specifically designed to contain long-range dependencies.
- Real-World Data:
- Twitter POS Tagging: A challenging dataset characterized by the informal and noisy nature of social media text.
- Universal Dependencies (UD): POS tagging across eight different languages (including English, French, and Italian), testing the model's cross-lingual robustness.
Results
The NLDM demonstrated superior performance across multiple benchmarks:
- Synthetic Superiority: Consistently outperformed Neural CRFs, particularly in scenarios where training data was scarce.
- State-of-the-Art POS Tagging: Achieved 89.37% accuracy on the Twitter dataset, surpassing both 1st-order (89.09%) and 2nd-order (89.29%) Neural CRFs.
- Cross-Lingual Success: Secured the highest accuracy in 7 out of 9 real-world datasets tested, showing strong generalization across domains.
- Structural Discovery: Analysis revealed that over 30% of captured dependencies exceeded a distance of 1, validating the model's ability to leverage long-range information effectively.
Discussion
A key theoretical contribution of this work is the proof that NLDM serves as a generalization of existing sequence labeling models.
By utilizing a tree structure, the model can "skip" over noisy or irrelevant intermediate labels to establish direct dependencies between distant but related tags. While the $O(m^2 \times n^3)$ complexity is higher than linear CRFs, it remains significantly more efficient than high-order CRFs for long-range modeling. Furthermore, the authors observed that limiting the maximum dependency length (e.g., to 5 tokens) can often improve accuracy by filtering out extremely rare, long-distance noise.
Conclusion
The NLDM provides a powerful framework for sequence labeling by capturing long-range dependencies through a latent projective tree. While the $O(n^3)$ complexity may pose challenges for extremely long sequences, its performance gains in POS tagging are significant. Future work includes applying NLDM to tasks where long-range dependencies are even more critical, such as Semantic Role Labeling (SRL).
Summary updated