DeGAS: Gradient-Based Optimization of Probabilistic Programs without Sampling
Francesca Randone, Romina Doz, Mirco Tribastone, Luca Bortolussi
TL;DR
DeGAS provides a sample-free, gradient-based optimization framework for probabilistic programs by introducing a differentiable Gaussian-approximate semantics that smoothly relaxes discrete and measure-zero constructs. It builds on the SOGA Gaussian-mixture semantics to yield closed-form posterior and path probabilities under a vanishing smoothing parameter $oldsymbol{}$, with differentiability in program parameters guaranteed via a moment-matching operator. The authors prove differentiability and convergence, implement the approach in PyTorch, and demonstrate competitive accuracy and runtimes against VI and MCMC on thirteen benchmarks, including challenging continuous-conditioned branching. This enables end-to-end optimization of probabilistic programs without Monte Carlo estimators, offering a principled tool for optimizing discontinuous models and cyber-physical-system-style applications where sampling struggles to converge.
Abstract
We present DeGAS, a differentiable Gaussian approximate semantics for loopless probabilistic programs that enables sample-free, gradient-based optimization in models with both continuous and discrete components. DeGAS evaluates programs under a Gaussian-mixture semantics and replaces measure-zero predicates and discrete branches with a vanishing smoothing, yielding closed-form expressions for posterior and path probabilities. We prove differentiability of these quantities with respect to program parameters, enabling end-to-end optimization via standard automatic differentiation, without Monte Carlo estimators. On thirteen benchmark programs, DeGAS achieves accuracy and runtime competitive with variational inference and MCMC. Importantly, it reliably tackles optimization problems where sampling-based baselines fail to converge due to conditioning involving continuous variables.
