article Open access

Compiling Probabilistic Programs for Variable Elimination with Information Flow

  • Proceedings of the ACM on Programming Languages
  • Association for Computing Machinery
Research footprint

At a glance

Citations
6
References
61
Comments
0
Paper overview

Abstract

A key promise of probabilistic programming is the ability to specify rich models using an expressive programming language. However, the expressive power that makes probabilistic programming languages enticing also poses challenges to inference, so much so that specialized approaches to inference ban language features such as recursion. We present an approach to variable elimination and marginal inference for probabilistic programs featuring bounded recursion, discrete distributions, and sometimes continuous distributions. A compiler eliminates probabilistic side effects, using a novel information-flow type system to factorize probabilistic computations and hoist independent subcomputations out of sums or integrals. For a broad class of recursive programs with dynamically recurring substructure, the compiler effectively decomposes a global marginal-inference problem, which may otherwise be intractable, into tractable subproblems. We prove the compilation correct by showing that it preserves denotational semantics. Experiments show that the compiled programs subsume widely used PTIME algorithms for recursive models and that the compilation time scales with the size of the inference problems. As a separate contribution, we develop a denotational, logical-relations model of information-flow types in the novel measure-theoretic setting of probabilistic programming; we use it to prove noninterference and consequently the correctness of variable elimination. CCS Concepts: • Theory of computation <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" display="inline"> <mml:mo>→</mml:mo> </mml:math> Probabilistic computation; Program semantics; Program reasoning; Type theory; • Mathematics of computing <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" display="inline"> <mml:mo>→</mml:mo> </mml:math> Bayesian computation; Statistical software; • Computing methodologies <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" display="inline"> <mml:mo>→</mml:mo> </mml:math> Machine learning; • Software and its engineering <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" display="inline"> <mml:mo>→</mml:mo> </mml:math> Compilers; Functional languages; Language features; Formal language definitions .

Record transparency

Publication details

DOI
10.1145/3656448
OpenAlex
W4399851487
Document type
article
Language
EN
Source
Proceedings of the ACM on Programming Languages
Last metadata update
Community

Comments

Log in to join the discussion.

  1. No comments yet. Start the discussion.