# Composing Non-Conjugate Factor Graphs with Closed-Form Variational Inference

arXiv: https://arxiv.org/abs/2605.29467 · HTML: https://mlsanity.com/paper/2605.29467/

## Key facts

- Cited by 1 papers in the map (data through 14 Oct 2026).
- Builds on 9 of its 35 references that are in the map.
- First posted on arXiv 28 May 2026.

## Builds on (most cited first, 9 of 9)

- [Denoising Diffusion Probabilistic Models](https://mlsanity.com/paper/2006.11239/) (2020)
- [Variational Inference with Normalizing Flows](https://mlsanity.com/paper/1505.05770/) (2015)
- [Informer: Beyond Efficient Transformer for Long Sequence Time-Series Forecasting](https://mlsanity.com/paper/2012.07436/) (2020)
- [Are Transformers Effective for Time Series Forecasting?](https://mlsanity.com/paper/2205.13504/) (2022)
- [Black Box Variational Inference](https://mlsanity.com/paper/1401.0118/) (2013)
- [The Bayesian Learning Rule](https://mlsanity.com/paper/2107.04562/) (2021)
- [Reactive Message Passing for Scalable Bayesian Inference](https://mlsanity.com/paper/2112.13251/) (2021)
- [The generalized Hierarchical Gaussian Filter](https://mlsanity.com/paper/2305.10937/) (2023)
- [Information Geometry of Variational Bayes](https://mlsanity.com/paper/2509.15641/) (2025)

## Built on by (most cited first, 1 of 1)

- [Information Geometry of Message Passing](https://mlsanity.com/paper/2608.15922/) (2026)

## Abstract (arXiv)

Stacking probabilistic building blocks into deeper architectures typically breaks closed-form inference. We show that closed-form inference can be preserved. We identify five factor-graph primitives: a bilinear factor, an exponential link, a Gamma prior, a Gaussian likelihood, and an equality node, and prove that any model composed from them admits closed-form variational message passing. The construction works because each primitive preserves a small set of message families: under mean-field factorization, messages on Gaussian variables remain Gaussian and messages on precision variables remain Gamma, while the only non-conjugate interface, the exponential link, remains tractable through the Gaussian moment-generating function and the sufficient statistics of the Gamma family. We demonstrate composition at increasing depth, from static ensembles through input-dependent gating to split-branch routing, and show that stacking routing layers encodes arbitrary decision trees, establishing universal function approximation with closed-form inference. Applied to ensemble time-series forecasting, the framework yields a Bayesian mixture of experts in which gating functions are inferred rather than learned, providing calibrated uncertainty over expert selection across five benchmark datasets.
