Proppo: a Message Passing Framework for Customizable and Composable Learning Algorithms

Paavo Parmas, Takuma SenoNeurIPS 2022

Introduction

Modern Machine Learning relies heavily on Automatic Differentiation (AD) frameworks like PyTorch and JAX. While these tools are fantastic for standard neural networks, they are rigid: they force researchers to implement all learning algorithms in terms of standard backpropagation. This paper introduces Proppo, an Automatic Propagation (AP) framework that generalizes standard AD by using a flexible message-passing architecture. By allowing researchers to easily build, compose, and reuse complex learning algorithms that don't fit neatly into standard backpropagation, Proppo enables advanced Monte Carlo gradient estimators that achieve up to a 100x improvement in accuracy for systems at the "edge of chaos."

The Problem: Limitations of Standard Automatic Differentiation

For complex algorithms—like advanced Monte Carlo (MC) gradient estimators—researchers often have to hack standard AD systems by designing differentiable "surrogate losses." However, some algorithms cannot be naturally expressed this way. For example, Total Propagation (TP) combines different gradient estimators dynamically at each step of the backward pass. Implementing this in standard AD is incredibly difficult and results in messy, non-reusable code.

The authors tackle this gap by proposing Automatic Propagation (AP), a paradigm that treats backpropagation as just one specific type of message passing, freeing researchers to define custom forward and backward computations.

Methods: Introducing Proppo and Automatic Propagation

To realize this paradigm, the authors built Proppo, a prototype AP software package that sits on top of PyTorch. Instead of replacing PyTorch, Proppo orchestrates it using a message-passing framework.

Comparison of software approaches

The core components of Proppo are:

  • Propagators: The fundamental building blocks. A propagator encapsulates a specific algorithm with a forward method (which modifies inputs and caches data) and a backward method (which performs computations using the cached data and passes messages backward).
  • Propagation Manager: An orchestrator that constructs the propagation graph, tracks nodes, and routes messages between propagators.
Propagation Manager routing messages
  • Composability: Proppo includes special propagators like ChainProp and ComboProp that allow users to snap multiple propagators together to build highly complex, hierarchical algorithms safely.

To prove the framework's utility, the authors used Proppo to implement several MC gradient estimators as reusable propagators: Reparameterization (RP), Likelihood Ratio (LR), and Total Propagation (TP). TP is particularly notable because it requires computing the variances of LR and RP at each node to perform inverse variance weighting during the backward pass—a task perfectly suited for AP.

Experimental Setup: Testing at the Edge of Chaos

The paper does not use standard ML datasets (like ImageNet or CIFAR). Instead, to evaluate gradient estimators, the authors introduce a minimalistic benchmark: a Chaotic 2D Recurrent Neural Network (RNN). Based on a mathematically proven chaotic system by Wang (1991), the network's dynamics are controlled by an inverse temperature parameter ($\beta$). As $\beta$ increases, the system transitions from well-behaved to chaotic, making it an ideal stress test for gradient variance.

Key Insights and Results

  • Surrogate Losses are Limiting: Forcing stochastic algorithms into differentiable "surrogate losses" restricts algorithm design. Message passing is a much more natural and expressive way to define complex ML algorithms.
  • Graph-Level Combinations Beat Naive Averaging: If you want to combine two gradient estimators (like RP and LR), simply computing them separately and averaging the final result yields minimal gains. However, combining them at each intermediate node during the backward pass (as done in Total Propagation) allows accuracy improvements to compound, leading to massive gains.
  • The "Edge of Chaos" Vulnerability: Standard Reparameterization (RP) gradients are highly accurate in stable systems but fail catastrophically (variance explodes) when a system exhibits chaotic behavior.
  • Orders of Magnitude Improvement: In the chaotic RNN experiment, the Total Propagation (TP) estimator implemented via Proppo improved gradient accuracy by up to 100 times (two orders of magnitude) compared to the best individual estimator (RP or LR) when the system was at the "edge of chaos" ($\beta \sim 2.5$).
  • Low Overhead and Scalability: Benchmarking confirmed that Proppo's message-passing management introduces negligible computational overhead for moderate-sized computations. Furthermore, the framework successfully scales to handle millions of propagation nodes, proving it is a practical tool for real-world ML research.

Limitations and Future Work

Currently, Proppo processes the propagation graph sequentially using a single propagation manager. The authors explicitly note that scalability and speed could be further improved by running multiple propagation managers on the propagation graph in parallel, which they plan to implement in future updates.

Summary updated

BibTeX
@inproceedings{parmas2022proppo,
  author = {Paavo Parmas and Takuma Seno},
  title = {{Proppo: a Message Passing Framework for Customizable and Composable Learning Algorithms}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2022},
  url = {https://openreview.net/forum?id=uOJZ_zU9qZm},
}
Figure