Hidden-Unit Conditional Random Fields

Laurens van der Maaten, Max Welling, Lawrence K. Saul

Abstract

Conditional Random Fields (CRFs) are a powerful tool for sequence labeling but often struggle with non-linear dependencies in complex data. This paper introduces Hidden-Unit Conditional Random Fields (HUCRFs), which incorporate a layer of binary stochastic hidden units between the input features and the output labels. By leveraging the properties of Restricted Boltzmann Machines within a discriminative framework, HUCRFs achieve universal approximation capabilities while maintaining computational tractability. Experimental results across optical character recognition, protein structure prediction, and natural language processing tasks demonstrate that HUCRFs significantly outperform standard linear CRFs.

Introduction

Sequence labeling is a fundamental task in machine learning, appearing in fields ranging from bioinformatics to computer vision. While linear CRFs have been widely adopted due to their ability to model dependencies between labels without the "label bias" of generative models, their linear nature limits their capacity to capture complex, high-dimensional patterns. Previous attempts to introduce non-linearity via kernels or deep neural networks often suffered from poor scalability or optimization difficulties.

The authors propose the Hidden-Unit CRF (HUCRF) as a solution that bridges the gap between the simplicity of linear models and the representational power of non-linear ones.

The HUCRF Architecture

The core innovation of the HUCRF is the introduction of a hidden layer $z$ at each time step of the sequence. This architecture can be viewed as a hybrid between a CRF and a Restricted Boltzmann Machine (RBM).

Comparison of Linear CRF (a) and Hidden-unit CRF (b) factor graphs.

In a standard linear CRF, the labels $y$ are directly connected to the inputs $x$. In an HUCRF, the hidden units $z$ learn a distributed representation of the input. Crucially, the hidden units are conditionally independent of each other given the input and labels. This independence allows the hidden units to be marginalized out during inference, enabling exact and efficient gradient calculations for training.

Key Properties and Training

HUCRFs possess several unique theoretical and practical properties:

  • Universal Approximation: With a sufficient number of hidden units, the model can theoretically approximate any mapping for discrete data, even ignoring the temporal sequence.
  • The "No Veto" Property: Unlike some non-linear models where a single feature can zero out a probability, hidden units in an HUCRF act cumulatively. A hidden unit can strongly support a label, but if it does not "match," its contribution remains neutral rather than acting as a veto.
  • Discriminative Learning: Unlike RBMs, which are typically trained in an unsupervised manner to reconstruct inputs, HUCRFs are trained discriminatively to maximize the conditional likelihood of the labels, ensuring the learned features are task-relevant.

The models can be trained using various methods, including Maximum Likelihood (via L-BFGS or SGD), Perceptron training, and Large-Margin Perceptron training. The latter is particularly effective at preventing overfitting when using a large number of hidden units.

Experimental Results

The authors evaluated the HUCRF on four diverse datasets: Optical Character Recognition (OCR), FAQ sentence labeling, Protein secondary structure prediction (CB513), and Part-of-Speech (POS) tagging (Penn Treebank).

Error rates across four benchmarks (OCR, FAQ, Protein, POS) comparing Linear CRFs to HUCRFs with varying hidden units and training algorithms.

As shown in the results, HUCRFs consistently outperformed linear baselines. In the OCR task, the error rate dropped from approximately 14% for a linear CRF to just 1.99% for an HUCRF with 1,000 hidden units. Similar improvements were seen in protein structure prediction, where the model achieved a competitive 20.2% error rate. Large-margin training proved to be a robust choice across most tasks, especially as the model complexity increased.

Conclusion

Hidden-Unit Conditional Random Fields provide a principled way to introduce non-linearity into sequence models. By combining the strengths of CRFs and RBMs, they offer a powerful alternative to linear models that is both more accurate and computationally manageable. Future work may involve extending this architecture to more complex graphical structures, such as grids for image processing, or exploring semi-supervised learning techniques.

Summary updated

BibTeX
@article{maaten2011hidden,
  author = {Laurens van der Maaten and Max Welling and Lawrence K. Saul},
  title = {{Hidden-Unit Conditional Random Fields}},
  journal = {AISTATS},
  year = {2011},
}
Figure