Optimizing Hidden Markov Language Models: An Empirical Study of Reparameterization and Initialization Techniques

Ivan Lee, Taylor Berg-KirkpatrickNAACL 2025

Abstract

While Hidden Markov Models (HMMs) provide exact inference and interpretability, their training is often hindered by non-convex optimization landscapes. This study investigates the application of neural reparameterization and latent variable distillation (LVD) to improve HMM training. We find that low-rank structural constraints and "warm-start" initializations from teacher models significantly enhance performance and enable scaling, reducing perplexity from approximately 540 to 313 on the SlimPajama dataset.

Introduction

In the current landscape of large language models dominated by Transformers, Hidden Markov Models (HMMs) remain relevant for tasks requiring exact inference and controllable generation. However, unsupervised training of HMMs is notoriously difficult due to local optima. As the number of hidden states increases, the optimization landscape becomes increasingly jagged, often leading to a plateau or degradation in performance for larger models. This work explores whether techniques from neural network optimization—specifically reparameterization and initialization—can overcome these hurdles.

Methods

The study evaluates two main strategies:

  1. Neural Reparameterization (NR): Instead of direct learning, HMM transition and emission matrices are generated via auxiliary structures. The researchers compared various architectures, including MLPs and Transformers, as well as simple low-rank linear factorizations.
  2. Latent Variable Distillation (LVD): This initialization technique uses a pretrained "teacher" model (such as Llama) to generate data embeddings. These embeddings are clustered via k-means to provide an initial state assignment for the HMM, effectively "warm-starting" the latent variables.

Training utilized the AdamW optimizer on 500 million tokens from the SlimPajama dataset, using the Llama 2 tokenizer.

Key Insights

A central discovery is that the effectiveness of neural reparameterization stems primarily from the low-rank structure it imposes rather than the complexity of the neural network itself. Simple linear factorizations performed comparably to deep MLPs, suggesting that smoothing the optimization landscape via rank reduction is the primary driver of success.

Furthermore, the "strength" of the teacher model used for LVD is surprisingly secondary. Models ranging from TinyLlama-1.1B to Llama-2-7B provided similar performance boosts. Even a randomly initialized teacher model offered a better starting point than random HMM initialization, indicating that any consistent structural bias helps the model avoid poor local optima early in training.

Results and Scaling

The combination of NR and LVD led to dramatic improvements. A baseline HMM achieved a perplexity of approximately 540, whereas the optimized versions reached ~313. Crucially, these techniques restored the expected scaling behavior: as the number of parameters (hidden states) increased, the perplexity consistently decreased, whereas standard HMMs often failed to improve with scale.

Perplexity scaling of HMMs with and without reparameterization and LVD.

The impact of LVD was found to be complementary to reparameterization. While NR aids in finding better optima during training, LVD provides a superior starting point and significantly reduces variance across different random seeds, making the training process more robust across various architectures.

Impact of Latent Variable Distillation (LVD) on perplexity across various model architectures.

Conclusion and Future Work

By adopting low-rank reparameterization and teacher-based initialization, HMMs can be trained more effectively at scale. These methods mitigate the optimization challenges inherent in large state-space models, paving the way for more interpretable and mathematically tractable alternatives to purely neural architectures in language modeling. Future work should explore whether these techniques allow HMMs to scale to tens of thousands of states, potentially rivaling small neural LMs in efficiency.

Summary updated

BibTeX
@inproceedings{lee2025optimizing,
  author = {Ivan Lee and Taylor Berg-Kirkpatrick},
  title = {{Optimizing Hidden Markov Language Models: An Empirical Study of Reparameterization and Initialization Techniques}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2025},
  doi = {10.18653/v1/2025.findings-naacl.429},
}
Figure