AdjointDPM: Adjoint Sensitivity Method for Gradient Backpropagation of Diffusion Probabilistic Models
Jiachun Pan, Jun Hao Liew, Vincent Y. F. Tan, Jiashi Feng, Hanshu Yan
Abstract
This paper considers a ubiquitous problem underlying several applications of DPMs, i.e., optimizing the parameters of DPMs when the objective is a differentiable metric defined on the generated contents. Since the sampling procedure of DPMs involves recursive calls to the denoising UNet, naïve gradient backpropagation requires storing the intermediate states of all iterations, resulting in extremely high memory consumption. To overcome this issue, we propose a novel method AdjointDPM, which first generates new samples from diffusion models by solving the corresponding probability-flow ODEs. It then uses the adjoint sensitivity method to backpropagate the gradients of the loss to the models' parameters (including conditioning signals, network weights, and initial noises) by solving another augmented ODE. To reduce numerical errors in both the forward generation and gradient backpropagation processes, we further reparameterize the probability-flow ODE and augmented ODE as simple non-stiff ODEs using exponential integration. AdjointDPM can effectively compute the gradients of all types of parameters in DPMs, including the network weights, conditioning text prompts, and noisy states. Finally, we demonstrate the effectiveness of AdjointDPM on several interesting tasks: guided generation via modifying sampling trajectories, finetuning DPM weights for stylization, and converting visual effects into text embeddings. 1 * Equal contribution. This work was completed during Jiachun Pan's internship at ByteDance.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 8f8cb64d-8191-468d-a6c7-181b5195e4cdCited by top-tier papers9
- PeRFlow: Piecewise Rectified Flow as Universal Plug-and-Play AcceleratorHanshu Yan, Xingchao Liu, Jiachun Pan, Jun Hao Liew et al.NeurIPS 2024 · 108 citations
- Gradient Guidance for Diffusion Models: An Optimization PerspectiveYingqing Guo, Hui Yuan, Yukang Yang, Minshuo Chen et al.NeurIPS 2024 · 79 citations
- Understanding and Improving Training-free Loss-based Diffusion GuidanceYifei Shen, Xinyang Jiang, Yifan Yang, Yezhen Wang et al.NeurIPS 2024 · 36 citations
- Training-Free Guidance Beyond Differentiability: Scalable Path Steering with Tree Search in Diffusion and Flow ModelsYingqing Guo, Yukang Yang, Hui Yuan, Mengdi WangNeurIPS 2025 · 29 citations
- AdjointDEIS: Efficient Gradients for Diffusion ModelsZander W. Blasingame, Chen LiuNeurIPS 2024 · 8 citations
Builds on27
- Learning Transferable Visual Models From Natural Language SupervisionAlec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh et al.ICML 2021 · 47,906 citations
- Denoising Diffusion Probabilistic ModelsJonathan Ho, Ajay Jain, Pieter AbbeelNeurIPS 2020 · 35,902 citations
- Diffusion Models Beat GANs on Image SynthesisPrafulla Dhariwal, Alexander Quinn NicholNeurIPS 2021 · 13,211 citations
- High-Resolution Image Synthesis with Latent Diffusion ModelsRobin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser et al.CVPR 2022 · 13,123 citations
- Photorealistic Text-to-Image Diffusion Models with Deep Language UnderstandingChitwan Saharia, William Chan, Saurabh Saxena, Lala Li et al.NeurIPS 2022 · 8,965 citations
Related papers
- Efficient Diffusion Models via Time Step Optimization with Consistent Training and Inference ConstraintsBinrui Wu, Zihao Cheng, Yuesen Liao, Weizhong ZhangICML 2026
- FlowGrad: Controlling the Output of Generative ODEs with GradientsXingchao Liu, Lemeng Wu, Shujian Zhang, Chengyue Gong et al.CVPR 2023
- DPM-Solver: A Fast ODE Solver for Diffusion Probabilistic Model Sampling in Around 10 StepsCheng Lu, Yuhao Zhou, Fan Bao, Jianfei Chen et al.NeurIPS 2022 · 2,653 citations
- SEEDS: Exponential SDE Solvers for Fast High-Quality Sampling from Diffusion ModelsMartin Gonzalez, Nelson Fernández, Thuy Tran, Elies Gherbi et al.NeurIPS 2023 · 43 citations
- On Exact Inversion of DPM-SolversSeongmin Hong, Kyeonghyun Lee, Suh Yoon Jeon, Hyewon Bae et al.CVPR 2024
