Asymptotically unbiased estimation of physical observables with neural samplers

Kim A. Nicoli, Shinichi Nakajima, Nils Strodthoff, Wojciech Samek, Klaus-Robert Müller, Pan Kessel · DOI

TL;DR

Deep generative neural networks are powerful tools for sampling complex physical systems, but they often produce biased results because the learned model never perfectly matches the true physics. This paper introduces a framework using Importance Sampling and Markov Chain Monte Carlo to turn these "imperfect" neural samplers into asymptotically unbiased estimators, providing a mathematically rigorous way to calculate physical observables—including tricky quantities like entropy and free energy—with reliable error bars.

What Problem Does This Paper Address?

In statistical physics, we want to calculate "observables" (like energy or magnetization) of a system by averaging over many possible configurations, weighted by the Boltzmann distribution. Traditionally, Monte Carlo (MC) methods are the workhorses for this, but they struggle near phase transitions (criticality) where they become extremely slow—a phenomenon known as "critical slowing down."

Recently, Generative Neural Samplers (GNS), such as Variational Autoregressive Networks (VANs), have emerged as a fast alternative. They learn to mimic the Boltzmann distribution and can generate new configurations almost instantly. However, there is a catch: a neural network is only an approximation. Even a well-trained GNS will have a slight mismatch with the true target distribution. In physics, this mismatch leads to systematic bias in the results, and until now, there was no standard way to quantify or eliminate this bias, especially for observables that depend on the partition function (the normalization constant of the distribution).

Methods

The authors focus on a subclass of models they call GNSEP (Generative Neural Samplers with Exact Probability). These models, like Normalizing Flows and Autoregressive Models, allow you to not only draw a sample but also calculate the exact probability $q(s)$ of that sample.

They propose two main ways to "unbias" these samplers:

  1. Neural Importance Sampling (NIS): Instead of a simple average, each sample is weighted by the ratio of the true Boltzmann probability to the neural network's probability. The authors derive a new variance estimator for this method that works even for observables like free energy ($F$) and entropy ($S$), which are notoriously difficult to estimate because they depend on the partition function $Z$.
  2. Neural MCMC (NMCMC): The neural sampler is used as a "proposal distribution" in a Metropolis-Hastings algorithm. Because the GNS can propose global changes to the system state, it can jump between different energy minima much more effectively than standard local-update MC methods.

Datasets

The researchers evaluated their framework on the 2D Ising model, a classic benchmark in statistical physics that describes magnetism on a lattice. They tested lattices of size $16 \times 16$ and $24 \times 24$. The Ising model is an ideal test case because it has exact analytical solutions, providing a "ground truth" to measure the bias of different methods.

Key Insights and Ideas

  • Correcting for Imperfection: You don't need a perfectly trained neural network to get perfect physics. The NIS and NMCMC layers act as a corrective filter. As long as the network is "good enough" to cover the relevant parts of the configuration space, the estimators will converge to the true value.
  • Transfer Learning across Temperatures: A model trained at one temperature can be used to estimate observables at a slightly different temperature via reweighting. This allows researchers to probe a range of temperatures without retraining the model from scratch for every single point.
  • Breaking Autocorrelation: Standard Metropolis algorithms often get stuck in one "mode" (e.g., all spins up). Because NMCMC samples globally from the neural network, it can capture multiple modes simultaneously, as shown in the magnetization histograms.
Magnetization histograms showing that NMCMC captures both modes of the distribution, while standard Metropolis gets stuck in one.

Key Results

  • Bias Elimination: While raw VAN estimates deviated significantly from the ground truth (especially for the $24 \times 24$ lattice), the NIS and NMCMC results matched the exact analytical values within one standard deviation.
  • Superiority near Criticality: Near the critical temperature $\beta_c$, where standard methods fail, the proposed framework remained robust.
FIG. 1. Estimates for various observables around βc. NMCMC and NIS agree with the reference values provided by the exact analytical solutions as well as the Wolffalgorithm. VAN deviates significantly. Observables are: internal energy U = Ep[H], absolute magnetization |M| = P
  • Efficiency: NMCMC showed a significant reduction in "integrated autocorrelation time" compared to the standard Metropolis algorithm. For internal energy, the autocorrelation time dropped from ~4.0 to ~0.8, meaning fewer samples are needed to get a reliable estimate.
Evolution of acceptance rate and autocorrelation during training. As the model improves, the acceptance rate for NMCMC climbs, and the autocorrelation time plummets.

Limitations and Future Work

  • Training Bottleneck: The primary computational cost is the initial training of the neural network. While the sampling is fast, the training for larger lattices (like $24 \times 24$) took up to 75 hours on high-end GPUs.
  • Discrete vs. Continuous: The current work focused heavily on discrete systems (Ising model). While the authors mention that Normalizing Flows can handle continuous systems (like lattice field theories), more empirical work is needed to see how these unbiased estimators scale in those domains.
  • Scaling to Larger Systems: As the system size increases, the "overlap" between the neural distribution and the target distribution tends to decrease, which could lead to higher variance in the NIS weights. Finding architectures that maintain high overlap for very large systems remains an open challenge.

Summary updated

BibTeX
@inproceedings{nicoli2020asymptotically,
  author = {Kim A. Nicoli and Shinichi Nakajima and Nils Strodthoff and Wojciech Samek and Klaus-Robert Müller and Pan Kessel},
  title = {{Asymptotically unbiased estimation of physical observables with neural samplers}},
  booktitle = {Physical},
  year = {2020},
  doi = {10.1103/physreve.101.023304},
}
Figure