Monte Carlo Estimation

Monte Carlo estimation approximates expectations with samples. It appears in evaluation, simulation, generative modeling, reinforcement learning, uncertainty estimation, and approximate inference.

For a random variable and function , the target expectation is:

With samples , the Monte Carlo estimator is:

The estimator variance decreases with sample count:

Key Ideas

  • Monte Carlo replaces an integral or expectation with an empirical average.
  • More samples reduce variance but increase compute cost.
  • Biased sampling requires correction if the goal is an expectation under another distribution.
  • Seed, sample count, and sampling distribution are part of the experimental protocol.
  • Many reported metrics are Monte Carlo estimates over data examples, seeds, generated samples, or rollouts.

Estimation Contract

FieldQuestion
Target expectationWhat quantity is being estimated?
Sampling distributionWhere do samples come from?
Sample countHow many examples, seeds, rollouts, or generated samples?
IndependenceAre samples independent, paired, batched, or correlated?
FilteringWere failed or invalid samples removed?
UncertaintyIs a confidence interval or standard error reported?

The standard error for independent samples is:

where:

Importance Sampling

If samples come from but the target expectation is under :

The estimator is:

Large or unstable weights can make the estimate high variance.

AI and Computational Biology Uses

UseSamplesCommon Trap
generative model evaluationgenerated samplesfiltering invalid samples changes the denominator
diffusion or flow samplingrandom seeds and solver pathssample quality depends on step budget
uncertainty estimationmodel samples or posterior samplescorrelated samples overstate certainty
RL or agent evaluationrolloutsfew tasks or seeds give noisy estimates
virtual screeningcandidate library draws or top-K subsetsactive prevalence changes enrichment
molecular simulationtrajectory framesautocorrelation reduces effective sample size

For correlated samples, the effective sample size can be much smaller than the raw sample count.

Practical Checks

  • What distribution are samples drawn from?
  • How many samples are used, and is the estimate stable?
  • Are samples independent or correlated?
  • Is the estimator biased by filtering, truncation, rejection, or selection?
  • Is uncertainty reported with confidence intervals or repeated runs?
  • Are random seeds and sampling budgets fixed across methods?
  • Are failed generations, failed simulations, or invalid outputs part of the reported denominator?