Prediction with a short memory

Vatsal Sharan, Sham M. Kakade, Percy Liang, Gregory Valiant

Abstract

Modern machine learning often favors increasingly complex models like Transformers and LSTMs to capture long-range dependencies in sequential data. However, recent theoretical work by Sharan et al. suggests that for a broad class of processes, including Hidden Markov Models (HMMs), a "short memory" approach—relying only on a small window of recent observations—is information-theoretically sufficient to achieve near-optimal average prediction accuracy. This paper explores the relationship between sequence complexity, memory length, and computational feasibility.

Introduction

Sequential prediction is a fundamental task in machine learning, underpinning applications from natural language processing to financial forecasting. The prevailing paradigm assumes that capturing long-range context is essential for high performance. This paper challenges that assumption by asking: how much memory is actually necessary for accurate prediction? By analyzing the mutual information between the past and future of a sequence, the authors establish bounds on the window length required for effective prediction.

The Power of Short Memory

The core finding of the research is that if the mutual information between a sequence's past and future is bounded, a simple $k$-th order Markov model can predict the next observation almost as well as an optimal model with access to the entire history.

A cyclic sequence of binary observations illustrating the type of sequential data analyzed in the study.

The intuition behind this result lies in the concept of "surprise." If a short-memory model predicts poorly, the current observation must contain significant information about the distant past. Because the total mutual information is finite, a predictor cannot be repeatedly surprised. Eventually, the recent history must provide enough context to minimize prediction error.

Theoretical Insights for HMMs

For Hidden Markov Models (HMMs) with $n$ hidden states, the authors prove that a window length of $O(\log n / \epsilon)$ is sufficient to achieve an average prediction error of $\epsilon$. Remarkably, this bound is independent of the HMM's mixing time. Even for processes that never reach a steady state, a short memory can still perform well on average.

The authors utilize martingale arguments to track information gain and complexity reductions to establish lower bounds. They demonstrate that the $O(\log n / \epsilon)$ window length is not just sufficient but information-theoretically optimal.

Computational Complexity and the Learning Gap

While a short window is information-theoretically sufficient, the paper highlights a significant gap between possibility and efficiency. Learning these short-memory models remains computationally challenging as the observation alphabet size ($d$) grows. The number of samples required to estimate the model scales as $d^k$, leading to an exponential dependence on the window length. The authors prove that this hardness is likely unavoidable, reducing the problem to known hard problems like learning parity with noise or refuting Constraint Satisfaction Problems (CSPs).

Conclusion and Future Directions

The study provides a rigorous justification for the surprising effectiveness of simple models on complex data. However, it also notes critical limitations. The results apply to average prediction error, which may not capture performance on rare but vital events where long-range context is indispensable. Future research may focus on alternative metrics that prioritize these informative outliers or explore "robust" distributions that might be easier to learn in practice.

Summary updated

BibTeX
@inproceedings{sharan2018prediction,
  author = {Vatsal Sharan and Sham M. Kakade and Percy Liang and Gregory Valiant},
  title = {{Prediction with a short memory}},
  booktitle = {STOC},
  year = {2018},
  doi = {10.1145/3188745.3188954},
}
Figure