---
title: Generative Gibbs for Physics-Aware Sampling
url: https://www.emergentmind.com/topics/generative-gibbs-for-physics-aware-sampling-gg-pa
type: topic
---

# Generative Gibbs for Physics-Aware Sampling

Generative Gibbs for Physics-Aware Sampling (GG-PA) is a training-free framework for composing pretrained diffusion priors with explicit physical context at inference time by performing Gibbs sampling over an augmented state space that contains both the full physical system and auxiliary prior variables. Rather than requiring a single generative model to represent the entire target ensemble, GG-PA keeps the physical state explicit, couples it to one or more learned partial priors through projection operators, and alternates between prior-conditioned denoising updates and context-aware physical updates. The method is formulated for scientific sampling problems in which the target distribution depends on environmental or interaction variables not represented in the prior, and it is asymptotically exact as the diffusion time approaches zero; in quadratic settings with linear-Gaussian forward kernels, it can remain exact at finite diffusion time [2605.10642].

## 1. Problem setting and augmented-state formulation

GG-PA is motivated by settings in which a pretrained diffusion model encodes only part of the degrees of freedom relevant to the target ensemble. The examples given include a protein backbone, a molecular fragment, or an isolated monomer, whereas the actual target distribution may also depend on solvent, ions, neighboring molecules, fields, or other environmental interactions. In such cases, expressing all additional information as a likelihood or energy over exactly the same variables as the prior can become awkward or intractable, especially when the context already exists as an explicit force field or simulator rather than as a tractable marginal model [2605.10642].

The framework therefore introduces an augmented state space
\[
\mathcal{Z}=\mathcal{S}\times\prod_{i=1}^K \mathcal{X}_i,
\]
where \(\mathbf{s}\in\mathcal{S}\) is the full-system state and \(\mathbf{x}_i\in\mathcal{X}_i\) are the variables associated with \(K\) pretrained priors \(p_i(\mathbf{x}_i)\). Each prior is linked to the physical system through a projection \(\Phi_i(\mathbf{s})\), so the priors need only cover projected components of the full state rather than the entire system [2605.10642].

At diffusion time \(t\), the joint target is
\[
\pi_t\!\left(\mathbf{s},\{\mathbf{x}_i\}\right) \propto q_{\mathrm{ctx}}(\mathbf{s},t)\; \prod_{i=1}^K \left[ p_i(\mathbf{x}_i)\, q_t^{(i)}\!\big(\Phi_i(\mathbf{s})\mid \mathbf{x}_i\big) \right].
\]
Here \(q_{\mathrm{ctx}}(\mathbf{s},t)\) is the explicit context factor, typically a Boltzmann weight from a physical energy, and \(q_t^{(i)}\) is the forward diffusion kernel for prior \(i\). In the small-\(t\) limit,
\[
\lim_{t\to 0} q_t^{(i)}\!\big(\Phi_i(\mathbf{s})\mid \mathbf{x}_i\big) = \delta\!\big(\Phi_i(\mathbf{s})-\mathbf{x}_i\big),
\]
so that
\[
\pi_0(\mathbf{s})\propto \pi_{\mathrm{ctx}}(\mathbf{s})\prod_{i=1}^K p_i\!\big(\Phi_i(\mathbf{s})\big).
\]
This limiting marginal is the composed target distribution that GG-PA is designed to sample [2605.10642].

A central implication is that the method does not force the environmental degrees of freedom to be marginalized into an effective energy on the prior variables alone. This suggests a modular sampling architecture in which learned priors and explicit physical models remain separate objects coupled only through the augmented target.

## 2. Gibbs structure and alternating updates

