MAP Inference in Chains using Column Generation

David Belanger, Alexandre Passos, Sebastian Riedel, Andrew McCallumNeurIPS 2012

Introduction

Linear chains and trees are fundamental building blocks in many graphical model applications, particularly in structured prediction tasks like natural language processing. While exact Maximum A Posteriori (MAP) inference in these models can be performed using dynamic programming (such as the Viterbi algorithm), the computation often becomes prohibitively expensive. This paper introduces a novel approach to make exact MAP inference significantly faster by leveraging Column Generation. By combining linear programming techniques with pre-computed bounds on model scores, the authors achieve up to a 13x speedup over standard Viterbi while maintaining 100% mathematical exactness.

The Bottleneck in Standard Inference

In tasks like Part-of-Speech (POS) tagging or Named Entity Recognition (NER), the standard tool for finding the most likely sequence of labels is the Viterbi algorithm. However, Viterbi’s computational complexity scales quadratically with the number of possible labels ($D$).

While a domain of 45 POS tags is manageable, joint tasks (like predicting POS and NER simultaneously) can easily expand the domain size $D$ to 360 or more. At this scale, the $D^2$ computation per sequence step becomes a severe bottleneck. To bypass this, many practitioners resort to approximate methods like beam search. While faster, beam search is greedy and approximate—it risks missing the globally optimal solution, thereby degrading model accuracy.

Exact Inference via Column Generation

To overcome the limitations of both slow exact inference and inaccurate approximate inference, the authors propose a new exact algorithm based on Delayed Column Generation.

The Column Generation algorithm iteratively expands the restricted domain using a Reduced-Cost Oracle.

The method operates through the following key steps:

  1. Restricted LP: Instead of evaluating all possible labels for every word in a sentence, the algorithm initializes a "restricted" version of the problem containing only the most promising labels (e.g., the label with the highest local score).
  2. Reduced-Cost Oracle: After solving this restricted problem using standard message passing, the algorithm queries an oracle to ask: "Are there any labels not in our current active set that could potentially improve the total score?"
  3. Pre-computed Bounds: To answer this quickly without exhaustively checking every label pair, the oracle relies on offline, pre-computed bounds on the transition scores. If the theoretical "best possible" version of an excluded label cannot beat the current solution, it is immediately pruned.
  4. Iterative Expansion: The algorithm adds only the necessary, promising labels to the active set and repeats the process. Once it proves that no outside labels can improve the result, it terminates. The final solution is guaranteed to be the exact MAP assignment.

Key Insights

  • Exploiting Sparsity: In most NLP tasks, local evidence is overwhelmingly strong. For instance, if the current word is "running," the model does not need to evaluate the transition from "Verb" to "Color." Column generation mathematically exploits this natural sparsity.
  • Optimization Perspective: The standard Viterbi algorithm is actually the "dual" of a specific Linear Program. Viewing inference through this optimization lens allows the application of powerful LP techniques (like Column Generation) that are not obvious in a pure message-passing framework.
  • Bidirectional Information: The authors found that utilizing information from both ends of the chain (forward and backward messages) to calculate "reduced costs" helps the algorithm converge much faster than a unidirectional approach.
  • Learning for Speed: A compelling secondary insight is that models can be explicitly trained to be faster. By regularizing transition weights during training, models can be encouraged to produce score distributions that the Column Generation oracle can prune more efficiently.

Results and Performance

The authors evaluated their approach on the Wall Street Journal (WSJ) corpus for both POS tagging (45 tags) and joint POS/NER (360 tags).

  • Speed: On the standard POS tagging task, the column generation algorithm was over 2.5x faster than exact Viterbi. On the more complex joint POS/NER task, it achieved a massive 13x speedup.
  • Efficiency: For the POS task, over 90% of the words in the test set only ever required a "restricted domain" of size 1 to mathematically prove optimality.
  • Exactness vs. Approximation: Unlike beam search, which trades accuracy for speed, this method remains 100% exact. For context, a common Beam-3 setting lost 1.6% accuracy compared to the exact result, whereas the proposed method delivered the exact result in less time.
Approximate methods like beam search trade higher throughput for increased relative error rates, whereas the proposed method remains exact.

Limitations and Future Directions

While highly effective in typical cases, the algorithm does not improve theoretical worst-case complexity. If a model exhibits very "flat" score distributions where every label is equally likely, the algorithm may fall back to the full $D^2$ computation. Additionally, the current pruning strategy relies on transition scores being data-independent. Extending this oracle to handle modern data-dependent transitions, or adapting the framework for "loopy" graphs and higher-order chains, remain exciting directions for future research.

Summary updated

BibTeX
@inproceedings{belanger2012map,
  author = {David Belanger and Alexandre Passos and Sebastian Riedel and Andrew McCallum},
  title = {{MAP Inference in Chains using Column Generation}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2012},
  url = {https://openreview.net/forum?id=BJba-P-dZr},
}
Figure