TRAMP: Compositional Inference with TRee Approximate Message Passing

Antoine Baker, Benjamin Aubin, Florent Krzakala, Lenka ZdeborováarXiv 2020

Introduction

In high-dimensional statistics and machine learning, Approximate Message Passing (AMP) algorithms are highly valued for their computational efficiency and theoretical optimality. However, a significant barrier to their widespread adoption is the mathematical overhead required to derive new algorithms and their corresponding "State Evolution" (SE) equations whenever a model structure changes.

TRAMP (Tree Approximate Message Passing) addresses this challenge by providing a modular Python framework that automates both inference and theoretical performance analysis for high-dimensional, tree-structured probabilistic models. By unifying disparate AMP variants under the umbrella of Expectation Propagation (EP), TRAMP allows researchers to compose complex models from simple building blocks while automatically generating the necessary mathematics to predict performance.

The TRAMP Framework

The core philosophy of TRAMP is modularity. The software represents probabilistic models as tree-structured factor graphs where nodes represent priors, likelihoods, or linear channels. This structural restriction is strategic: on tree graphs, the "free energy" of the system decomposes perfectly, allowing for local computations that remain globally consistent.

Modular factor graph representations for various inference tasks: (a) Generalized Linear Models, (b) Sparse recovery with structured priors, (c) Matrix factorization, (d) Deep neural networks, and (e) Committee machines.

Key Technical Features

  • Expectation Propagation (EP) Engine: TRAMP demonstrates that many popular algorithms, such as GAMP, VAMP, and ML-VAMP, are specific instances of EP applied to different tree topologies. This unification simplifies the implementation of message-passing logic.
  • Automated State Evolution: For every inference module (e.g., a Gaussian prior or a ReLU activation), there is a corresponding SE module. When a user defines a graph, TRAMP automatically composes these SE equations to predict the asymptotic Mean Squared Error (MSE) of the algorithm.
  • Free Entropy Formalism: Drawing from statistical physics, the package estimates "free entropy" to calculate mutual information and identify "hard phases"—regions where inference is theoretically possible but computationally difficult due to local minima.

Compositional Inference in Practice

The power of the framework is most evident in deep compositional tasks. For example, a multi-layer neural network can be represented as a chain of factors. TRAMP handles the message passing through these layers sequentially, maintaining isotropic Gaussian beliefs (summarized by a mean and a single scalar variance) at each step.

Detailed view of a deep chain factor graph, illustrating how TRAMP handles multi-layer compositional models through sequential message passing.

This compositional approach was validated using tasks like MNIST image denoising, where a pre-trained Variational Auto-Encoder (VAE) acts as a structured prior. TRAMP allows for the seamless integration of such complex priors into standard inference pipelines.

Performance and Empirical Results

Benchmarking against traditional methods reveals significant advantages in both speed and accuracy:

  • Efficiency: In high-dimensional sparse linear regression, TRAMP converged in dozens of iterations, outperforming state-of-the-art MCMC samplers like PyMC3 by two orders of magnitude in speed while achieving identical Bayes-optimal accuracy.
  • Theoretical Alignment: Empirical results for compressed sensing and phase retrieval tasks show that the algorithm's MSE perfectly tracks the theoretical State Evolution curves, even for relatively small system sizes (e.g., $N=2000$).
  • Optimality: TRAMP consistently reaches the Bayes-optimal error floor, surpassing heuristic methods like Lasso in sparse recovery scenarios.

Limitations and Future Directions

While TRAMP offers a powerful toolset, it currently operates under specific constraints. The most notable is the requirement that the factor graph remains a tree; it cannot natively handle models with cycles. Additionally, the current implementation focuses on isotropic Gaussian beliefs, which may not capture complex correlations as effectively as diagonal or full-covariance approximations.

Future work aims to extend the framework to more complex belief structures and incorporate Expectation-Maximization (EM) wrappers to automate the learning of model hyperparameters, such as noise levels and prior variances.

Summary updated

Abstract

We introduce Tree-AMP, standing for Tree Approximate Message Passing, a python package for compositional inference in high-dimensional tree-structured models. The package provides a unifying framework to study several approximate message passing algorithms previously derived for a variety of machine learning tasks such as generalized linear models, inference in multi-layer networks, matrix factorization, and reconstruction using non-separable penalties. For some models, the asymptotic performance of the algorithm can be theoretically predicted by the state evolution, and the measurements entropy estimated by the free entropy formalism. The implementation is modular by design: each module, which implements a factor, can be composed at will with other modules to solve complex inference tasks. The user only needs to declare the factor graph of the model: the inference algorithm, state evolution and entropy estimation are fully automated.
BibTeX
@misc{baker2020tramp,
  author = {Antoine Baker and Benjamin Aubin and Florent Krzakala and Lenka Zdeborová},
  title = {{TRAMP: Compositional Inference with TRee Approximate Message Passing}},
  year = {2020},
  eprint = {2004.01571},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2004.01571},
}
Figure