We propose a conditioning mechanism for diffusion models based on multi-speed joint diffusion of the target and the condition. The mechanism learns an unconditional joint score network and enforces conditioning at inference via a plug-in correction term. The plug-in term separates the conditioning contribution from the learned unconditional dynamics, offering a transparent view of how the condition steers generation of the target distribution. Building on this, we derive explicit conditional reverse-time SDEs and approximate probability-flow ODEs, enabling principled and directly comparable conditional samplers. To reduce the induced ODE--SDE discrepancy, we introduce a log-Fokker--Planck residual regularization that improves ODE sampling quality. Experiments on conditional image generation tasks demonstrate competitive performance and support the effectiveness of the plug-in conditioning view. Additional ODE--SDE comparison experiments show that the log-Fokker--Planck residual regularization improves deterministic ODE sampling.
Figures & tables
Figure 1: Inpainting on CelebA. For each example, we show the ground truth, the masked observation, and samples generated by our method from left to right.
Method
PSNR ↑
SSIM ↑
LPIPS ↓
JFID ↓
CDE
25.12
0.870
0.042
18.06
CDiffE
23.07
0.844
0.057
19.25
CMDE
24.92
0.864
0.044
17.07
Ours
25.38
0.876
0.046
15.99
Table 1: Conditional generation results on CelebA inpainting. Lower LPIPS and JFID are better; higher PSNR and SSIM are better. All score-based methods use the same backbone and evaluation protocol.
Method
PSNR ↑
SSIM ↑
LPIPS ↓
JFID ↓
CDE
23.80
0.650
0.114
15.77
CDiffE
23.83
0.656
0.139
20.20
CMDE
23.91
0.654
0.109
15.68
HCFLOW
24.95
0.702
0.107
19.55
Ours
25.12
0.672
0.098
14.56
Table 2: Conditional generation results on CelebA 8× super-resolution. Our method achieves the best PSNR, LPIPS, and JFID, while HCFLOW obtains the highest SSIM.
Figure 2: Super-resolution on CelebA. From left to right: ground-truth high-resolution images, low-resolution observations, and samples generated by our method.
Dataset
Method
Grad.
LPIPS ↓
PSNR ↑
JFID ↓
FFHQ
DPS [ 3 ]
Yes
0.2001
29.392
26.1210
FFHQ
DiffPIR [ 21 ]
No
0.2097
26.577
18.8032
FFHQ
Ours
No
0.1984
29.916
20.1224
ImageNet256
DPS [ 3 ]
Yes
0.3390
26.166
44.0984
ImageNet256
DiffPIR [ 21 ]
No
0.2259
25.505
17.3510
ImageNet256
Ours
No
0.2272
28.122
16.7309
Table 3: Noisy random inpainting with a pretrained diffusion prior. All methods use the same pretrained prior, masks, perturbations, test images, and sampling budget (NFE=1000) . Metrics are computed using 100 samples. We report LPIPS, PSNR, and JFID as representative measures of perceptual similarity, reconstruction fidelity, and conditional consistency, respectively.
Figure 3: Qualitative comparison on ImageNet256 noisy random inpainting. From left to right: ground truth, noisy observation, DPS, DiffPIR, and Ours. Compared with DPS and DiffPIR, our method produces reconstructions that are more consistent with the observation while maintaining realistic image content.
Method
W2(ODE,SDE)↓
W2(ODE,GT)↓
W2(SDE,GT)↓
Baseline
0.0329±0.0009
0.0469±0.0016
0.0368±0.0013
CLOSE ( α=0.1 )
0.0323±0.0011
0.0452±0.0018
0.0347±0.0011
Table 4: MNIST conditional inpainting test results. Lower values are better. The checkpoint is selected by minimizing W2(ODE,SDE) . Results are reported as mean ± std over 8 splits with N=2048 test conditions.
Appendix figures & tables3 assets
Supplementary material from the paper’s appendix.
Appendix
β=σY/σX
0.02
0.05
0.1
0.3
1.0
Score error
0.020
0.050
0.099
0.287
0.706
End-to-end rel. W2
0.008
0.020
0.045
0.138
0.414
Appendix
Table 5: Exact plug-in approximation error as a function of the condition diffusion speed ratio β . The empirical score error decays approximately as O(β0.98) .
β
PSNR ↑
SSIM ↑
LPIPS ↓
0.05
24.02
0.912
0.061
0.10
25.38
0.876
0.046
0.20
25.04
0.854
0.058
0.30
24.36
0.802
0.067
Appendix
Table 6: Ablation on β (condition diffusion speed ratio). Higher is better for PSNR/SSIM, lower is better for LPIPS.
Method
NFE
Backprop
s/img
FID ↓
SSIM ↑
JFID ↓
DPS
1000
yes
245.1
84.47
0.694
44.10
DiffPIR
1000
no
128.0
38.22
0.753
17.35
Ours
1000
no
130.8
39.64
0.764
16.73
Appendix
Table 7: Runtime and distributional evaluation on ImageNet256 noisy inpainting using one RTX 3090 with batch size 1. All methods use the same 100 images and sampling budget (NFE = 1000).
Probability-flow ordinary differential equations (PF-ODEs) are widely used as deterministic samplers for score-based diffusion models. Their usual justification is that the Fokker--Planck equation of a diffusion can be rewritten as a continuity equation driven by the score function of the forward diffusion. This identity does not, however, guarantee that the resulting velocity field generates a well-posed flow. We provide theoretical insights into the design of such deterministic samplers for generative models based on diffusions and reflected diffusions. We identify sufficient conditions for a regular Lagrangian PF-ODE flow to exist; reverse sampling and invertibility require two-sided divergence control. For learned scores, sampler stability is controlled by an unweighted velocity error, exposing a mismatch with density-weighted score matching and motivating architectural control of Jacobians, divergence, growth, and compression. Under the manifold hypothesis, positive-time regularization justifies an early-stopped PF-ODE while constants deteriorate near the data endpoint; an explicit sphere example shows that the exact deterministic flow becomes singular as the noise level vanishes even though the diffusion marginals remain well defined. These theoretical insights translate into concrete design principles for stable, invertible, and constraint-preserving diffusion samplers. We illustrate the practical relevance of these design principles using controlled numerical experiments.
We establish finite-sample guarantees for conditional diffusion models learned from data and implemented with finitely many denoising steps. Our approach aligns the score-training objective with the sampling grid, allowing statistical estimation and numerical discretization errors to be analyzed together. Under a smooth conditional density model, we derive high-probability bounds on the generated distribution's error and quantify the required number of score evaluations. For every smoothness index β>0, a suitable grid yields averaged conditional Kullback--Leibler (KL) divergence Op(n−2β/(dx+dy+2β)) relative to the original target with or without early stopping. Both the full and early-stopped samplers attain average target total-variation (TV) error Op(n−β/(dx+dy+2β)). Here n is the sample size, dx,dy are the data and conditioning dimensions, and errors are averaged over the conditioning variable. The total-variation bound matches the rate established in existing conditional distribution-estimation theory, up to logarithmic factors.
Qiuyun Zhu
Department of Statistics and Actuarial Science University of Iowa
Diffusion models have emerged as a dominant framework for generative modeling, but their mathematical foundations are often presented separately through diffusion probabilistic models, score-based modeling, stochastic differential equations, and numerical sampling methods. We write this tutorial to provide a unified and self-contained account of these viewpoints from the perspective of differential equations. Starting from a conditional Gaussian noising process, we derive ordinary differential equation (ODE) and stochastic differential equation (SDE) representations, pass to the corresponding marginal forward dynamics, and then obtain the reverse-time SDE and probability-flow ODE that make generation possible. We show that the central unknown quantity in reverse sampling is the marginal score, explain how score matching becomes the standard denoising objective under a noise-prediction parameterization, and discuss practical reverse-time sampling and guidance. We further place DDPM, DDIM, flow matching, and score-based SDEs in a common framework, and conclude with diffusion language models in continuous embedding space together with a brief discussion of discrete masked-token diffusion. The tutorial is intended as a bridge between the analytical foundations of diffusion processes and the modern generative algorithms built upon them.
Jiayi Fu, Yuxia Wang
INSAIT, Sofia University “St. Kliment Ohridski”, Bulgaria