Learning Hidden Markov Models Using Conditional Samples

Gaurav Mahajan, Sham M. Kakade, Akshay Krishnamurthy, Cyril Zhang

Abstract

Hidden Markov Models (HMMs) are essential for modeling sequential data, yet learning them from passive observations is often computationally intractable due to cryptographic hardness barriers. This research demonstrates that by utilizing an interactive conditional sampling access model—where the learner can query future sequences given specific past histories—these barriers can be bypassed. We present a robust, statistical generalization of Angluin’s $L^*$ algorithm that efficiently learns low-rank distributions, including a wide class of HMMs, in polynomial time.

Introduction

Hidden Markov Models (HMMs) serve as a cornerstone for time-series analysis. However, the task of learning an unknown HMM from i.i.d. sequence samples is notoriously difficult. In the worst case, HMMs can encode problems like "parity with noise," which are considered cryptographically hard to solve. Traditional approaches have circumvented this by imposing strict structural assumptions, such as requiring transition matrices to be full-rank.

This paper explores a different paradigm: changing the interaction model between the learner and the data. Inspired by the prompting and fine-tuning of modern language models, the authors investigate whether the ability to ask "what happens next, given this specific past?"—a conditional sampling oracle—is sufficient to make learning any HMM computationally efficient.

Methods

The core contribution is a generalization of Angluin’s $L^*$ algorithm, originally designed for deterministic finite automata, to the stochastic setting of HMMs.

Basis of Histories and Preconditioning

Unlike standard spectral methods that rely on observable operators (which fail in rank-deficient or overcomplete HMMs), this approach identifies a "basis" of histories. The conditional distribution of any future sequence is represented as a linear combination of futures conditioned on this small set of basis histories.

Visualizing the recursive relationship between conditional distributions of future sequences across time steps.

To handle the transition from exact probabilities to noisy samples, the authors introduce a novel preconditioner. This stabilizes the linear systems, which might otherwise have exponentially small singular values, allowing them to be solved reliably via linear regression.

Error Propagation Analysis

A significant challenge in sequence modeling is the exponential compounding of estimation errors over time. The authors address this with a new perturbation argument that tracks errors within the space of basis coefficients rather than using standard matrix norms, ensuring that error bounds remain manageable over long horizons.

Key Insights

  • Interactivity vs. Hardness: Interactive access through conditional prefixes effectively dissolves cryptographic barriers like "parity with noise," enabling efficient structural learning.
  • The Fidelity Parameter: The authors define fidelity, a spectral property indicating if a distribution has a basis where the preconditioned matrix has sufficiently large eigenvalues. This parameter determines the robustness of estimation from noisy samples.
  • Broad Applicability: The "high fidelity" assumption encompasses previously known learnable classes, such as full-rank and certain overcomplete HMMs, while also covering the noisy parity problem.

Results

The paper establishes two primary results:

  1. Exact Oracle Setting: Given an exact conditional probability oracle, any low-rank distribution (including all HMMs) can be learned in polynomial time and queries.
  2. Sampling Oracle Setting: In the realistic conditional sampling setting, any low-rank distribution with "high fidelity" can be learned in polynomial time. The resulting model is guaranteed to be close to the true distribution in Total Variation (TV) distance.

Limitations and Future Work

The primary bottleneck remains the fidelity parameter. If an HMM possesses exponentially small fidelity, the sample complexity of the current algorithm increases significantly. A major open question remains: Is there a computationally efficient algorithm for learning any low-rank distribution using a conditional sampling oracle without the fidelity assumption? Solving this would establish interactive sampling as a universal solution for HMM learning.

Summary updated

BibTeX
@inproceedings{mahajan2023learning,
  author = {Gaurav Mahajan and Sham M. Kakade and Akshay Krishnamurthy and Cyril Zhang},
  title = {{Learning Hidden Markov Models Using Conditional Samples}},
  booktitle = {Conference on Learning Theory},
  year = {2023},
}
Figure