GG-PA is implemented as alternating Gibbs updates on the augmented target. Conditioned on the physical state \(\mathbf{s}\), the prior variables update independently according to
\[
\pi_t(\mathbf{x}_i\mid \mathbf{s}) \propto p_i(\mathbf{x}_i)\; q_t^{(i)}\!\big(\Phi_i(\mathbf{s})\mid \mathbf{x}_i\big).
\]
The interpretation given is Bayesian denoising: \(\Phi_i(\mathbf{s})\) is treated as a noisy observation at diffusion time \(t\), and the conditional is the denoising posterior induced by the clean-data prior and the forward corruption kernel. In practice, the pretrained reverse diffusion sampler for prior \(i\) is initialized at \(\Phi_i(\mathbf{s})\), started from time \(t\), and integrated backward to \(0\) to produce \(\mathbf{x}_i\). These updates are parallel across \(i\) [2605.10642].

Conditioned on the prior variables, the physical state is then updated from
\[
\pi_t(\mathbf{s}\mid \{\mathbf{x}_i\}) \propto q_{\mathrm{ctx}}(\mathbf{s},t)\, \prod_{i=1}^K q_t^{(i)}\!\big(\Phi_i(\mathbf{s})\mid \mathbf{x}_i\big).
\]
Equivalently, the update is governed by the effective potential
\[
U_{\mathrm{eff}}(\mathbf{s};\{\mathbf{x}_i\},t) = -\log q_{\mathrm{ctx}}(\mathbf{s},t) - \sum_{i=1}^K \log q_t^{(i)}\!\big(\Phi_i(\mathbf{s})\mid \mathbf{x}_i\big).
\]
This context-aware aggregation step can be exact in tractable families, especially Gaussian or linear-Gaussian settings, and otherwise can be performed with Metropolis-Hastings or Langevin/MCMC [2605.10642].

The operational pattern is therefore a two-stage alternation: denoise under the learned priors, then update the full explicit system under the physical context plus soft coupling terms induced by the diffusion kernels. The paper presents this as distinct from ordinary diffusion guidance, because the state being updated in the context step is the full physical system \(\mathbf{s}\), not merely the prior variable space [2605.10642].

## 3. Exactness results and finite-\(t\) Gaussian theory

The principal theoretical claim is asymptotic exactness as \(t\to 0\). For decomposable systems in which the true energy separates into component energies \(U_i\), environment energy \(U_{\mathrm{env}}\), and interaction terms \(U_{\mathrm{int}}\), the paper assumes exact isolated-component priors
\[
p_i(\mathbf{x}_i)\propto e^{-\beta U_i(\mathbf{x}_i)},
\]
with \(\Phi_i(\mathbf{s})=\mathbf{s}_i\), and a context factor
\[
\pi_{\mathrm{ctx}}(\mathbf{s}) \propto \exp\!\left(-\beta\left[U_{\mathrm{env}}(\mathbf{s}_{\mathrm{env}})+U_{\mathrm{int}}(\mathbf{s}_1,\dots,\mathbf{s}_K,\mathbf{s}_{\mathrm{env}})\right]\right).
\]
Under these assumptions, the \(t\to 0\) marginal recovers the true physical Boltzmann distribution exactly:
\[
\pi_0(\mathbf{x}_1,\dots,\mathbf{x}_K,\mathbf{s}_{\mathrm{env}}) \propto \exp\!\left(-\beta V_{\mathrm{tot}}(\mathbf{x}_1,\dots,\mathbf{x}_K,\mathbf{s}_{\mathrm{env}})\right).
\]
The derivation follows immediately from the delta-function limit of the forward diffusion kernels [2605.10642].

