Towards a turnkey approach to unbiased Monte Carlo estimation of smooth functions of expectations

Nicolás Chopin, Francesca R. Crucinio, Sumeetpal S. Singh · DOI

Abstract

Given a smooth function $f$, we develop a general approach to turn Monte Carlo samples with expectation $m$ into an unbiased estimate of $f(m)$. Specifically, we develop estimators that are based on randomly truncating the Taylor series expansion of $f$ and estimating the coefficients of the truncated series. We derive their properties and propose a strategy to set their tuning parameters -- which depend on $m$ -- automatically, with a view to make the whole approach simple to use. We develop our methods for the specific functions $f(x)=\log x$ and $f(x)=1/x$, as they arise in several statistical applications such as maximum likelihood estimation of latent variable models and Bayesian inference for un-normalised models. Detailed numerical studies are performed for a range of applications to determine how competitive and reliable the proposed approach is.

Introduction

In machine learning and Bayesian statistics, researchers frequently encounter the need to estimate $f(E[X])$, where $f$ is a smooth non-linear function—most commonly $\log(x)$ or $1/x$—and $E[X]$ is an expectation estimated via Monte Carlo sampling. A common pitfall is the use of the "plug-in" estimator, $f(\frac{1}{n}\sum X_i)$, which is inherently biased due to Jensen's inequality. While this bias vanishes asymptotically, it can be significant in finite-sample regimes, particularly when these estimates are used within larger algorithms like Stochastic Gradient Descent (SGD).

Previous attempts to solve this using "sum estimators"—which utilize randomly truncated Taylor series—have existed in the literature, but they are notoriously difficult to implement. These methods are highly sensitive to hyperparameters, such as the Taylor expansion point ($x_0$) and the truncation probability ($p$). Poor choices can lead to infinite variance or even infinite computational time. This paper introduces a "turnkey" (automated) approach that stabilizes these estimators and makes them practical for general use.

Methodology

The Cycling Estimator

The standard "simple" sum estimator is computationally wasteful because it only uses a subset of drawn samples to estimate higher-order Taylor terms. This leads to a "variance floor" where the variance of the estimate does not shrink to zero even as the computational budget increases.

To address this, the authors propose the Cycling Estimator. This method reuses all drawn samples by averaging over circular shifts of the data. By extracting more signal from the same sample set, the cycling estimator breaks the variance floor and recovers a convergence rate of $\mathcal{O}(\log(N)/N)$, which is much closer to the standard Monte Carlo rate.

Turnkey Tuning via Bootstrapping

The stability of a sum estimator depends on the expansion point $x_0$ being sufficiently close to the true expectation $m$. If the variance of the samples is high, $x_0$ might fall outside the radius of convergence, causing the estimator to fail. The authors introduce an automated pilot-run strategy to mitigate this:

  1. Bootstrap Analysis: A small initial batch of samples is used to perform statistical bootstrapping.
  2. Parameter Selection: This analysis identifies a safe lower bound for $x_0$ and calculates a truncation probability $p$ that mathematically guarantees the final estimator will have both finite variance and finite execution time.

Experimental Evaluation

The authors evaluated the turnkey approach across several complex statistical tasks:

  • Latent Variable Models (LVM): In toy LVM experiments, the cycling estimator demonstrated superior stability and accuracy compared to both simple sum estimators and Multilevel Monte Carlo (MLMC) methods.
  • Probabilistic ICA: Using 16x16 image patches, the method provided unbiased gradients for SGD. This matched the performance of more complex, specialized algorithms like SAEM while maintaining stable, finite-variance steps.
  • Exponential Random Graph (ERG) Models: The authors achieved a significant milestone by computing an unbiased estimate of the marginal likelihood for an ERG model using the classic Florentine family business dataset. Because ERG models have intractable normalizing constants, providing unbiased evidence estimates is a notable advancement.

Discussion and Limitations

While the proposed method offers a robust framework for debiasing, it is not a silver bullet. The authors note that if the underlying Monte Carlo samples have extremely high variance (e.g., in high-dimensional latent variable models where $d \geq 20$), the computational budget required to guarantee finite variance can become impractical, sometimes exceeding $10^8$ samples. In such scenarios, improving the base sampling strategy remains a prerequisite.

Furthermore, the current mathematical guarantees are tailored specifically for functions where Taylor coefficients behave predictably, such as $\log(x)$ and $1/x$. Functions with super-geometric Taylor coefficient decay, such as $\exp(x)$, would require a different theoretical treatment.

Conclusion

This work transforms sum estimators from a fragile theoretical curiosity into a reliable, automated tool for statistical inference. By guaranteeing finite variance in both the estimate and the runtime, the turnkey approach provides a stable path for unbiased estimation in latent variable modeling and Bayesian inference for intractable distributions.

Summary updated

BibTeX
@inproceedings{chopin2025towards,
  author = {Nicolás Chopin and Francesca R. Crucinio and Sumeetpal S. Singh},
  title = {{Towards a turnkey approach to unbiased Monte Carlo estimation of smooth functions of expectations}},
  booktitle = {Biometrika},
  year = {2025},
  doi = {10.1093/biomet/asaf030},
}
Figure