Introduction
Markov models, particularly $n$-grams, are the bread and butter of sequence modeling in NLP, bioinformatics, and compression. However, they face a fundamental trade-off:
- Fixed-order models (where $n$ is constant) suffer from the "curse of dimensionality." As $n$ increases, the number of parameters grows exponentially, leading to data sparsity and memory overflow.
- Variable-order models usually rely on "post-hoc" pruning—building a massive tree and then cutting branches based on heuristics like KL-divergence. This is theoretically shaky, manually intensive, and computationally expensive.
To address these issues, the authors propose the Infinite Markov Model (IMM), a nonparametric Bayesian approach that learns variable-order Markov dependencies of theoretically infinite depth. By extending a stick-breaking prior "vertically" over a suffix tree, the model automatically determines the optimal context length for every symbol in a sequence, outperforming fixed-order models while remaining computationally efficient. The IMM creates a complete generative model that treats the Markov order as a hidden variable to be inferred directly from the data.
Methods
The IMM builds upon the Hierarchical Pitman-Yor Language Model (HPYLM), which uses a suffix tree where each node represents a context. The key innovations include:
Vertical Stick-Breaking Prior
Traditionally, stick-breaking processes are used to assign probabilities to a set of categories on a unit interval. Here, the authors apply it "vertically" down the branches of a suffix tree.
Each node $i$ has a "stopping probability" $q_i$. The probability of stopping at a specific depth $l$ is the product of "penetrating" through all previous levels and then stopping.
Inference and Efficient Data Structures
Since the true Markov order for each symbol is unknown, the authors use a Gibbs sampler to iteratively estimate the hidden orders ($n$) and the seating arrangements within the underlying Chinese Restaurant Process. To handle the potentially infinite depth, the authors use Splay Trees at each node. These self-organizing trees keep frequent items at shallower levels, optimizing search time for power-law distributed data like natural language.
Key Insights and Results
The model was evaluated on three distinct types of data: Alice in Wonderland (character-level), the NAB Wall Street Journal Corpus (word-level), and the NIPS Papers Dataset (for a topic model extension).
The "Penetration" Concept and Stochastic Phrases
The model learns a "penetration probability" for different contexts. For common phrases (e.g., "the united states of"), the model learns to "penetrate" deep into the tree because the long-range dependency is highly predictive. For generic grammar, it stops at shallower depths.
Unlike previous variable-order models that required manual thresholds for pruning, the IMM integrates the order selection into the Bayesian framework. The model only adds deep nodes when the data provides enough evidence to justify the extra complexity. A fascinating byproduct of the IMM is the ability to induce "stochastic phrases." By looking at subsequences with high penetration probabilities, the model identifies cohesive units like "at the same time" without being explicitly told what a "phrase" is.
Performance Improvements
- Perplexity: In character-level modeling, the infinite model ($n=\infty$) achieved a perplexity of 3.502, significantly better than a 3rd-order model (6.048). On the WSJ corpus, it achieved the lowest overall perplexity (100.36).
- Memory Efficiency: Standard HPYLM models encountered memory overflows at $n=7$ or $n=8$ on the WSJ corpus. The IMM ($n=\infty$) avoided these overflows by only creating necessary nodes.
- Speed: Despite the added complexity of sampling the Markov order, the IMM's inference was roughly 20% faster than a fixed 8th-order HPYLM because it avoids processing unnecessarily deep, sparse branches.
Limitations and Future Work
The authors note that while the IMM is powerful, the extension into topic modeling was somewhat limited by a small number of latent topics to avoid data sparseness. They suggest that future work should involve more flexible topic models where the number of topics can vary from node to node within the suffix tree. Additionally, while the model is theoretically infinite, practical implementations still use a small threshold ($\epsilon$) to truncate extremely low-probability deep branches.
Summary updated