Putting MRFs on a Tensor Train

Alexander Novikov, Anton Rodomanov, Anton Osokin, Dmitry P. VetrovICML 2014

Overview

This paper introduces a novel framework for mapping Markov Random Fields (MRFs) onto the Tensor Train (TT) format, a highly compact tensor decomposition method. By representing the energy (the negative log-probability) of a graphical model as a TT-tensor, the authors develop efficient algorithms for partition function estimation and MAP inference. This approach provides high accuracy and theoretical guarantees, even for "loopy" models where standard approximate methods traditionally struggle.

The Curse of Dimensionality in Graphical Models

Probabilistic graphical models like MRFs are essential tools in computer vision and machine learning. However, they suffer heavily from the "curse of dimensionality." Representing the joint distribution of thousands of variables as a multi-dimensional array (a tensor) requires an exponential amount of memory.

While these models can often be factorized into small, local potentials, performing inference remains notoriously difficult. Specifically, finding the normalization constant (partition function) or the most likely configuration (MAP inference) is NP-hard for graphs with cycles. Existing approximate methods, such as Loopy Belief Propagation or Mean Field, often fail to provide accuracy guarantees or break down entirely when dependencies between variables are strong.

Methods: Leveraging the Tensor Train Format

The authors tackle this complexity by leveraging the Tensor Train (TT) format, which represents a high-dimensional tensor as a chain of small 3D tensors (called cores). This format allows for efficient linear algebra operations—like addition, summation, and matrix-vector products—without ever needing to expand the full, massive tensor in memory.

Key methodological contributions include:

  1. Energy Decomposition: The authors prove that the energy tensor (the sum of negative log-potentials) of an MRF has low "TT-ranks," meaning it can be stored very compactly.
  2. Algorithm for the Partition Function: Instead of trying to compress the complex probability distribution directly, they decompose individual factors and combine them using a sequence of TT-rounding operations. This allows them to estimate the partition function $Z$ while explicitly controlling the trade-off between computational speed and accuracy.
  3. MAP Inference via DMRG: They adapt the Density Matrix Renormalization Group (DMRG) algorithm—a technique originally developed in quantum physics—to find the minimum element in the energy tensor. This effectively solves the MAP inference problem using iterative linear algebra.

Key Insights and Ideas

  • Log-Space is the Sweet Spot: A major breakthrough in this work is the realization that while the unnormalized probability tensor has very high TT-ranks (making it hard to compress), the energy tensor (its negative logarithm) has low TT-ranks. This occurs because the energy is a sum of local terms, and sums are much "simpler" to represent in the TT-format than products.
Maximal TT-rank comparison between probability and energy tensors
  • Rounding as a Regularizer: The "rounding" operation in the TT-format acts as a principled way to discard insignificant information. This allows the algorithm to maintain a manageable memory footprint while providing a predictable, mathematical bound on the error.
  • Inference as Linear Algebra: By moving the problem into the TT-framework, traditional inference tasks are transformed into standard tensor operations. This opens the door to utilizing highly optimized tools from the numerical linear algebra community.

Key Results

The authors evaluated their approach on several benchmarks, including Ising models (both homogeneous and heterogeneous grids), the WISH dataset, and real-world computer vision benchmarks from Kappes et al. (2013).

  • Superior Accuracy: For partition function estimation, the TT-based method significantly outperformed state-of-the-art methods like Belief Propagation (BP), Mean Field (MF), and Annealed Importance Sampling (AIS). This was especially true in models with strong dependencies where the errors of other methods exploded.
Error comparison of partition function estimation methods
  • Theoretical Bounds: Unlike many approximate methods, the authors provided a computable bound for the absolute error of the partition function, allowing users to know exactly how much they can trust the result.
  • Competitive MAP Inference: On the geo-surf-3 computer vision benchmark, the TT-DMRG approach outperformed the popular TRW-S algorithm in finding lower energy states.
  • Efficiency: Despite being implemented in non-optimized MATLAB, the method successfully handled models with hundreds of variables in mere seconds. An exact representation of those same tensors would have required gigabytes of RAM.

Limitations and Future Work

While highly promising, the framework has a few limitations. The current implementation and theoretical proofs focus primarily on low-order (pairwise) graphical models; extending this to very high-order potentials remains a challenge. Additionally, while memory-efficient, the iterative nature of TT-rounding and DMRG can be computationally slower than simple message-passing algorithms like BP for very simple graphs.

A promising future direction is moving beyond inference to learning. The authors suggest that the TT-format could be used to compute gradients for learning the parameters of the MRF directly from data, opening up new avenues for training complex graphical models.

Summary updated

BibTeX
@inproceedings{novikov2014putting,
  author = {Alexander Novikov and Anton Rodomanov and Anton Osokin and Dmitry P. Vetrov},
  title = {{Putting MRFs on a Tensor Train}},
  booktitle = {International Conference on Machine Learning},
  year = {2014},
  url = {https://openreview.net/forum?id=SyN86o-ubS},
}
Figure