Partition Tree Weighting

Joel Veness, Martha White, Michael Bowling, András György

TL;DR

The Partition Tree Weighting (PTW) technique is a highly efficient meta-algorithm designed to handle sequence prediction and data compression for sources that suddenly change behavior over time (piecewise stationary sources). By performing Bayesian model averaging over a cleverly restricted tree of temporal partitions, PTW achieves near-optimal compression rates with a time complexity of $O(n \log n)$ and a remarkably low space complexity of $O(\log n)$.

What Problem Does This Paper Address?

In real-world data compression and sequence prediction, data generating sources rarely remain static; their underlying statistics drift or change abruptly. These are known as piecewise stationary sources.

To compress or predict this kind of data effectively, algorithms must figure out when the source has changed and adapt their models accordingly. A classic, highly influential approach by Willems uses Bayesian model averaging over all possible partitions of a data sequence. While statistically powerful, this method has a quadratic time complexity ($O(n^2)$), making it far too slow for practical, large-scale applications. Researchers have since developed faster $O(n \log n)$ approximations (like Live-and-Die Coding), but there remains a need for algorithms that offer better practical compression performance without sacrificing these low computational bounds.

Methods

The authors introduce Partition Tree Weighting (PTW), a meta-algorithm that takes a standard base probabilistic model (like the Krichevsky-Trofimov or "KT" estimator) and automatically generalizes it to handle piecewise stationary data.

Instead of averaging over every possible way to slice the data into stationary segments, PTW restricts the search space to a specific class of binary temporal partitions.

  • The Prior: PTW applies a prior weighting heavily inspired by the Context Tree Weighting (CTW) algorithm. This prior strongly biases the model toward partitions that contain long, uninterrupted runs of stationary data, which is highly desirable for data compression.
  • Recursive Efficiency: Because the partitions form a binary tree structure, the algorithm can compute the Bayesian average recursively from the bottom up.
  • Space Optimization: The authors' standout algorithmic trick is recognizing that the access pattern to the context tree is essentially a depth-first traversal. By maintaining a simple stack of size $d$ (where $d \approx \log n$), they reduce the memory overhead of the meta-algorithm to just $O(\log n)$ space, while maintaining $O(n \log n)$ time complexity.

Datasets

The authors evaluated PTW on two types of data:

  1. Synthetic Data: Binary sequences generated by piecewise stationary memoryless sources (successive Bernoulli trials where the probability of a "1" changes at random intervals).
  2. The Calgary Corpus: A standard benchmark dataset for lossless data compression containing a mix of text, object code, and geographic data.

Key Insights and Ideas

  • Bias is a Feature, Not a Bug: By heavily biasing the prior toward simple partitions (fewer change points), PTW perfectly aligns with the realities of data compression, where data typically remains stationary for long stretches before abruptly shifting.
  • Algorithmic Elegance: The reduction of space complexity to $O(\log n)$ is a massive practical win. It means the memory footprint of the PTW meta-algorithm is virtually negligible, leaving the system's RAM entirely available for the underlying base models to use.
  • Tracking Extension: The authors show that PTW isn't just for compression; it can be adapted into a tracking algorithm (switching between a finite set of bounded-memory experts), offering a strong alternative to existing expert-tracking algorithms in online learning.

Key Results

  • Theoretical Guarantees: The authors mathematically prove that PTW's redundancy (the number of extra bits required to encode the data compared to knowing the true data-generating distribution) is bounded by $O(|\mathcal{P}| (\log n)^2)$, where $|\mathcal{P}|$ is the number of stationary segments. This matches the asymptotic bounds of the best existing low-complexity methods.
  • Synthetic Benchmarks: When paired with the KT estimator (PTW-KT), the method noticeably outperformed competitors like Live-and-Die Coding (LAD) and DEC-KT when the number of change points was small to moderate. A Variable Complexity Weighting (VCW) method slightly beat PTW at very high numbers of change points, but VCW was 5x slower.
  • Real-World Compression: When used as a drop-in replacement inside the Context Tree Switching (CTS) compression algorithm, PTW-KT consistently matched or outperformed existing methods on the Calgary Corpus. The most significant improvements (measured in average bits per byte) were observed on non-text files like geo, obj1, obj2, and pic.

Limitations and Future Work

  • Memory Limits for MDL Extraction: The authors note that if one wanted to use PTW to explicitly extract the single best binary temporal partition (using Minimum Description Length principles), they couldn't find a way to avoid building the full context tree in memory. This bumps the space requirement up to $O(n \log n)$, losing the elegant $O(\log n)$ space advantage.
  • Future Work: The authors suggest extending the PTW framework to handle a more general class of loss functions within online learning. They also propose deriving tighter theoretical redundancy bounds specifically for piecewise stationary Markov sources of bounded memory.

Summary updated

BibTeX
@inproceedings{veness2013partition,
  author = {Joel Veness and Martha White and Michael Bowling and András György},
  title = {{Partition Tree Weighting}},
  booktitle = {DCC},
  year = {2013},
  doi = {10.1109/dcc.2013.40},
}
Figure