A stronger result is available at finite diffusion time for quadratic interactions with linear-Gaussian forward kernels. The assumptions are that, conditional on the environment, the interaction energy is Gaussian in the system variables,
\[
\exp\!\big(-\beta U_{\mathrm{int}}(\mathbf{s}_{\mathrm{sys}},\mathbf{s}_{\mathrm{env}})\big)
\propto
\mathcal{N}\!\big(\mathbf{s}_{\mathrm{sys}}\mid \mu_c(\mathbf{s}_{\mathrm{env}}),\Sigma_c(\mathbf{s}_{\mathrm{env}})\big),
\]
that the stacked forward kernels are linear-Gaussian,
\[
\prod_{i=1}^K q_t^{(i)}(\mathbf{s}_i\mid \mathbf{x}_i)
=
\mathcal{N}\!\big(\mathbf{s}_{\mathrm{sys}}\mid A_t \mathbf{x},\Sigma_t\big),
\]
and that the finite-\(t\) interaction context is chosen Gaussian,
\[
q_{\mathrm{int}}(\mathbf{s}_{\mathrm{sys}}\mid \mathbf{s}_{\mathrm{env}},t)
=
\mathcal{N}\!\big(\mathbf{s}_{\mathrm{sys}}\mid \mu_q(\mathbf{s}_{\mathrm{env}},t),\Sigma_q(\mathbf{s}_{\mathrm{env}},t)\big).
\]
Then exact finite-\(t\) recovery occurs iff
\[
\mu_q(\mathbf{s}_{\mathrm{env}},t)=A_t\,\mu_c(\mathbf{s}_{\mathrm{env}}), \qquad
\Sigma_q(\mathbf{s}_{\mathrm{env}},t) = A_t\Sigma_c(\mathbf{s}_{\mathrm{env}})A_t^\top-\Sigma_t.
\]
The admissibility condition is
\[
\Sigma_t \preceq A_t\Sigma_c(\mathbf{s}_{\mathrm{env}})A_t^\top,
\]
which defines a maximal diffusion time \(t_{\max}\) beyond which the deconvolved covariance becomes invalid [2605.10642].

The paper also notes a split-Gibbs consequence for linear inverse problems: the corrected covariance should be
\[
\Sigma_{\mathrm{split}}=\Sigma_\eta-\rho^2 H H^\top
\]
rather than the naive \(\Sigma_\eta\). This removes the finite-\(\rho\) covariance inflation that standard split Gibbs incurs [2605.10642].

A common misconception is that GG-PA is exact at arbitrary finite diffusion time. The paper explicitly limits finite-\(t\) exactness to quadratic or linear-Gaussian structure; outside that regime, exactness is only asymptotic as \(t\to 0\) [2605.10642].

## 4. Diffusion-time replica exchange and mixing considerations

Because small diffusion time yields faithful but stiff targets, whereas larger diffusion time weakens prior consistency while often improving exploration, GG-PA introduces replica exchange over diffusion time. The method runs \(R\) replicas at
\[
0<t_1<\cdots<t_R<1,
\]
with each replica carrying \((\mathbf{s}^{(r)},\{\mathbf{x}_i^{(r)}\})\), and proposes swaps between neighboring times [2605.10642].

The Metropolis-Hastings acceptance ratio is derived directly from the joint target. In schematic form,
\[
\alpha = \min\!\left(1, \frac{ q_{\mathrm{ctx}}(\mathbf{s}^{(r)},t_{r+1})\,q_{\mathrm{ctx}}(\mathbf{s}^{(r+1)},t_r)\, \prod_i q_{t_{r+1}}^{(i)}(\Phi_i(\mathbf{s}^{(r)})\mid \mathbf{x}_i^{(r)}) \prod_i q_{t_r}^{(i)}(\Phi_i(\mathbf{s}^{(r+1)})\mid \mathbf{x}_i^{(r+1)}) }{ q_{\mathrm{ctx}}(\mathbf{s}^{(r)},t_r)\,q_{\mathrm{ctx}}(\mathbf{s}^{(r+1)},t_{r+1})\, \prod_i q_{t_r}^{(i)}(\Phi_i(\mathbf{s}^{(r)})\mid \mathbf{x}_i^{(r)}) \prod_i q_{t_{r+1}}^{(i)}(\Phi_i(\mathbf{s}^{(r+1)})\mid \mathbf{x}_i^{(r+1)}) } \right).
\]
An important practical feature is that the unknown prior densities \(p_i(\mathbf{x}_i)\) cancel exactly. For a constant context schedule \(q_{\mathrm{ctx}}(\mathbf{s},t)=\pi_{\mathrm{ctx}}(\mathbf{s})\), the context terms cancel as well, so the swap test depends only on known diffusion kernels [2605.10642].

