Exact Inference for Nested Discrete Probabilistic Programs
Recursive, nested inference queries play a key role in modeling meta-reasoning (e.g., “theory of mind”) and multi-agent planning through probabilistic programming. We introduce a general exact inference method that features hard-conditioning and unbounded recursion. Our method builds on an operational semantics based on Probabilistic Pushdown Automata (pPDA). Our reference programming language, conditioned probabilistic recursive Guarded Command Language (cprGCL), handles discrete, finite-domain variables and allows for unboundedly nested inference queries and unbounded recursive calls. By translating the original cprGCL into a pPDA, nested inference reduces to finding the least fixed point of a monotone system of polynomial equations, known as the termination probabilities of the pPDA. We prove that the pPDA operational semantics is equivalent to a denotational semantics given in terms of distributional transformers.
We have implemented an automated translation of cprGCL into pPDA and numerical methods to solve the inference problem in our tool PPDAInfer, through which we present our approach on a collection of examples.