Published February 4, 2026 | Version OOPSLA26-AEC-submission
Software Open

Static Factorisation of Probabilistic Programs With User-Labelled Sample Statements and While Loops

  • 1. ROR icon TU Wien

Contributors

Supervisor:

  • 1. ROR icon TU Wien

Description

It is commonly known that any Bayesian network can be implemented as a probabilistic program, but the reverse direction is not so clear. In this work, we address the open question to what extent a probabilistic program with user-labelled sample statements and while loops – features found in languages like Gen, Turing, and Pyro – can be represented graphically. To this end, we extend existing operational semantics to support these language features. By translating a program to its control-flow graph, we define a sound static analysis that approximates the dependency structure of the random variables in the program. As a result, we obtain a static factorisation of the implicitly defined program density, which is equivalent to the known Bayesian network factorisation for programs without loops and constant labels, but constitutes a novel graphical representation for programs that define an unbounded number of random variables via loops or dynamic labels. We further develop a sound program slicing technique to leverage this structure to statically enable three well-known optimisations for the considered program class: we reduce the variance of gradient estimates in variational inference and we speed up both single-site Metropolis Hastings and sequential Monte Carlo. These optimisations are proven correct and empirically shown to match or outperform existing techniques.

Technical info

You may install the docker images with `docker load -i pplstaticfactor-amd64.tar` and `docker load -i pplstaticfactor-arm64.tar` depending on your system.

Files

PPLStaticFactor-main.zip

Files (3.9 GB)

Name Size Download all
md5:989bd09ba9e19ed0c8d9b27c5ffbfa3f
3.4 GB Download
md5:b21a0c03e605a560d100eda77cca27d1
531.0 MB Download
md5:625d0718dde9903d15521193f104a052
395.5 kB Preview Download
md5:0cf7317e2acaef69336af265b409add7
68.3 kB Preview Download

Additional details

Software

Repository URL
https://github.com/ipa-lab/PPLStaticFactor
Programming language
Python , Julia , JavaScript
Development Status
Concept