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

Abstract

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.

Publication
The 2nd International Conference on Probabilistic Numerics
Mykola Lukashchuk
Mykola Lukashchuk
PhD student

I am a PhD candidate at the Electrical Engineering department, Eindhoven University of Technology.

Wouter Kouw
Wouter Kouw
Assistant professor

I am an assistant professor working on active inference for mobile robots.

Dmitry Bagaev
Dmitry Bagaev
Postdoctoral researcher

PostDoc at BIASlab.

İsmail Şenöz
İsmail Şenöz
Chief Scientist
LazyDynamics

Ismail Senoz is a co-founder & chief scientist of Lazy Dynamics

Bert de Vries
Bert de Vries
Professor

I am a professor at TU Eindhoven and team leader of BIASlab.