AdjointDEIS: Efficient Gradients for Diffusion Models
Zander W. Blasingame, Chen Liu
TL;DR
The paper tackles memory-efficient gradient computation through guided diffusion models by formulating continuous adjoint equations and introducing AdjointDEIS, a family of bespoke exponential-integrator solvers for the adjoint dynamics. It shows that adjoint equations for diffusion SDEs conveniently reduce to an ODE, enabling efficient, high-order solutions with convergence guarantees, and extends the framework to time-varying conditioning. The approach is demonstrated via training-free guided generation on a face-morphing task, where AdjointDEIS outperforms prior methods in gradient-guided morphing while providing a principled numerical foundation. The authors also provide theoretical analyses, practical solvers (AdjointDEIS-1 and AdjointDEIS-2M), and open-source code, enabling reproducibility and broader applicability to diffusion-based guidance tasks. Overall, AdjointDEIS offers a scalable, accurate means to backpropagate through diffusion processes for guided generation, with potential impact across editing, inversion, and adversarial-context applications.
Abstract
The optimization of the latents and parameters of diffusion models with respect to some differentiable metric defined on the output of the model is a challenging and complex problem. The sampling for diffusion models is done by solving either the probability flow ODE or diffusion SDE wherein a neural network approximates the score function allowing a numerical ODE/SDE solver to be used. However, naive backpropagation techniques are memory intensive, requiring the storage of all intermediate states, and face additional complexity in handling the injected noise from the diffusion term of the diffusion SDE. We propose a novel family of bespoke ODE solvers to the continuous adjoint equations for diffusion models, which we call AdjointDEIS. We exploit the unique construction of diffusion SDEs to further simplify the formulation of the continuous adjoint equations using exponential integrators. Moreover, we provide convergence order guarantees for our bespoke solvers. Significantly, we show that continuous adjoint equations for diffusion SDEs actually simplify to a simple ODE. Lastly, we demonstrate the effectiveness of AdjointDEIS for guided generation with an adversarial attack in the form of the face morphing problem. Our code will be released at https: //github.com/zblasingame/AdjointDEIS.
