Efficient Learning of Sparse Conditional Random Fields for Supervised Sequence Labelling

Nataliya Sokolovska, Thomas Lavergne, Olivier Cappé, François Yvon · DOI

Abstract Conditional Random Fields (CRFs) constitute a popular and efficient approach for supervised sequence labelling. CRFs can cope with large description spaces and can integrate some form of structural dependency between labels. In this contribution, we address the issue of efficient feature selection for CRFs based on imposing sparsity through an L1 penalty. We first show how sparsity of the parameter set can be exploited to significantly speed up training and labelling. We then introduce coordinate descent parameter update schemes for CRFs with L1 regularization. We finally provide some empirical comparisons of the proposed approach with state-of-the-art CRF training strategies. In particular, it is shown that the proposed approach is able to take profit of the sparsity to speed up processing and hence potentially handle larger dimensional models.

Introduction

Conditional Random Fields (CRFs) are a cornerstone of supervised sequence labeling tasks, such as Part-of-Speech (POS) tagging and Named Entity Recognition (NER). However, they face significant computational bottlenecks as label sets and feature spaces grow. Standard inference algorithms scale quadratically with the number of labels ($|Y|^2$), and the inclusion of complex "bigram" features often leads to millions of parameters, many of which are redundant. This research addresses these challenges by making CRFs both sparse and computationally efficient simultaneously.

Methodology

The authors introduce a novel training framework that leverages $\ell^1$ regularization to induce sparsity and a specialized optimization algorithm to exploit it.

$\ell^1$ Regularization and Sparsity

Unlike the standard $\ell^2$ penalty, which keeps weights small but non-zero, the authors employ an $\ell^1$ (or Elastic Net) penalty to force unimportant feature weights to exactly zero. This reduces the model size and prevents overfitting in high-dimensional spaces.

Sparse Forward-Backward Algorithm

The core innovation is the modification of the forward-backward recursions. By rewriting these recursions to skip zero-weighted features, the computational complexity shifts from being fixed at $O(|Y|^2)$ to being proportional to the number of active (non-zero) features. This allows the sparsity of the model to directly translate into training and inference speedups.

Sparse Blockwise Coordinate Descent (SBCD)

To handle millions of features, the authors propose SBCD. Instead of updating all parameters simultaneously, this algorithm groups parameters into "blocks" based on the observation symbol (e.g., all features related to a specific letter). A quadratic approximation of the objective function allows for efficient analytical updates for these blocks, making coordinate descent viable for high-dimensional CRF models.

Experimental Setup

The approach was evaluated across three distinct datasets:

  1. Simulated Data: Synthetic data generated by a Hidden Markov Model (HMM) to test the handling of unnecessary dependencies.
  2. Nettalk (Phonetization): A dictionary task mapping 26 English letters to 53 possible phonemes. This task highlights the $|Y|^2$ complexity issue.
  3. CoNLL 2003 (NER): A benchmark for identifying entities in text, representing a high-dimensional task with millions of potential features but a small label set.

Key Results and Insights

Massive Model Compression and Speed

On the Nettalk task, the SBCD algorithm reduced the number of active bigram features by 95% (from approximately 74,000 to 3,600) without sacrificing test accuracy. The training time was found to be roughly proportional to the number of active features, demonstrating that sparsity is a powerful tool for algorithmic speedup, not just model compression.

Visualization of feature weights for the Nettalk phonetization task. The left panel shows the dense parameter distribution of a standard CRF, while the right panel demonstrates the significant sparsity induced by the proposed L1-regularized SBCD algorithm.

Performance Benchmarks

The sparse models achieved F-measures and error rates comparable to state-of-the-art non-sparse trainers like L-BFGS, OWL-QN, and SGD, but with a fraction of the parameters. The "active set" advantage was particularly evident in phonetization, where most label-to-label transitions are only relevant for specific observations.

Limitations and Future Work

The speedup is most dramatic when the label set is large. In tasks with few labels, such as CoNLL 2003 (8 labels), the overhead of managing sparse data structures can make the algorithm slower than highly optimized dense SGD, despite producing a smaller model. Additionally, the blockwise approach can be slowed by very frequent observations (e.g., common stop words).

Future research directions include the application of "warm-starts" to accelerate the search for optimal features and extending the sparse logic to higher-order CRFs (trigrams and beyond), where the potential for complexity reduction is even greater.

Summary updated

BibTeX
@article{sokolovska2010efficient,
  author = {Nataliya Sokolovska and Thomas Lavergne and Olivier Cappé and François Yvon},
  title = {{Efficient Learning of Sparse Conditional Random Fields for Supervised Sequence Labelling}},
  journal = {IEEE J. Sel. Top. Signal Process.},
  year = {2010},
  url = {https://openreview.net/forum?id=Y62AOK-R4aUR},
}
Figure