---
title: Conditional Diffusion Sampling
url: https://www.emergentmind.com/topics/conditional-diffusion-sampling-cds
type: topic
---

# Conditional Diffusion Sampling

Conditional Diffusion Sampling (CDS) is a rigorous framework for sampling from complex, often unnormalized or multimodal, target distributions under conditional constraints. It synthesizes elements from traditional Markov chain Monte Carlo (MCMC) approaches such as Parallel Tempering (PT) and the continuous-time machinery of diffusion-based samplers, yielding a mathematically closed, non-amortized sampling scheme optimized for scenarios with limited target density evaluations. Below, the core principles, mathematical foundations, algorithmic implementation, theoretical guarantees, and empirical findings of CDS are detailed.

## 1. Mathematical Foundations: Conditional Interpolants and Transport SDEs

The central object in CDS is the **Conditional Interpolant**. Let $\mathcal{X} \subseteq \mathbb{R}^D$ denote the state space; $\nu$ the unnormalized target with density $\pi(x)$, and $\mu$ a tractable reference, such as a Gaussian with density $r(z)$. A conditional interpolant is a smooth map
\[
F: [0,1] \times \mathcal{X}_z \times \mathcal{X}_x \to \mathcal{X},\qquad F(0,z,x) = z,\; F(1,z,x) = x,
\]
such that for $z \sim \mu$ and $x \sim \nu$, the trajectory $x_t = F_t(z, x)$ induces a one-parameter family of pushforward measures $\nu_{t|z} = F_{t|z}\#\nu$. For each $t > 0$, $F_{t|z}$ is a diffeomorphism, and the interim densities are given by
\[
\pi_{t|z}(x) = \left| \det JF_{t|z}(F_{t|z}^{-1}(x)) \right|^{-1} \pi(F_{t|z}^{-1}(x)).
\]
A canonical example is **linear interpolation**: $F_t(z, x) = (1-t)z + t x$, resulting in
\[
\pi_{t|z}(x) = t^{-D}\; \pi \left(\frac{x - (1-t)z}{t}\right).
\]
As $t \to 0$, $\nu_{t|z} \to \delta_z$ in the $W_1$ Wasserstein metric.

CDS constructs an **exact closed-form SDE** whose marginal at each time $t$ is precisely $\pi_{t|z}$. The drift is defined via the *conditional velocity field*:
\[
u_{t|z}(x) = \frac{\partial}{\partial t} F_{t|z}(F_{t|z}^{-1}(x)),
\]
yielding the Fokker–Planck dynamics
\[
\partial_t \pi_{t|z} = -\nabla\cdot(\pi_{t|z} a_{t|z}) + \frac{\sigma_t^2}{2}\Delta \pi_{t|z}
\]
for any (possibly time-dependent) noise scale $\sigma_t$, with
\[
a_{t|z}(x) = u_{t|z}(x) + \frac{\sigma_t^2}{2} \nabla \log \pi_{t|z}(x).
\]
The resulting SDE is
\[
\mathrm{d}x_t = \left[u_{t|z}(x_t) + \frac{\sigma_t^2}{2} \nabla \log \pi_{t|z}(x_t) \right]\, \mathrm{d}t + \sigma_t\, \mathrm{d}W_t,
\]
which is marginal-preserving by construction and does **not** require neural score approximation [2605.04013].

## 2. Two-Stage CDS Algorithm: Initialization and Transport

Conditional Diffusion Sampling is executed in two explicit stages:

- **Stage 1: Initialization ($x_{t_0} \sim \pi_{t_0|z}$).** The initial state is drawn by running PT on the bridge density $\pi_{t_0|z}$. PT iterates combine local updates (e.g., Metropolis-Adjusted Langevin Algorithm, MALA) and swaps across a temperature ladder parametrized by $\beta$. Empirically, as $t_0 \to 0$, $\nu_{t_0|z}$ contracts to a Dirac at $z$, and thus initialization becomes increasingly cheap — essentially, local MCMC proposals suffice for a high-quality start.

- **Stage 2: Exact SDE Transport ($x_{t_0} \rightarrow x_1$).** The initialized $x_{t_0}$ is propagated to $x_1$ by numerical integration (e.g., Euler–Maruyama) of the closed-form transport SDE above, possibly augmented with Metropolis–Hastings corrector steps to ensure precise marginal tracking at each discretized time.

The complete pseudocode is:

```latex
\begin{algorithm}[H]
\caption{Conditional Diffusion Sampling (CDS)}
\begin{algorithmic}[1]
\Require anchor $z\sim\mu$, initialization time $t_0$, PT steps $K$, times $t_0<\cdots<t_N=1$,
        noise schedule $\sigma_0,\dots,\sigma_{N-1}$, corrector steps $M$.
\State Sample $z\sim\mu$
\State Stage 1: Run $K$ PT steps targeting $\pi_{t_0|z}$, output $x_0 \sim \pi_{t_0|z}$
\State Stage 2: Set $x \gets x_0$
\For{$n=0,\dots,N-1$}
    \State Compute drift $a_n \gets u_{t_n|z}(x) + \frac{\sigma_n^2}{2}\nabla \log \pi_{t_n|z}(x)$
    \State $x \gets x + (t_{n+1}-t_n)a_n + \sigma_n\sqrt{t_{n+1}-t_n}\xi$, $\xi\sim\mathcal{N}(0,I)$
    \State Optionally run $M$ MH-corrector steps targeting $\pi_{t_{n+1}|z}$
\EndFor
\State \Return $x \approx x_1\sim\pi$
\end{algorithmic}
\end{algorithm}
```
[2605.04013]

