Space-Efficient Inference in Dynamic Probabilistic Networks

John Binder, Kevin P. Murphy, Stuart J. Russell

Abstract

Dynamic probabilistic networks (DPNs) are a useful tool for modeling complex stochastic processes. The simplest inference task in DPNs is monitoring—that is, computing a posterior distribution for the state variables at each time step given all observations up to that time. Recursive, constant-space algorithms are well-known for monitoring in DPNs and other models. This paper is concerned with hindsight—that is, computing a posterior distribution given both past and future observations. Hindsight is an essential subtask of learning DPN models from data. Existing algorithms for hindsight in DPNs use $O(SN)$ space and time, where $N$ is the total length of the observation sequence and $S$ is the state space size for each time step. They are therefore impractical for hindsight in complex models with long observation sequences. This paper presents an $O(S \log N)$ space, $O(SN \log N)$ time hindsight algorithm. We demonstrate the effectiveness of the algorithm in two real-world DPN learning problems. We also discuss the possibility of an $O(S)$-space, $O(SN)$-time algorithm.

Introduction

Dynamic Probabilistic Networks (DPNs), also known as Factorial Hidden Markov Models, are powerful tools for modeling time-series data in complex systems. They allow for tracking and predicting states over time by integrating process models (how states evolve) and sensor models (how observations relate to states). However, a significant hurdle in utilizing DPNs for large-scale problems is the memory requirement for training, specifically the "hindsight" or smoothing task.

The Hindsight Bottleneck

In DPN inference, two primary tasks exist:

  1. Monitoring (Filtering): Estimating the current state based on past observations. This is computationally efficient, requiring only $O(S)$ memory, where $S$ represents the state space size.
  2. Hindsight (Smoothing): Estimating past states given both past and future observations. This is critical for learning model parameters from historical data.
Standard DPN structure showing process and sensor models over time.

Standard hindsight algorithms, such as the forward-backward algorithm, require caching intermediate probability distributions at every time step. For a sequence of length $N$, the memory requirement is $O(SN)$. In real-world applications like the BATmobile car-tracking network, $S$ can be massive (nearly 1 MB per slice), and $N$ can be very large. Storing these distributions can require terabytes of RAM, making training on standard hardware impossible.

The Island Algorithm: A Divide-and-Conquer Approach

To address this memory bottleneck, the authors introduce the Island Algorithm, a space-efficient divide-and-conquer strategy. Instead of performing a single forward pass and caching all $N$ states, the algorithm:

  1. Segments the Sequence: The sequence is divided into $k$ segments by saving only $k-1$ intermediate "checkpoints" or "islands."
  2. Recursive Processing: The hindsight algorithm is applied recursively to each segment, using the saved checkpoints as boundary conditions.
  3. Memory Management: Necessary values are computed, passed to the learning algorithm, and then discarded to free up space.

This approach trades a small amount of computation time for a massive reduction in memory. The space complexity drops from $O(SN)$ to $O(kS \log_k N)$, while the time complexity increases slightly from $O(SN)$ to $O(SN \log_k N)$.

Experimental Validation

The algorithm was evaluated on two distinct DPN models:

  • DNA Network: Models intron/exon coding in DNA sequences. The state space $S$ is approximately 70 KB.
  • Car Network (BATmobile): A complex model for freeway traffic behavior. The state space $S$ is significantly larger, approximately 920 KB per time slice.

Key Results

The Island Algorithm demonstrates a dramatic reduction in space requirements. While memory usage for a statically unrolled network grows linearly with sequence length, the Island Algorithm's memory usage grows logarithmically.

Space complexity comparison on the BATmobile network (mbat.net).

As shown in Figure 4, increasing the recursion depth ($D$) flattens the memory consumption curve significantly. The time penalty remains manageable: for the DNA network ($N=100$), increasing recursion depth from 1 to 3 only increased computation time from 1.5 to 2.6 seconds. This trade-off is highly practical, enabling the processing of complex networks like BATmobile that were previously untrainable due to RAM constraints.

Future Directions

While the Island Algorithm solves the $N$ scaling problem, memory still scales linearly with $S$. Future work may involve storing checkpoints for only a subset of nodes within a time slice, potentially achieving $O(\log N \log S)$ space complexity. Additionally, the authors explore the theoretical possibility of $O(S)$ constant-space hindsight via process inversion, though this remains difficult due to the loss of information in stochastic processes.

Summary updated

BibTeX
@inproceedings{binder1997space,
  author = {John Binder and Kevin P. Murphy and Stuart J. Russell},
  title = {{Space-Efficient Inference in Dynamic Probabilistic Networks}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {1997},
}
Figure