Commutative semantics for probabilistic programming

S Staton - Programming Languages and Systems: 26th European …, 2017 - Springer
S Staton
Programming Languages and Systems: 26th European Symposium on Programming …, 2017Springer
We show that a measure-based denotational semantics for probabilistic programming is
commutative. The idea underlying probabilistic programming languages (Anglican, Church,
Hakaru, etc.) is that programs express statistical models as a combination of prior
distributions and likelihood of observations. The product of prior and likelihood is an
unnormalized posterior distribution, and the inference problem is to find the normalizing
constant. One common semantic perspective is thus that a probabilistic program is …
Abstract
We show that a measure-based denotational semantics for probabilistic programming is commutative.
The idea underlying probabilistic programming languages (Anglican, Church, Hakaru, etc.) is that programs express statistical models as a combination of prior distributions and likelihood of observations. The product of prior and likelihood is an unnormalized posterior distribution, and the inference problem is to find the normalizing constant. One common semantic perspective is thus that a probabilistic program is understood as an unnormalized posterior measure, in the sense of measure theory, and the normalizing constant is the measure of the entire semantic domain.
A programming language is said to be commutative if only data flow is meaningful; control flow is irrelevant, and expressions can be re-ordered. It has been unclear whether probabilistic programs are commutative because it is well-known that Fubini-Tonelli theorems for reordering integration fail in general. We show that probabilistic programs are in fact commutative, by characterizing the measures/kernels that arise from programs as ‘s-finite’, i.e. sums of finite measures/kernels.
The result is of theoretical interest, but also of practical interest, because program transformations based on commutativity help with symbolic inference and can improve the efficiency of simulation.
Springer