The intended interpretation is tempering along a diffusion-time axis: high-noise replicas cross barriers more easily, and successful swaps transfer those exploratory moves to low-noise replicas. The paper further describes MBAR reweighting using reduced potentials
\[
u_k^{\mathrm{MBAR}}(\mathbf{z}) = -\log q_{\mathrm{ctx}}(\mathbf{s},t_k) - \sum_i \log q_{t_k}^{(i)}(\Phi_i(\mathbf{s})\mid \mathbf{x}_i),
\]
with prior terms omitted because they are replica-independent [2605.10642].

This establishes a fidelity–mixing trade-off as a central organizing principle of the method. A plausible implication is that practical performance depends not only on the prior quality and the context model, but also on the diffusion-time ladder and the efficiency of exchanging information across replicas.

## 5. Relation to adjacent physics-aware generative samplers

GG-PA belongs to a broader family of physics-aware generative sampling methods, but its structure differs from both local learned Gibbs schemes and reversibility-based global samplers.

The most direct distinction from standard diffusion posterior sampling, classifier guidance, and score composition is structural: those methods typically assume that all additional information can be expressed as a likelihood or energy on the same variable space as the diffusion prior, whereas GG-PA keeps an explicit full-system state \(\mathbf{s}\) and couples it to priors only through projections \(\Phi_i(\mathbf{s})\) [2605.10642]. This avoids marginalizing unmodeled environmental variables into an effective energy over the prior coordinates alone.

The method is algorithmically close to plug-and-play and split Gibbs approaches because it alternates between a prior-driven update and a context-driven update. The paper emphasizes, however, that the augmented pair \((\mathbf{s},\mathbf{x})\) is not merely a numerical splitting device but the actual composition space of inference [2605.10642].

In relation to learned Gibbs or heatbath samplers, PBMG provides a different form of physics-aware composition. PBMG learns local conditional proposal distributions \(q(\phi_i^{(t+1)} \mid \phi_{-g}, \psi;\theta)\) and inserts them into Metropolis-within-Gibbs updates over checkerboard blocks in lattice models. It does not model the full joint lattice distribution directly; instead, it learns one-site conditionals from the analytic local action, without requiring target samples, and uses Metropolis correction to preserve exactness. PBMG is demonstrated on the XY and \(\phi^4\) models, with average acceptance about \(80\%\) for the XY setup and about \(98\%\) for the \(\phi^4\) setup [2308.08615]. The conceptual overlap is that both PBMG and GG-PA are physics-aware Gibbs-type samplers, but PBMG learns local proposals inside a lattice update schedule, whereas GG-PA composes pretrained partial priors with an explicit full-system context in an augmented diffusion-coupled state space.

RevGen, by contrast, replaces score matching and variational objectives with a reversibility constraint on Markov trajectories. It trains a generator \(G_\theta\) by minimizing the MMD between forward and time-reversed trajectory-pair distributions under a fixed physical transition kernel such as Metropolis-Hastings. The objective is target-gradient-free and uses only energy evaluations through acceptance ratios, with support for continuous, discrete, and hybrid spaces [2603.09251]. A plausible interpretation is that RevGen and GG-PA address complementary aspects of physics-aware generative sampling: RevGen learns a generator whose outputs satisfy equilibrium reversibility constraints, whereas GG-PA performs training-free inference by coupling pretrained priors and explicit context through Gibbs updates.

## 6. Empirical demonstrations, scope, and limitations

The experiments reported for GG-PA cover a coupled double-well system, a 2D \(\phi^4\) lattice model, and atomistic alanine dipeptide systems [2605.10642].

