Introduction
Structured prediction tasks, such as Part-of-Speech (POS) tagging and Named Entity Recognition (NER), require predicting sequences of interdependent labels. Traditionally, this is framed as finding the label sequence that minimizes an energy function. While exact inference methods like the Viterbi algorithm are effective for simple models, their quadratic complexity ($O(nL^2)$) becomes a significant bottleneck as label sets ($L$) grow or scoring functions become more complex.
Inference Paradigms
This research evaluates three primary approaches to structured inference:
- Exact Inference (Viterbi): Provides the optimal solution but scales poorly with large label sets.
- Gradient Descent (GD): Involves relaxing discrete labels into a continuous space and minimizing the energy function directly. While flexible, GD is often slow and susceptible to local minima.
- Inference Networks (InfNets): These are auxiliary "student" models trained to map inputs directly to the optimal outputs of a "teacher" model. By learning these mappings, InfNets "amortize" the cost of inference across the dataset.
The study explores three InfNet architectures: CNNs (optimized for local dependencies), BLSTMs, and Sequence-to-Sequence (seq2seq) models with attention (designed for long-range dependencies).
Novel Refinements
To enhance performance, the authors introduce two refinements:
- Instance-Tailoring: Fine-tuning InfNet parameters for a specific test instance to further minimize energy.
- Warm-Starting GD: Utilizing the InfNet's output as an initial state for Gradient Descent, combining rapid global search with local refinement.
Experimental Framework
The methods were benchmarked across three tasks representing different structural challenges:
- Twitter POS Tagging: A task with 25 tags and primarily local dependencies.
- CoNLL 2003 NER: A task with 17 tags requiring the identification of multi-word spans.
- CCG Supertagging: A complex task with 400 tags and long-distance compositional dependencies, serving as a primary stress test for computational efficiency.
Results and Analysis
The evaluation demonstrates that Inference Networks offer a superior trade-off between accuracy and computational cost compared to traditional methods.
Accuracy and Search Error
As shown in the results above, InfNets consistently outperform local baselines and approach the performance of exact Viterbi inference. On the NER task, the seq2seq InfNet matched Viterbi’s F1 score. In the challenging CCG task, the InfNet achieved 94.2% accuracy, nearly identical to Viterbi’s 94.3%. Notably, InfNets achieved much lower search error than pure Gradient Descent, which struggled with the long-distance dependencies inherent in CCG tagging. In some cases, training InfNets with a combination of structured energy loss and local cross-entropy allowed them to even outperform exact Viterbi inference.
Computational Efficiency
The primary advantage of InfNets is their speed. By amortizing the inference process, these networks avoid the iterative or exhaustive search required by GD and Viterbi.
CNN-based InfNets were found to be 10x to 100x faster than Viterbi and Gradient Descent. For instance, in POS tagging, the CNN InfNet processed 12,500 sentences per second compared to Viterbi's 500. This efficiency is particularly pronounced in tasks with large label sets like CCG, where InfNets maintain high accuracy at a fraction of the temporal cost of exact methods.
Conclusion
Inference Networks represent a powerful alternative to traditional structured inference. By matching the network architecture to the task's inductive bias—such as using seq2seq for long-range dependencies—researchers can achieve near-exact accuracy with massive gains in speed. The "warm-start" approach, combining InfNets with Gradient Descent, provides a robust method for energy minimization in complex models where exact inference may be intractable. Future work will focus on applying these techniques to models with global constraints where Viterbi is no longer an option.
Summary updated