                                             Progressive Tempering Sampler with Diffusion

                                                                            matching (Vincent, 2011). During sampling, we start with
                                                                            samples from N (xtmax | 0, σ(tmax )2 I) and follow Eq. (4).
                                                                            Additionally, the score function is related to the denoising
                                                                            mean through Tweedie’s formula (Efron, 2011; Roberts &
                                                                            Tweedie, 1996):

                                                                                    ∇xt log pt (xt ) = (E[x0 | xt ] − xt )/σ(t)2 .       (5)

                                                                            Therefore, for numerical stability, rather than directly ap-
                                                                            proximating the score function with a neural network, a
                                                                            common choice is to regress the denoising mean using a
                                                                            denoiser network Dθ (xt , t), as done by Karras et al. (2022).

                                                                            PF-ODE and Hutchinson’s trace estimator Besides the
                                                                            reverse SDE defined in Eq. (4), diffusion models (DMs) can
                                                                            also generate samples by the probabilistic flow (PF) ODE:
Figure 2. Illustration of parallel tempering with three temperatures.

                                                                               dxt = −σ̇(t)σ(t)∇xt log pt (xt ) dt,       xtmax ∼ ptmax . (6)
MCMC at lower temperatures explores local modes and
provides unbiased samples from the target distribution. In-                 This formulation not only provides an alternative method
formation between different temperatures is shared by swap-                 for sample generation but also offers a principled approach
ping samples. Specifically, for samples xi and xj at adjacent               to estimating the log density of the generated samples. Con-
temperatures Ti and Tj , PT swaps them with probability                     cretely, by employing the instantaneous change-of-variables
                                                                            formula (Chen et al., 2018), we obtain
                        p̃(xj )1/Ti p̃(xi )1/Tj
                                               
             p = min 1,                           .              (2)               d log pt (xt )
                        p̃(xi )1/Ti p̃(xj )1/Tj                                                   = −σ̇(t)σ(t) tr(∇2xt log pt (xt ))     (7)
                                                                                        dt
                                                                            and the Jacobian can be approximated by Hutchinson’s trace
Diffusion models DMs (Sohl-Dickstein et al., 2015; Ho
                                                                            estimator (Hutchinson, 1989; Grathwohl et al., 2018)
et al., 2020; Song et al., 2021) define a forward process cor-
rupting the original data distribution with a Gaussian noise,                      tr(∇2xt log pt (xt )) = Eϵ [ϵ⊤ ∇2xt log pt (xt )ϵ],   (8)
which corresponds to a diffusion SDE. We can generate
samples by denoising progressively, corresponding to the                    where ϵ follows a Rademacher distribution (Hutchinson,
time-reversal of the forward SDE.                                           1989). We can approximate the expectation using Monte
Assume a target density p0 (x0 ). We define a noising pro-                  Carlo integration, with vector-Jacobian products (VJP) en-
cess2                                                                       abling efficient computation.
                 p
          dxt = 2σ̇(t)σ(t) dwt , x0 ∼ p0               (3)
                                                                            3. Methods
where wt is a Wiener process. Its time reversal is given by
                                     p                                      In this section, we describe our approach, Progressive Tem-
dxt =−2σ̇(t)σ(t)∇xt log pt (xt ) dt+ 2σ̇(t)σ(t) dw̄t , (4)                  pering Sampler with Diffusion (PTSD). Unlike other meth-
                                                                            ods shown in Fig. 1, it integrates Parallel Tempering (PT)
where xtmax ∼ ptmax and ∇xt log pt (xt ) is the score function              and neural samplers to achieve more efficient utilization of
at diffusion time t, and w̄t is a reverse time Wiener process.              target energy evaluations.
The pt (xt ) is theRtarget density convolved with a Gaussian
kernel pt (xt ) = N (xt | x0 , σ(t)2 I) p0 (x0 ) dx0 .                      In spite of the advances by PT, it can only generate inde-
                                                                            pendent samples when (1) uncorrected samples are drawn
For a sufficiently large σ(tmax ), ptmax is well approximated               at the highest temperature, and (2) the uncorrected samples
by a Gaussian N (xt | 0, σ(tmax )2 I) and hence is tractable.               are propagated to the lowest temperature. Therefore, the
During training, we approximate the score ∇xt log pt (xt )                  efficiency of PT will highly rely on the quality of local ex-
with a time-dependent neural network by denoising score                     ploration and the swapping. On the other hand, although
    2                                                                       the MCMC chain can mix faster at higher temperatures, ob-
      For simplicity, we only discuss the variance-exploding process
introduced by Song et al. (2021); Karras et al. (2022) in this paper.       taining an uncorrected sample still requires a considerable
However, we note that our proposed approach is also compatible              number of steps. Also, while the (unnormalized) densi-
with the variance-preserving process.                                       ties at different temperatures differ only in their exponents

                                                                        3
