Skip to main content
QUICK REVIEW

[Paper Review] Nesting Probabilistic Programs

Tom Rainforth|ArXiv.org|Mar 16, 2018
Bayesian Modeling and Causal InferenceComputer Science25 references4 citations
TL;DR

This paper formalizes query nesting in probabilistic programming, identifies statistical inconsistencies in existing systems, and proposes an online nested Monte Carlo (ONMC) estimator that ensures convergence and improves variance. The key contribution is a statistically consistent framework for nested inference, with ONMC offering better asymptotic variance than fixed estimators while maintaining bias within a factor of two.

ABSTRACT

We formalize the notion of nesting probabilistic programming queries and investigate the resulting statistical implications. We demonstrate that while query nesting allows the definition of models which could not otherwise be expressed, such as those involving agents reasoning about other agents, existing systems take approaches which lead to inconsistent estimates. We show how to correct this by delineating possible ways one might want to nest queries and asserting the respective conditions required for convergence. We further introduce a new online nested Monte Carlo estimator that makes it substantially easier to ensure these conditions are met, thereby providing a simple framework for designing statistically correct inference engines. We prove the correctness of this online estimator and show that, when using the recommended setup, its asymptotic variance is always better than that of the equivalent fixed estimator, while its bias is always within a factor of two.

Motivation & Objective

  • To formalize the concept of nesting probabilistic queries and analyze its statistical implications in probabilistic programming systems (PPSs).
  • To identify that existing PPSs incorrectly handle nested inference, leading to inconsistent estimates, despite correct handling of nested conditioning.
  • To develop a new online nested Monte Carlo (ONMC) estimator that ensures statistical consistency and simplifies implementation for online inference engines.
  • To prove the convergence and improved variance properties of ONMC relative to conventional nested Monte Carlo (NMC) estimators.
  • To demonstrate the practical utility of ONMC through applications in Bayesian experimental design and theory-of-mind modeling.

Proposed method

  • Proposes three distinct nesting categories: nested inference (sampling from conditional distributions), nested conditioning (factoring trace probabilities with partition function estimates), and using expectation estimates as first-class variables.
  • Applies recent nested Monte Carlo (NMC) theory to assess statistical correctness, showing that only nested conditioning is inherently consistent without additional assumptions.
  • Introduces an online NMC (ONMC) estimator that avoids revisiting past samples, enabling efficient and consistent online inference.
  • Derives theoretical convergence rates and asymptotic variance bounds, proving ONMC's asymptotic variance is always better than equivalent fixed estimators.
  • Uses the ONMC framework to implement a consistent estimator for Bayesian experimental design in Anglican, demonstrating practical applicability.
  • Employs importance sampling and weighted sample aggregation to compute partition function estimates, with a macro-based interface for seamless integration into PPSs like Anglican.

Experimental results

Research questions

  • RQ1Can probabilistic programming systems correctly handle nested queries, particularly in cases involving agents reasoning about other agents?
  • RQ2Why do existing PPSs produce inconsistent estimates when nesting queries, and what assumptions are required for convergence?
  • RQ3How can an online nested Monte Carlo estimator be designed to ensure statistical consistency while minimizing computational overhead?
  • RQ4What is the theoretical variance performance of ONMC relative to fixed NMC estimators, and how does it compare in practice?
  • RQ5Can the proposed ONMC framework be applied to real-world problems like Bayesian experimental design with guaranteed convergence?

Key findings

  • The ONMC estimator achieves asymptotic variance that is always better than that of the equivalent fixed NMC estimator under recommended parameter settings.
  • The bias of the ONMC estimator is always within a factor of two of the optimal estimator, ensuring strong theoretical guarantees.
  • Nested inference is statistically challenging and incorrectly handled by existing PPSs, leading to inconsistent estimates, while nested conditioning is inherently correct.
  • Using expectation estimates as first-class variables is equivalent to generic NMC estimation and requires case-by-case analysis for convergence.
  • Empirical results show that ONMC and NMC achieve nearly identical convergence performance, but keeping the inner query sample count fixed leads to persistent bias.
  • The ONMC framework enables consistent inference in complex models such as Bayesian experimental design and theory-of-mind reasoning, as demonstrated in Anglican code examples.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.