## 3. Theoretical Properties: Initialization Cost and Error Contraction

As $t_0 \to 0$, the initialization distribution becomes a Dirac centered at $z$, making sampling by any Lipschitz-rescaled MCMC kernel arbitrarily easy:
\[
\lim_{t\to0} W_1(\nu_{t|z}, \delta_z) = 0 \qquad \text{(Lemma 1)}
\]
For any $\nu$-invariant MCMC kernel $K$, its pushforward $K_{t|z}$ is $\nu_{t|z}$-invariant, and the Wasserstein contraction bound
\[
W_1\bigl(K_{t|z}^n(\delta_z),\,\nu_{t|z}\bigr) \leq L_t\,W_1(K^n(\delta_{x_0}),\,\nu)
\]
with $L_t \to 0$ for linear interpolants, ensures that initialization error vanishes as the bridge contracts [2605.04013].

Moreover, as the propagation SDE is exact with respect to $\pi_{t|z}$, the only source of bias is the numerical integrator and the initialization bridge, both of which can be tightly controlled.

## 4. Complexity Analysis and Comparison

The number of target density evaluations (the dominant cost in non-amortized MCMC) is:
\[
\text{Total evals} \approx K\,(\text{PT swap + local step}) + N\,(\text{drift \& score}) + N M\,(\text{correctors})
\]
By contrast, standard PT with $L$ replicas and $I$ iterations incurs $I L$ evaluations per local step, plus swaps; diffusion-based neural samplers amortize $\gg 10^6$ evaluations during training. CDS is non-amortized but typically achieves a better sample–cost trade-off than PT alone, requiring no score training and scaling efficiently as $K \ll I L$ for initialization [2605.04013].

## 5. Empirical Results Across Scientific and ML Benchmarks

CDS was extensively validated on the following tasks:

- Gaussian mixture models (GM-2/16, GMNU-2/16)
- Lennard-Jones potential clusters (LJ-13, LJ-55)
- Alanine-dipeptide distribution ($D=66$)
- Bayesian neural network posteriors ($D=550$)

Key metrics included $W_2$ distance (for GM, LJ), Ramachandran plot KL (ALDP), test negative log-likelihood (BNN), round-trip (RT) mixing, and Global Communication Barrier (GCB). Principal findings:

- **Mixing:** Decreasing $t_0$ improves mixing and reduces GCB, up to the threshold where the bridge $\nu_{t_0|z}$ degenerates.
- **Pareto Efficiency:** The sample quality—$\pi$-evaluation Pareto frontier under CDS strictly dominates PT, HMC, MALA, and DiGS on nearly all benchmarks.
- **SDE Transport Superiority:** Propagation via closed-form SDE outperforms naive inverse mapping of initialization ($x_{t_0}$).
- **Dimensionality Robustness:** CDS scales effectively to high dimensions ($D=550$ for BNN), surpassing all tested MCMC baselines.

Aggregate hypervolume ratio (HVR) across eight tasks:
\[
\text{HVR}(\mathrm{CDS}) \approx 0.9976 > \text{HVR}(\mathrm{NRPT}) \approx 0.9827 > \text{others}
\]
[2605.04013]

## 6. Extensions: Conditional Sampling in Generative Diffusions

A broader landscape of conditional diffusion sampling has emerged, addressing conditional distributions $\pi(x \mid y)$. Methods are categorized as [2409.09650]:

- **Joint bridging:** Doob-pinning, Schrödinger bridge construction (bridging forward–backward SDEs whose time-reversal enforces the condition), typically requiring extensive training with joint samples.
- **Feynman–Kac or SMC-based twisting:** If only a pre-trained marginal and explicit likelihood are available, one may twist the reverse process into a conditional SMC chain, with convergence controlled by particle count $J$.
- **Conditional SDEs for constrained inverse problems:** When conditioning corresponds to linear observations, a normal–tangent decomposition yields exact drift terms for observed coordinates and a quantifiable information-theoretic error for the unobserved tangent drift using the unconditional score [2605.05387].

The CDS philosophy—separating tractable marginalization from transport along well-characterized stochastic flows—underpins these broader developments.

## 7. Significance and Outlook

Conditional Diffusion Sampling provides a non-amortized, rigorously margined approach for sampling from complex, multimodal, and high-dimensional targets where direct MCMC is inefficient and classical diffusion-based models require expensive neural training. Its exact SDE formulation, efficient bridge-based initialization, and competitive empirical performance establish it as a foundational tool for practical scientific simulation, Bayesian posterior inference, and hard high-dimensional integral evaluation under resource constraints [2605.04013].

By uniting global PT-based exploration with continuous-time, score-driven transport, and by admitting precise complexity and error quantification, CDS both advances theoretical sampling science and delivers concrete computational benefits in applied ML and physical chemistry.

Source: https://www.emergentmind.com/topics/conditional-diffusion-sampling-cds