Bayes Rule for Conditioning Probabilistic Programs
Feras A. Saad
Key points
From the paper's conclusion- Our Bayes rule handles probabilistic models with loops, branches, discrete, continuous, and mixed-type distributions, observations on manifolds, differentiable structure, and additional modeling motifs that arise in practice.
Abstract
Probabilistic programs provide a rigorous programming-language foundation for expressing rich probabilistic models and offer language-level support for solving challenging statistical inference problems. A key theoretical challenge that probabilistic programs inherit from probability theory is conditioning a probability distribution on an observation that has probability zero. Many languages address this challenge by using computational rules for conditioning that may work well for some problems but are statistically unsound for others. This article introduces a principled mathematical approach for conditioning probabilistic programs. We first show that existing techniques based on "soft conditioning" and "neighborhood limits" exhibit semantic issues from the perspective of measure theory and produce inference results that disagree with sound statistical reasoning. By leveraging tools from geometric measure theory, we construct a novel disintegration-based semantics for probabilistic program traces that enables sound conditioning. The theory delivers an explicit Bayes rule representation of the conditional distribution, which is directly compatible with widely used probabilistic inference algorithms that require access to unnormalized posterior densities. Our Bayes rule handles probabilistic models with loops, branches, discrete, continuous, and mixed-type distributions, observations on manifolds, differentiable structure, and additional modeling motifs that arise in practice.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- Type-Directed Discretization of Probabilistic ProgramsProceedings of the ACM on Programming Languages · 2026
- Sheaf Semantics of Probabilistic ProgramsarXiv · 2026
- A Nonlinear Abstract Domain for Bayesian Neural NetworksarXiv · 2026
- A Hoare Logic for Continuous-Time Stochastic ProcessesarXiv · 2026
- noDice: Inference for Discrete Probabilistic Programs with Nondeterminism and ConditioningProceedings of the ACM on Programming Languages · 2026
- Denotational Semantics for Probabilistic and Concurrent ProgramsACM Transactions on Programming Languages and Systems · 2026