On Prediction Using Variable Order Markov Models

Ron Begleiter, Ran El-Yaniv, Golan Yona

Abstract

Variable Order Markov Models (VMMs) provide a flexible framework for sequence prediction and classification by capturing dependencies of varying lengths. This study presents a comprehensive empirical evaluation of six prominent VMM algorithms—LZ78, PPM, CTW, DE-CTW, PST, and LZ-MS—across diverse domains including English text, MIDI music, and protein sequences. Our results reveal a significant performance gap between prediction and classification tasks: while Decomposed CTW (DE-CTW) and PPM-C excel at probability estimation, a modified Lempel-Ziv algorithm (LZ-MS) demonstrates superior robustness in complex protein classification. We further demonstrate the necessity of alphabet decomposition for handling large symbol sets and discuss the implications of sequence complexity across different data types.

Introduction

Predicting the next symbol in a discrete sequence is a fundamental challenge in machine learning, with applications ranging from natural language processing to bioinformatics. Traditional Hidden Markov Models (HMMs) often require extensive domain knowledge and large training sets. Variable Order Markov Models (VMMs) offer a data-driven alternative by dynamically adjusting the context length based on observed statistics. Despite their popularity, the relative performance of different VMM variants across varied real-world datasets has remained under-explored. This paper addresses this gap through a rigorous head-to-head comparison of six leading algorithms.

Methods

The authors evaluate six prominent VMM algorithms using a unified notation: LZ78, PPM (Method C), Context Tree Weighting (CTW), Decomposed CTW (DE-CTW), Probabilistic Suffix Trees (PST), and LZ-MS. These models represent different approaches to context selection and probability estimation. Performance is primarily measured using average log-loss, which quantifies the bits required to encode each symbol.

A visual representation of a Variable Order Markov Model's context tree, showing how symbol counts are maintained across varying context depths.

The evaluation spans three distinct domains to ensure generalizability:

  • English Text: The Calgary Corpus (18 sequences), a standard benchmark for compression.
  • Music: 285 MIDI files covering classical, jazz, and rock, represented as sequences of pitch, volume, and duration.
  • Proteins: Approximately 20,000 amino-acid sequences from the SCOP database, categorized into hierarchical folds and families.

Results

Our analysis yields several key insights into the behavior of VMMs in practice:

Prediction vs. Classification

A striking finding is that the optimal model for prediction is not necessarily the best for classification. DE-CTW and PPM-C were the top performers in prediction tasks, achieving the lowest log-loss in text (3.02 and 3.03 bits/symbol respectively) and music. However, LZ-MS emerged as the consistent winner in protein fold classification with an 85% accuracy rate, significantly outperforming the more precise predictors.

Alphabet Decomposition and Complexity

Standard CTW algorithms often struggle with large alphabets, such as the 20 amino acids in proteins. The "Decomposed" version (DE-CTW) addresses this by breaking the prediction problem into a tree of binary choices, which significantly boosts performance in high-entropy domains.

Furthermore, the study highlights the inherent difficulty of biological sequences; in raw prediction tasks, no VMM significantly outperformed a simple background frequency model for proteins. This suggests that protein chains lack the local repetitive structures easily exploited by standard VMMs. In contrast, musical complexity varied by genre, with Mozart pieces being the most predictable and jazz improvisations among the most difficult.

Discussion

While DE-CTW and PPM-C are powerful general-purpose predictors, their lack of formal redundancy bounds remains a theoretical gap. The success of LZ-MS in classification suggests that robustness to outliers and the ability to extract robust statistics from short sequences may be more critical than average-case precision in "winner-takes-all" classification scenarios. Future research should explore adaptive weighting schemes to combine the strengths of different VMM architectures for more robust sequence learning across diverse data types.

Summary updated

BibTeX
@article{begleiter2004prediction,
  author = {Ron Begleiter and Ran El-Yaniv and Golan Yona},
  title = {{On Prediction Using Variable Order Markov Models}},
  journal = {J. Artif. Intell. Res.},
  year = {2004},
  doi = {10.1613/jair.1491},
}
Figure