[Paper Review] On the Pitfalls of Nested Monte Carlo
This paper analyzes nested Monte Carlo (NMC) methods for estimating expectations involving intractable inner expectations, proving that general-purpose NMC schemes are inherently biased and suffer from reduced convergence rates. It establishes conditions for convergence, derives theoretical rates, and validates them empirically, warning against naive composition of inference and models in probabilistic programming and experimental design.
There is an increasing interest in estimating expectations outside of the classical inference framework, such as for models expressed as probabilistic programs. Many of these contexts call for some form of nested inference to be applied. In this paper, we analyse the behaviour of nested Monte Carlo (NMC) schemes, for which classical convergence proofs are insufficient. We give conditions under which NMC will converge, establish a rate of convergence, and provide empirical data that suggests that this rate is observable in practice. Finally, we prove that general-purpose nested inference schemes are inherently biased. Our results serve to warn of the dangers associated with naive composition of inference and models.
Motivation & Objective
- To investigate the theoretical behavior of nested Monte Carlo (NMC) schemes where the outer expectation depends on an intractable inner expectation.
- To identify conditions under which NMC estimators converge and to quantify their convergence rates.
- To demonstrate that general-purpose NMC inference is inherently biased, even when inner and outer estimators are unbiased individually.
- To validate theoretical convergence rates through empirical evaluation on a synthetic model with known ground truth.
- To caution against naïve composition of inference and models in probabilistic programming systems, especially for nonlinear functions of marginal expectations.
Proposed method
- Formulates the nested expectation problem as $ I = \mathbb{E}_{y \sim p(y)}[f(y, \gamma(y))] $, where $ \gamma(y) = \mathbb{E}_{z \sim p(z|y)}[\phi(y,z)] $, and approximates both expectations via Monte Carlo sampling.
- Proposes a two-level Monte Carlo estimator $ I_{N,M} = \frac{1}{N}\sum_{n=1}^N f(y_n, \hat{\gamma}_{M,n}) $, with $ y_n \sim p(y) $, $ z_{n,m} \sim p(z|y_n) $, and $ \hat{\gamma}_{M,n} = \frac{1}{M}\sum_{m=1}^M \phi(y_n, z_{n,m}) $.
- Establishes convergence under mild regularity conditions on $ f $, showing that $ \mathbb{E}[I_{N,M}] \to I $ as $ N, M \to \infty $, with convergence rate $ O(1/\sqrt{N}) + O(1/\sqrt{M}) $.
- Proves that any general-purpose NMC scheme must be biased by showing that no unbiased estimator exists for nonlinear functions of inner expectations unless the problem can be reformulated as a single expectation.
- Uses a counterexample based on the expected information gain in Bayesian experimental design to illustrate the impossibility of unbiased estimation for nonlinear functionals of marginals.
- Empirically validates theoretical convergence rates using a synthetic model with $ y \sim \text{Uniform}(-1,1) $, $ z \sim \mathcal{N}(0,1) $, $ \phi(y,z) = \sqrt{2/\pi} \exp(-2(y-z)^2) $, and $ f(y, \gamma(y)) = \log(\gamma(y)) $, showing observed rates match $ O(1/\sqrt{T}) $.
Experimental results
Research questions
- RQ1Under what conditions does a nested Monte Carlo estimator converge to the true expectation?
- RQ2What is the theoretical convergence rate of nested Monte Carlo estimators, and does it match empirical observations?
- RQ3Why is general-purpose nested inference inherently biased, even when inner and outer estimators are unbiased?
- RQ4Can nonlinear functionals of marginal distributions (e.g., entropy of a posterior) be estimated without bias using standard NMC?
- RQ5To what extent do practical NMC implementations suffer from slow convergence and bias in real-world applications like Bayesian experimental design?
Key findings
- Nested Monte Carlo estimators converge to the true expectation under mild regularity conditions on the outer function $ f $, but convergence is guaranteed only if the inner estimator's sample size $ M $ grows with $ N $.
- The convergence rate of NMC is bounded by $ O(1/\sqrt{N}) + O(1/\sqrt{M}) $, which is significantly slower than the $ O(1/\sqrt{N}) $ rate of standard Monte Carlo.
- General-purpose nested inference schemes are inherently biased for nonlinear functionals of inner expectations, such as $ \mathbb{E}[\log(\mathbb{E}[\phi(y,z)|y])] $, even if both inner and outer estimators are unbiased.
- Empirical results on a synthetic model with known solution confirm that the theoretical convergence rate of $ O(1/\sqrt{T}) $ is observable in practice, validating the theoretical bounds.
- The bias arises fundamentally from the nonlinearity of $ f $, and cannot be eliminated by independent sampling in the outer and inner levels, even when both estimators are unbiased.
- Reformulating the problem as a single expectation (e.g., via auxiliary variables) is only possible in special cases (e.g., linear $ f $), and fails for general nonlinear functionals like entropy or information gain.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.