Exploring the Optimal Choice for Generative Processes in Diffusion Models: Ordinary vs Stochastic Differential Equations

Yu Cao,Jingrun Chen,Yixin Luo,Xiang Zhou
2023-11-07
Abstract:The diffusion model has shown remarkable success in computer vision, but it remains unclear whether the ODE-based probability flow or the SDE-based diffusion model is more superior and under what circumstances. Comparing the two is challenging due to dependencies on data distributions, score training, and other numerical issues. In this paper, we study the problem mathematically for two limiting scenarios: the zero diffusion (ODE) case and the large diffusion case. We first introduce a pulse-shape error to perturb the score function and analyze error accumulation of sampling quality, followed by a thorough analysis for generalization to arbitrary error. Our findings indicate that when the perturbation occurs at the end of the generative process, the ODE model outperforms the SDE model with a large diffusion coefficient. However, when the perturbation occurs earlier, the SDE model outperforms the ODE model, and we demonstrate that the error of sample generation due to such a pulse-shape perturbation is exponentially suppressed as the diffusion term's magnitude increases to infinity. Numerical validation of this phenomenon is provided using Gaussian, Gaussian mixture, and Swiss roll distribution, as well as realistic datasets like MNIST and CIFAR-10.
Machine Learning
What problem does this paper attempt to address?
The paper primarily explores the optimal choice of the generation process in diffusion models, specifically comparing the probability flow model based on ordinary differential equations (ODE) with the diffusion model based on stochastic differential equations (SDE). Specifically, the core issue of the study is to determine under what circumstances the ODE model or the SDE model is superior. The main contributions of the paper are as follows: 1. **Theoretical Analysis**: - When there is an error in training the score function, and this error only occurs at the beginning of the inference step (i.e., at the end of the generation process), the performance of the ODE model (\(h=0\)) is superior to that of the SDE model (\(h \rightarrow \infty\)). (See Prop. 3.5) - If the aforementioned error occurs in the middle stage of the process, then as \(h \rightarrow \infty\), the performance of the SDE model will be exponentially superior to that of the ODE model. (See Prop. 3.4) 2. **General Case of Error**: - For general score training errors, when \(h \rightarrow \infty\), the leading term of the generation sample error \(L(h)\) will exponentially converge to a constant that only depends on the data distribution and the score training error at the end of the generation process. (See Prop. 3.6) 3. **Numerical Validation**: - The paper conducts numerical validation through Gaussian distribution, Gaussian mixture distribution, Swiss roll distribution, and real datasets MNIST and CIFAR-10 to support the above theoretical results. In summary, through theoretical analysis and numerical experiments, the paper reveals the different performances of the ODE model and the SDE model in handling score function errors under different conditions, providing deep insights into the choice between the two models in diffusion models. Additionally, the paper proposes a possible method to adjust the loss function during the training process to adapt to specific diffusion coefficients, providing a direction for further research.