Abstract
The hidden Markov model (HMM) is a fundamental tool for sequence modeling that cleanly separates the hidden state from the emission structure. However, this separation makes it difficult to fit HMMs to large datasets in modern NLP, and they have fallen out of use due to very poor performance compared to fully observed models. This work revisits the challenge of scaling HMMs to language modeling datasets, taking ideas from recent approaches to neural modeling. We propose methods for scaling HMMs to massive state spaces while maintaining efficient exact inference, a compact parameterization, and effective regularization. Experiments show that this approach leads to models that are more accurate than previous HMM and n-gram-based methods, making progress towards the performance of state-of-the-art neural models.
Introduction
In the "pre-deep learning" era of NLP, Hidden Markov Models (HMMs) were a fundamental tool. They are mathematically elegant because they cleanly separate the hidden state (representing latent structure like grammar or intent) from the emission (the actual words). This separation allows for exact posterior inference—a capability that modern Recurrent Neural Networks (RNNs) cannot easily replicate.
However, HMMs fell out of favor for language modeling because they performed poorly compared to neural networks. The primary bottleneck was scaling: the computational complexity of an HMM is $O(T|Z|^2)$, where $T$ is the sequence length and $|Z|$ is the number of hidden states. To achieve high performance, many states are required, but this makes training prohibitively slow. Furthermore, traditional HMMs use "scalar" parameters that do not share information between similar words or states, leading to poor generalization.
Methodology: The Very Large HMM (VL-HMM)
This paper introduces the Very Large HMM (VL-HMM), which utilizes three key innovations to overcome these historical hurdles:
1. Blocked Emissions
To solve the $O(|Z|^2)$ complexity, the authors partition the hidden states into $M$ groups. Each group is only allowed to emit a specific subset of the vocabulary, determined by Brown clusters. This constraint means that at any given time step, the model only needs to consider transitions between a small subset of states ($k = |Z|/M$), reducing the complexity to $O(Tk^2)$.
2. Neural Parameterization
Instead of storing a massive transition matrix, the authors use a small neural network (an MLP) to generate transition and emission probabilities from low-dimensional state and word embeddings. This allows the model to share "knowledge" between similar states and words, mirroring the efficiency of word embeddings in modern LLMs.
3. State Dropout
Borrowing from the neural network playbook, the authors introduced a form of dropout that randomly removes entire states during each training batch. This prevents the model from over-relying on a few "power states" and provides a significant practical speedup during training.
Key Insights and Results
The models were evaluated on standard benchmarks: the Penn Treebank (PTB) and WikiText-2.
Size Matters
The most striking finding is that HMM performance does not plateau early. As the state space scales from $2^{10}$ to $2^{16}$ (65,536 states), the perplexity (PPL) continues to improve significantly, demonstrating that HMMs can benefit from the same scaling laws as neural models.
Performance Benchmarks
- Outperforming Baselines: On the Penn Treebank, the VL-HMM achieved a test perplexity of 116.0, vastly outperforming the traditional Kneser-Ney 5-gram model (141.2) and previous HMM-based approaches (284.6).
- Closing the Gap: While the VL-HMM still trails state-of-the-art LSTMs (which achieve perplexities in the 50s-60s), it represents a massive leap forward for latent-variable models.
- Efficiency: State dropout provided a 4x practical speedup during training and inference by reducing the number of possible transitions the model had to calculate.
Conclusion and Future Work
The VL-HMM demonstrates that classic latent-variable models can be revitalized through modern scaling and parameterization techniques. While they do not yet match the raw predictive power of LSTMs or Transformers, their ability to perform exact inference and provide discrete latent representations makes them valuable for tasks where interpretability is critical. Future work may focus on learning the sparsity structure dynamically rather than using fixed Brown clusters.
Summary updated