Learning to sample from complex unnormalized distributions is a fundamental challenge in computational physics and machine learning. While score-based and variational methods have achieved success in continuous domains, extending them to discrete or mixed-variable systems remains difficult due to ill-defined gradients or high variance in estimators. We propose a unified, target-gradient-free generative sampling framework applicable across diverse state spaces. Building on the fact that detailed balance implies the time-reversibility of the equilibrium stochastic process, we enforce this symmetry as a statistical constraint. Specifically, using a prescribed physical transition kernel (such as Metropolis-Hastings), we minimize the Maximum Mean Discrepancy (MMD) between the joint distributions of forward and backward Markov trajectories. Crucially, this training procedure relies solely on energy evaluations via acceptance ratios, circumventing the need for target score functions or continuous relaxations. We demonstrate the versatility of our method on three distinct benchmarks: (1) a continuous multi-modal Gaussian mixture, (2) the discrete high-dimensional Ising model, and (3) a challenging hybrid system coupling discrete indices with continuous dynamics. Experiments show that our framework accurately reproduces thermodynamic observables and captures mode-switching behavior across all regimes, offering a physically grounded and universally applicable alternative for equilibrium sampling.
Figures & tables
Figure 1: Qualitative results on the 2D Gaussian mixture. Top-left: Ground truth target density. Top-right: Learned density by our model. Bottom row: Marginal distributions along the first (left) and second (right) dimensions. The learned density accurately captures both modes and their relative weights.
Figure 2: Training curves
Figure 3: Visual evaluation of the generative fidelity on the balanced double-well system. (a) Conditional distributions of the continuous coordinate x given the discrete mode k . The generated samples perfectly align with the theoretical probability density functions across all three modes ( μ∈{1.0,9.0,25.0} ), demonstrating the model’s precise capture of local well geometries and thermal fluctuations. (b) The marginal distribution of x aggregated over all modes. The symmetric and globally matched profile confirms the absence of mode collapse and validates the balanced exploration of the phase space.
Metric
Generated (Ours)
Discrete Mode Selection
Mode L1 Error ∑∣Pgen(k)−Ptrue(k)∣
0.0382
Continuous Fidelity (Conditional on modes)
Mean Conditional W1
0.0399
Global & Joint Distribution
Marginal W1 w.r.t x
0.0886
Table 1: Comprehensive quantitative evaluation on the Balanced Double-Well system ( μ∈{1.0,9.0,25.0} ). We report errors across discrete mode selection, conditional continuous moments, and global distribution distances.
Figure 4: Generative fidelity for the 2D Ising Model in the high-temperature phase ( L=3,β=0.2 ). (Top-left) Magnetization distribution showing a disordered state centered at zero. (Top-right) Energy distribution matching the theoretical spectrum. (Bottom) Probabilities of the Top-100 most likely configurations, demonstrating exact alignment with analytical enumeration.
Figure 5: Generative fidelity for the 2D Ising Model in the low-temperature phase ( L=3,β=0.5 ). (Top-left) Magnetization distribution capturing the broadened profile indicative of ordered states. (Top-right) Energy distribution properly shifted to lower states. (Bottom) Top-100 configuration probabilities, maintaining alignment despite stronger spin correlations.
Metric
Ground Truth
Generated (Ours)
Error / Diff.
High-Temperature Disordered Phase ( β=0.2 )
Energy ⟨E⟩
−4.8429
−4.8211
0.45% (Rel.)
Abs Magnetization ⟨∣m∣⟩
0.4600
0.4572
0.0028 (Abs.)
Specific Heat Cv
1.3672
1.3748
0.56% (Rel.)
Susceptibility χ
0.1486
0.1493
0.47% (Rel.)
Total Variation (TV) Error
0.0000
0.0331
0.0331 (Abs.)
Table 2: Quantitative analysis of generative performance on the 2D Ising model across different thermodynamic phases. Metrics are computed over 200,000 generated samples and compared against exact analytical values.
Sampling from discrete, unnormalized distributions without access to data is a challenging problem. Neural samplers offer a promising approach by training generative models from density evaluations directly. Despite recent progress, existing discrete neural samplers are prone to mode collapse, come without convergence guarantees when trained via fixed-point iterations, and are often tied to a specific reference process such as masked or uniform diffusion. In this work, we introduce Discrete Gibbs Iterative Neural Sampler, a fixed-point neural sampler that addresses these limitations, enabling efficient, scalable learning, substantially reducing mode collapse in practice. Our framework builds on masked diffusion and also extends to transport between pairs of distributions. We demonstrate that the resulting method scales effectively to high-dimensional systems, supports amortized sampling across different conditions, and enables accurate estimation of alloy phase diagrams.
Sampling high-dimensional probability distributions is a central task in scientific computing, with applications ranging from Bayesian inference to statistical physics and molecular simulation. Despite decades of methodological developments, two major challenges remain: scaling to high dimensions and efficiently exploring multimodal distributions characterized by metastable states. Classical approaches such as Markov chain Monte Carlo, tempering methods, or enhanced sampling based on collective variables have achieved major successes, but they also face intrinsic limitations. This tutorial review explores a new paradigm that has recently emerged at the interface of machine learning and computational statistical physics: the use of generative models as tools for sampling. In this context, models such as normalizing flows and diffusion models are not used in their traditional data-driven setting, but rather as flexible probabilistic models that can assist the sampling of distributions known only up to a normalization constant. This manuscript reviews the early development of this rapidly evolving field and discusses several methodological directions, including exact samplers based on generative models and strategies to train such models in the absence of data. While an exhaustive survey of the literature is not attempted, we present a selection of key ideas and methods, along with a discussion of their strengths and limitations. The review is intended to be an accessible tutorial for both physics and machine learning audiences, and it aims to provide a starting point for researchers interested in exploring this exciting area of research.
Marylou Gabrié
Laboratoire de Physique Statistique, École normale supérieure, PSL Research University, 24 rue Lhomond, 75005 Paris, France
Sampling from unnormalized distributions over large discrete state spaces becomes difficult when a multimodal target is far from a tractable reference. We introduce Iterative Exact Discrete Guidance (IEDG), a population-exact, trajectory-wise guidance framework for unnormalized discrete targets. Rather than learn the full reference-to-target correction in one step, IEDG introduces a global Boltzmann tilt along an annealing trajectory. Each stage learns a stage-local posterior correction for an incremental Boltzmann tilt of the current source, while the resulting corrections are accumulated relative to a fixed analytic posterior. At the population optimum, exact stage posteriors recover the correct reverse dynamics, whose exact simulation reproduces the target distribution. IEDG chooses stage increments by relative effective sample size (rESS), which controls Rényi-2 displacement and locally adapts the step size to the thermodynamic geometry of the annealing path. Our stagewise total-variation analysis shows that limited overlap amplifies Bregman fitting error by 1/rESS, while posterior, simulation, and truncation errors enter additively. IEDG improves all distribution-level errors over the neural baselines on ordered, exactly enumerated Ising 4×4, while substantially reducing one-shot errors on Ising/Potts 16×16 across thermodynamic regimes and attaining the best neural-sampler result on several reported local-statistic and phase-coverage metrics. On Max-Cut, its best-of-512 and average-sample ratios exceed all the baselines. Code and artifacts are available at https://github.com/StillFantasy123/iterative-exact-discrete-guidance.
Yuwen Qian, Yidong Ouyang, Zhengyan Wan +1
School of Science and Engineering, The Chinese University of Hong Kong, Shenzhen · Department of Statistics, University of California, Los Angeles · School of Data Science, The Chinese University of Hong Kong, Shenzhen