For the coupled double-well system,
\[
U_{\mathrm{tot}}(x_{\mathrm{sys}},x_{\mathrm{env}}) = A(x_{\mathrm{sys}}^2-1)^2+\frac{k_c}{2}(x_{\mathrm{sys}}-x_{\mathrm{env}})^2+\frac{k_b}{2}(x_{\mathrm{env}}-u_{\mathrm{eq}})^2,
\]
the prior is trained only on the isolated symmetric double well, and the environment is introduced only at sampling time. GG-PA recovers the environment-induced asymmetry in the marginal of \(x_{\mathrm{sys}}\) and the correct shifted ensemble despite the symmetric prior. The study reports JS divergence versus diffusion time, the integrated autocorrelation time of the basin indicator \(\mathrm{sgn}(x_{\mathrm{sys}})\), and a finite theoretical bound \(t_{\max}\approx 0.28\). Below \(t_{\max}\), fixed-\(t\) GG-PA and GG-PA-RE match the target well; above \(t_{\max}\), errors rise as predicted; replica exchange substantially reduces autocorrelation and can sometimes outperform MD in decorrelation [2605.10642].

For the 2D Ginzburg-Landau \(\phi^4\) lattice model,
\[
H(\phi)=\sum_i(\phi_i^2-1)^2+J\sum_{\langle i,j\rangle}(\phi_i-\phi_j)^2-h\sum_i\phi_i,
\]
the diffusion prior is trained only on the local on-site double-well factor, while the explicit quadratic coupling is added at inference time. GG-PA recovers the spontaneous symmetry breaking phase transition, the magnetization curve, the susceptibility peak near \(J_c\approx 0.436\), critical scaling, and universal data collapse in finite field. The reported observables include the order parameter \(m\), susceptibility \(\chi\), and integrated autocorrelation time \(\tau_{\mathrm{int}}\). GG-PA tracks checkerboard Metropolis MC across the phase diagram, and replica exchange sharply lowers autocorrelation near criticality, with order-of-magnitude gains [2605.10642].

For atomistic alanine dipeptide systems, the method is tested outside the quadratic regime. In the AD–Na\(^+\) example, a diffusion prior is trained only on isolated alanine dipeptide backbone torsions \((\phi,\psi)\), while the full atomistic system and ion context are explicit. GG-PA captures the ion-coordination-induced distribution shift and reproduces the O–O distance distribution near quantitatively. A data-efficiency study reports that GG-PA reaches low JS divergence with far less target-coupled training data than a direct diffusion model [2605.10642].

In the alanine dipeptide dimer example, two monomer priors are composed to model dimerization and hydrogen-bond-mediated topology selection. GG-PA-RE qualitatively recovers symmetry-broken organization: anti-parallel dimers favor \(LL\), whereas parallel dimers favor \(LR\) and \(RL\). The method also produces more off-basin or residual states than MD, indicating approximation error. The paper reports a residual unassigned category \(U\), interpreting it as a coarse-graining artifact plus some rare or off-basin motifs. For sampled observables, autocorrelation times are massively reduced relative to MD, often from thousands of ps down to order \(1\) ps or less [2605.10642].

The reported limitations are explicit. Finite-\(t\) exactness is confined to quadratic or linear-Gaussian structure; outside that regime, finite-\(t\) sampling is approximate. There is a fidelity–mixing trade-off between small and large diffusion times. The covariance admissibility bound
\[
\Sigma_t \preceq A_t\Sigma_cA_t^\top
\]
imposes a noise ceiling. Mixing can remain difficult in stiff systems, and replica exchange increases computational cost because it requires multiple replicas. Performance depends on prior fidelity, overlap between prior and context, projection design, and avoidance of double counting of interactions. The paper identifies annealed context schedules, more efficient tempering, multiscale decompositions, and explicit force-field contexts as future directions [2605.10642].

Taken together, these results define GG-PA as a probabilistic composition framework for partial pretrained priors and explicit physics, rather than as a monolithic conditional diffusion model. Its core contribution is the replacement of end-to-end retraining with augmented-space Gibbs inference, supported by asymptotic exactness, a finite-\(t\) Gaussian exactness condition, and diffusion-time replica exchange for practical sampling in stiff systems [2605.10642].

Source: https://www.emergentmind.com/topics/generative-gibbs-for-physics-aware-sampling-gg-pa