Training Restricted Boltzmann Machines on Word Observations

George E. Dahl, Ryan Prescott Adams, Hugo Larochelle

Abstract

Restricted Boltzmann Machines (RBMs) are powerful generative models that have historically been difficult to scale for Natural Language Processing (NLP) due to the high dimensionality of vocabulary-based "one-hot" vectors. This paper presents a scalable training approach for RBMs on large-vocabulary text data. By replacing standard Gibbs sampling with a Metropolis-Hastings (M-H) strategy, the authors achieve computational complexity independent of vocabulary size. The resulting Word Representation RBM (WRRBM) demonstrates state-of-the-art performance in sentiment classification and competitive results in text chunking tasks.

Introduction: The $O(K)$ Bottleneck

In Natural Language Processing, words are typically represented as "one-hot" vectors where the dimension $K$ corresponds to the vocabulary size, often exceeding 100,000 words. Standard RBM training relies on Gibbs sampling to update the "visible" layer. This process requires calculating a probability distribution over the entire vocabulary, resulting in $O(K)$ complexity. For large-scale tasks involving n-gram windows, this linear scaling becomes computationally prohibitive, effectively barring RBMs from high-dimensional language modeling.

Methodology: Scalable Training via Metropolis-Hastings

The authors introduce the Word Representation RBM (WRRBM) and a novel training strategy designed to bypass the $O(K)$ bottleneck. The core innovation is the replacement of exact Gibbs sampling with Metropolis-Hastings (M-H) sampling.

Comparison of RBM architectures for binary and K-ary (word) observations.

Metropolis-Hastings and the Alias Method

Instead of normalizing over all $K$ words, the M-H approach proposes a candidate word from a proposal distribution $q$ and decides whether to accept or reject the swap based on an acceptance ratio. By using the marginal distribution of words in the corpus as the proposal distribution and implementing the alias method, the model can sample a candidate in constant time ($O(1)$). Because the acceptance ratio only requires calculating the energy of the current and proposed states, the overall complexity becomes independent of the vocabulary size $K$.

Efficient Parameterization

To handle n-grams efficiently, the weight matrix is factored into a low-dimensional word embedding matrix (shared across all positions) and position-specific weights. This parameter sharing significantly reduces the model's footprint while maintaining its ability to capture bidirectional context.

Convergence metrics for the Metropolis-Hastings sampler.

As shown in Figure 5, while M-H is an approximate method, it converges toward the target distribution within a few hundred iterations. The authors found that even a few iterations provide a sufficiently accurate learning signal for the model to capture complex syntactic and semantic properties.

Experimental Results

The WRRBM was pre-trained on the English Gigaword corpus (hundreds of millions of word windows) and evaluated on standard NLP benchmarks:

  • Sentiment Analysis: On the IMDb movie review dataset, the WRRBM achieved 89.23% accuracy, setting a new state-of-the-art at the time by outperforming models that relied on significantly more unlabeled data.
  • Text Chunking: The model achieved an F1 score of 94.44 on the CoNLL 2000 task, surpassing other popular embedding methods like C&W and HLBL.
  • Semantic Clustering: Qualitative analysis revealed that the model learned meaningful semantic groupings. For instance, the nearest neighbors for "china" were geographically and politically related terms like "japan," "taiwan," and "russia."

Conclusion

The WRRBM demonstrates that generative models can be scaled to large-scale NLP tasks by optimizing the sampling process rather than the gradient calculation. By making training complexity independent of vocabulary size, RBMs can effectively learn from massive text corpora. Future work may explore more sophisticated, context-dependent proposal distributions to further improve mixing rates and training efficiency for rare linguistic contexts.

Summary updated

BibTeX
@inproceedings{dahl2012training,
  author = {George E. Dahl and Ryan Prescott Adams and Hugo Larochelle},
  title = {{Training Restricted Boltzmann Machines on Word Observations}},
  booktitle = {International Conference on Machine Learning},
  year = {2012},
  url = {https://openreview.net/forum?id=ry4RxnW_bB},
}
Figure