Method and apparatus for diffusion model

WO2024212160A1PCT designated stage expired Publication Date: 2024-10-17ROBERT BOSCH GMBH +1

Patent Information

Application Number
PCT/CN2023/088025
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2023-04-13
Publication Date
2024-10-17

Smart Images

  • Figure CN2023088025_17102024_PF_FP_ABST
    Figure CN2023088025_17102024_PF_FP_ABST
Patent Text Reader

Abstract

A computer-implemented method for diffusion model is provided. The method comprises: providing a model with inputs, wherein the model is used to estimate a score function in the diffusion model, and the inputs have been perturbed with noises gradually in time to form a diffusion path starting from an original input to a noise; obtaining outputs from the model; and optimizing the model by reducing an error between the outputs and velocities along the diffusion path.
Need to check novelty before this filing date? Find Prior Art

Description

METHOD AND APPARATUS FOR DIFFUSION MODELFIELD

[0001] Aspects of the present disclosure relate generally to artificial intelligence, and more particularly, to a method and a network for a diffusion model.BACKGROUND

[0002] Likelihood estimation is a widely used density estimation benchmark, and accurate likelihood estimation is the key for many applications, such as data compression, anomaly detection, out-of-distribution detection and the like. Many deep generative models can compute tractable likelihood, such as autoregressive models, variational auto-encoders (VAE) , normalizing flows, diffusion models and the like.

[0003] There are two types of diffusion models, one is based on the reverse stochastic differential equation (SDE) , and referred to as diffusion SDE; the other is based on the probability flow ordinary differential equation (ODE) , and referred to as diffusion ODE. These two types of diffusion models define and evaluate the likelihood in different manners: diffusion SDE can be considered as an infinitely-deep VAE, and can only compute a variational lower bound of the likelihood; while diffusion ODE is a variant of continuous normalizing flows, and can compute the exact likelihood by using ODE solvers. Thus, it is natural to anticipate that the likelihood performance of diffusion ODE shall be better than that of diffusion SDE. However, many existing works or methods for training diffusion ODEs cannot achieve a comparable likelihood performance with diffusion SDEs.

[0004] Therefore, it may be desirable to provide an improved method for diffusion ODE to boost the likelihood performance of diffusion ODE.

[0005] SUMMARY

[0006] The following presents a simplified summary of one or more aspects according to the present disclosure in order to provide a basic understanding of such aspects. This summary is not an extensive overview of all contemplated aspects, and is intended to neither identify key or critical elements of all aspects nor delineate the scope of any or all aspects. Its sole purpose is to present some concepts of one or more aspects in a simplified form as a prelude to the more detailed description that is presented later.

[0007] In an aspect of the disclosure, a computer-implemented method for diffusion model is provided, comprising providing a model with inputs, wherein the  model is used to estimate a score function in the diffusion model, and the inputs have been perturbed with noises gradually in time to form a diffusion path starting from an original input to a noise; obtaining outputs from the model; and optimizing the model by reducing an error between the outputs and velocities along the diffusion path.

[0008] In another aspect of the disclosure, apparatus for diffusion model is provided, comprising a memory and at least one processor coupled to the memory. The at least one processor is configured to provide a model with inputs, wherein the model is used to estimate a score function in the diffusion model, and the inputs have been perturbed with noises gradually in time to form a diffusion path starting from an original input to a noise; obtain outputs from the model; and optimize the model by reducing an error between the outputs and velocities along the diffusion path.

[0009] In another aspect of the disclosure, a computer program product for diffusion model is provided, comprising processor executable computer code for providing a model with inputs, wherein the model is used to estimate a score function in the diffusion model, and the inputs have been perturbed with noises gradually in time to form a diffusion path starting from an original input to a noise; obtaining outputs from the model; and optimizing the model by reducing an error between the outputs and velocities along the diffusion path.

[0010] In another aspect of the disclosure, a computer readable medium stores computer code for diffusion model. The computer code when executed by a processor causes the processor to provide a model with inputs, wherein the model is used to estimate a score function in the diffusion model, and the inputs have been perturbed with noises gradually in time to form a diffusion path starting from an original input to a noise; obtain outputs from the model; and optimize the model by reducing an error between the outputs and velocities along the diffusion path.

[0011] By using a velocity prediction along a diffusion path of a diffusion model, the present disclosure may improve the training process for obtaining an estimation of a score function in the diffusion model. Moreover, likelihood performance may be further promoted by a finetuning process proposed in the present disclosure.

[0012] The proposed diffusion model according to one or more aspects of the present disclosure may be used for various applications, such as image generation, speech synthesis, shape generation, lossless compression, molecule generation model, and the like. Although the following disclosure may be described with reference to image generation for some part only for illustration, the present disclosure is applicable to many other application fields beyond the specific application filed of image generation.

[0013] Other aspects or variations of the disclosure, as well as other advantages  thereof will become apparent by consideration of the following detailed description and accompanying drawings.BRIEF DESCRIPTION OF THE DRAWINGS

[0014] The disclosed aspects will hereinafter be described in connection with the appended drawings that are provided to illustrate and not to limit the disclosed aspects.

[0015] FIG. 1 illustrates a schematic diagram for a forward path and a reversal path of a diffusion model.

[0016] FIG. 2 illustrates a schematic diagram for the objective to predict a velocity of diffusion ODE, according to one or more aspects of the present disclosure.

[0017] FIG. 3 illustrates an empirical confirmation for the imbalance mitigation by the velocity prediction according to one or more aspects of the present disclosure.

[0018] FIG. 4 illustrates a workflow of a method for a diffusion ODE according to one or more aspects of the present disclosure.

[0019] FIG. 5 illustrates a workflow of another method for a diffusion ODE according to one or more aspects of the present disclosure.

[0020] FIG. 6 illustrates a workflow of a method for likelihood evaluation of a diffusion ODE according to one or more aspects of the present disclosure.

[0021] FIG. 7 illustrates an example of a hardware implementation for an apparatus according to one or more aspects of the present disclosure.DETAILED DESCRIPTION

[0022] The present disclosure will now be discussed with reference to several example implementations. It is to be understood that these implementations are discussed only for enabling those skilled in the art to better understand and thus implement the embodiments of the present disclosure, rather than suggesting any limitations on the scope of the present disclosure.

[0023] Diffusion models have recently accomplished many tasks, including image generation, audio synthesis, shape generation and the like. Diffusion models may perturb data with a sequence of noise distributions, and may generate samples by learning to reverse this path from noise to data. For example, recent work named variational diffusion models (VDM) , which belongs to a diffusion SDE, has achieved state-of-art likelihood estimation performance on standard image density estimation benchmarks.

[0024] In general, the framework of diffusion models may involve gradually diffusing data distribution towards a given noise distribution using a stochastic  differential equation (SDE) , and learning the time reversal of this SDE for sample generation. Crucially, the reverse-time SDE has a closed-form expression which depends solely on a time-dependent gradient field (i.e., score) of the perturbed data distribution. This gradient field may be efficiently estimated by training a neural network with a weighted combination of score matching losses as the objective. Moreover, diffusion models can be transformed into continuous normalizing flows (CNFs) , thus allowing tractable likelihood computation with numerical ODE solvers.

[0025] Training the neural network with the weighted combination of score matching losses may be much more efficient than training CNFs with maximum likelihood objective. This is because the maximum likelihood training for CNFs requires running an expensive ODE solver for every optimization step, while the weighted combination of score matching losses for training the neural network does not. However, unlike maximum likelihood training, minimizing a combination of score matching losses does not necessarily lead to better likelihood values. Since better likelihoods are useful for many applications, such as data compression, anomaly detection, out-of-distribution detection, semi-supervised learning, adversarial purification and the like, it may be desirable to seek a training objective or network parameterization for diffusion models that is as efficient as score matching but also promotes higher likelihoods.

[0026] FIG. 1 illustrates a schematic diagram for a forward path and a reversal path of a diffusion model. The diffusion model 100 may be a deep generative model (e.g., which is used for image generation) that smoothly transforms data 110 (e.g., an image of a puppy) to a noise 120 (e.g., an image consisting of random pixels) with a diffusion process, and synthesizes samples 140 (e.g., an image of a similar puppy but is not exactly the same one as data 110) by learning the time reversal of this diffusion. Distribution of data 110 may be smoothed by adding noise, gradually removing structure until little of the original signal remains. Sample generation in the diffusion model 100 may depend on time-reversal of the diffusion process, assuming it is initialized with a noise 130 that follows the distribution of the noise 120.

[0027] An SDE can be used to diffuse the data 110 to a sample noise distribution (e.g., noise 120) . This SDE may be reversed once we know the time-dependent gradient field (i.e., score) of the perturbed data distribution. For example, the time-dependent gradient field (i.e., score) of the perturbed data distribution may be considered as a direction for updating the perturbed data to maximize the likelihood. In order to estimate the time-dependent gradient field (i.e., score) of the perturbed data distribution from a given dataset, we can use a neural network by training the neural network with score matching losses as the objective.

[0028] For clarity, following expressions are provided to illustrate the diffusion  process and the reversal process. Suppose we have a d-dimensional data distribution q0 (x0) , diffusion model (e.g., diffusion model 100) may gradually diffuse the data by a forward SDE starting from x0~q0 (x0) : dxt=f (t) xtdt+g (t) dwt, x0~q0 (x0)                      (1)

[0029] Where f (t) ,  are manually designed noise schedules and is a standard Wiener process. The forward process {xt} t∈ [0, T] is accompanied with a series of marginal distributions {qt} t∈ [0, T] , so that with some constant σT>0. Since this is a simple linear SDE, the transition kernel is an analytical Gaussian:  where the coefficients satisfy  Under some regularity conditions, the forward process has an equivalent probability flow ODE:

[0030] which produces the same marginal distribution qt at each time t as that in Equation (1) . For example, every SDE has a corresponding probability flow ODE whose marginal distribution qt at each time t matches that of the SDE in Equation (1) . This ODE may describe fully deterministic dynamics for the process, and still feature the same time-dependent score function

[0031] Under some regularity conditions, the forward process in Equation (1) has a corresponding reversal process from time T to 0 with xT~qT (xT) :

[0032] where is now a standard Wiener process in the reverse-time direction. Here dt represents an infinitesimal negative time step, meaning that the above SDE must be solved from t=T to t=0. This reverse-time SDE allows for the construction of diffusion-based generative models, and its functional form (e.g., in Equation (3) ) reveals that the key target for learning is the time-dependent score function  since it is the only unknown term in Equation (3) .

[0033] Existing methods (e.g., score-based generative models (SGMs) ) use a neural network sθ (xt, t) parameterized by θ to estimate the score function for all and t∈ [0, T] . The neural network may be trained by matching sθ (xt, t) and  with a score matching objective:

[0034] where λ (·) >0 is a weighting function. By approximating the score function with sθ (xt, t) , the existing methods (e.g., score-based generative models (SGMs) ) may define a parameterized reverse SDE from time T to 0 with probability at each time t denoted as  (omitting the subscript θ) . In particular, the parameterized reverse SDE may be defined by:

[0035] Where the marginal distribution of xt is By solving the parameterized reverse SDE, the existing methods (e.g., SGMs) may achieve excellent sample quality in many tasks. For example, after training the neural network sθ (xt, t) with  we can plug the trained neural network into the reverse-time SDE in Equation (5) . Samples may then be generated by solving this reverse-time SDE with numerical SDE solvers.

[0036] Moreover, the KL divergence between q0 (x0) and the marginal distribution can be bounded by the score matching error with the weight g2 (·) :

[0037] Therefore, minimizing is equivalent to maximum likelihood training of

[0038] However, the parameterized reverse SDE cannot be used for exact likelihood evaluation, because we cannot evaluate exactly for a given point  Instead, a corresponding ODE may be used to compute the exact likelihood. Unlike SDEs, the log-density of the ODE can be exactly computed by the “Instantaneous Change of Variables” . By the “Instantaneous Change of Variables” ,  of xt can be computed by integrating:

[0039] where the marginal distribution of xt is

[0040] However, if there is no theoretical guarantee for bounding of diffusion ODEs by the score matching objective For example, after minimizing researchers have found that a diffusion SDE may achieve state-of-the-art sample quality, but the log-likelihood of the corresponding diffusion ODE may be much worse than that of other comparable  models. Such observations pose a serious concern on the behavior of the likelihood of  which may be not well understood by the recent researches.

[0041] Existing works have proved that can be formulated by:

[0042] where,

[0043] To minimize in an efficient manner, a first-order score matching objective may be given as:

[0044] Where xt=αtx0+σt∈, x0~q0 (x0) and is a noise.

[0045] While the score matching objective only depends on the noise schedule, the training process may be affected by many aspects. For example, sθ (xt, t) =-∈θ (xt, t)  / σt is pathological and explosive near t=0.

[0046] In one or more aspects of the present disclosure, the objective or network parameterization may be designed to directly predict a velocity of the diffusion ODE. The parameterized model may be defined by:

[0047] Accordingly, a first-order score matching objective may be given as:

[0048] where  (where we denote for any scalar function f (x) ) is the velocity of the diffusion ODE, which is to be predicted in the parameterized model.

[0049] FIG. 2 illustrates a schematic diagram for the objective to predict a velocity of diffusion ODE, according to one or more aspects of the present disclosure. As shown in the left ellipse of FIG. 2, x0 is sampled from the data distribution q0. As shown in the right ellipse of FIG. 2, ∈ is sampled from a standard Gaussian distribution By independently drawing a pair (x0, ∈) , we can construct a diffusion path using the noise schedule. For example, for each pair (x0, ∈) , where  x0~q0 (x0) and let xt=αtx0+σt∈. As t increases, xt moves from x0 to ∈ gradually, forming a diffusion path (e.g., as denoted by the dotted line in FIG. 2) in the sample space, and v is the velocity along the diffusion path. Thus, minimizing in Equation (12) is to predict the expected velocity for all possible (x0, ∈) pairs.

[0050] By using the objective to predict the velocity of diffusion model according to one or more aspects of the present disclosure, an imbalance problem may be alleviated. A noise prediction model (e.g., as expressed in Equation (10) ) may suffer from the imbalance problem. That is, at small t, xt is similar to data, and extracting the insignificant noise component is hard; while at large t, xt is similar to noise, so the noise prediction is easy and has small error. On the other hand, the velocity prediction has a property that the prediction target v is less relevant to the input xt, resulting in less imbalance during training.

[0051] FIG. 3 illustrates an empirical confirmation for the imbalance mitigation by the velocity prediction according to one or more aspects of the present disclosure. FIG. 3 plots the mean square prediction error with respect to time t for velocity prediction 310 and noise prediction 320, which shows that the velocity prediction may alleviate the imbalance problem by enlarging the training at large t.

[0052] FIG. 4 illustrates a workflow of a method for a diffusion ODE according to one or more aspects of the present disclosure. Method 400 may be performed in a diffusion model (e.g., diffusion model 100) . At step 410, a model may be provided with inputs, wherein the model may be used to estimate a score function in the diffusion model, and the inputs have been perturbed with noises gradually in time to form a diffusion path starting from an original input to a noise. For example, the model may be a neural network used for estimating the time-dependent gradient field (i.e., score) of the perturbed data distribution from a given dataset. The original input may be from the dataset, and has been perturbed using noise, e.g., in a similar way as data 110 to noise 120 of FIG. 1.

[0053] In an aspect of the present disclosure, the model may be parameterized as Equation (11) , to predict a velocity of the diffusion path. As f (t) and g (t) are known noise schedules, the term sθ (xt, t) may be available once the model is converged. In another aspect of the present disclosure, the original input may be an image, or other available representations for texts, audios, shapes or the like.

[0054] At step 420, corresponding outputs may be obtained from the model.

[0055] At step 430, the model may be optimized by reducing an error between the outputs and velocities along the diffusion path.

[0056] In an aspect of the present disclosure, the model may be optimized by using the objective as defined in Equation (12) . By using the objective to predict the velocity of the diffusion path (e.g., the tangent of the diffusion path) , the imbalance problem in the noise prediction (e.g., as expressed in Equation (10) , where the neural network sθ (xt, t) is parameterized to predict the noise component previously added in the input at each time step t to serve as the direction for updating the perturbed data to  maximize the likelihood, which corresponds to a denoising process in the reversal path in FIG. 1) may be alleviated. Since the velocity prediction can have a less relevance to the gradually perturbed inputs than the noise prediction, and thus can improve the training process.

[0057] In another aspect of the present disclosure, the diffusion model may have manually designed noise schedule αt, σt, which may have high freedom and may affect the performance. To decouple a specific schedule form, the objective may be simplified as:

[0058] where denote and

[0059] In an aspect of the present disclosure, the model may be optimized by using importance sampling (IS) . The flow matching may be conducted for all γ in [γ0, γT] through an integral. In practice, the evaluation of the integral is time-consuming, and Monte-Carlo methods may be used to unbiasedly estimate the objective by uniformly sampling γ. In this case, the variance of the Monte-Carlo estimator affects the optimization process. Thus, a continuous importance distribution p (γ) is proposed for variance reduction. Denote then

[0060] In an aspect of the present disclosure, a designed IS may be used. For example, we can choose In this way, the coefficients of  may be a time-invariant constant, and the velocity matching error may not be amplified or shrank at any γ.

[0061] In another aspect of the present disclosure, a learned IS may be used. The variance of the Monte-Carlo estimator depends on the learned network To minimize the variance, another network may be used for parameterize the IS, and the variance may be treated as an objective. Actually, learning p (γ) is equivalent to learning a monotone mapping γ (t) : [0, 1] → [γ0, γT] , which is an inverse cumulative distribution function of p (γ) . We can uniformly sample t, and regard the IS as  change-of-variable from γ to t.

[0062] Suppose we parameterize γ (t) with η. Denote which is a Monte-Carlo estimator of Since its variance  and is invariant to γη (t) , we can minimize for invariance reduction.

[0063] FIG. 5 illustrates a workflow of another method for a diffusion ODE according to one or more aspects of the present disclosure. Method 500 may be an extension of method 400. The objective used in method 400 may restrict the distance between vθ and optimal v*. Method 500 may further restrict the divergence between  and The precision and smoothness of the trace will affect the likelihood performance and the number of function evaluation for sampling. Operations performed at steps 510, 520, 530 of method 500 may be similar to that at steps 410, 420 and 430 of method 400. Suppose we have a first-order velocity estimator obtained through steps 510, 520, 530, at step 540, a second-order trace velocity model may be learned, which minimizes:

[0064] By optimizing

[0065] where xt=αtx0+σt∈

[0066] In practice, we choose for self-regularizing. Similarly, the corresponding second-order objective may be rewritten as:

[0067] where is the stop-gradient version of

[0068] In one aspect of the present disclosure, the model may be trained by optimizing the first-order flow matching objective for enough iterations, so that the first-order velocity prediction may have little error. Then, the trained first-order model may be finetuned by using a mixture of a first-order and a second-order flow matching objectives by:

[0069] In one aspect of the present disclosure, since the first-order matching accuracy is critical to the second-order matching, the coefficient λ in the mixed loss may be set to a small value, e.g., 0.1. A large λ may make the training unstable or even degenerate the likelihood performance.

[0070] FIG. 6 illustrates a workflow of a method for likelihood evaluation of a diffusion ODE according to one or more aspects of the present disclosure. Method 600 may evaluate the likelihood of the diffusion ODE. Many real-world datasets usually contain discrete data, such as images or texts. In such cases, learning a continuous density model to these discrete data points will cause degenerate results and cannot provide meaningful density estimations. A common solution is dequantization. For example, suppose x0 is N-bit discrete data scaled to [-1, 1] . Dequantization methods assume that a continuous model pmodel for distribution of x0 has been trained, and the discrete model may be defined as:

[0071] At step 650, a sample may be generated based on the score function estimated by the model of method 400 and / or 500, wherein the sample may comprise discrete data. For example, after training the model according to one or more aspects of method 400 and / or 500, samples may then be generated by solving this reverse-time SDE with numerical SDE solvers according to Equation (3) .

[0072] At step 660, a continuous model for estimating a distribution of the original input (e.g., x0) may be obtained. For example, the continuous model may be obtained according to Equation (7) . In one aspect of the present disclosure, theoretically, we want to train a diffusion ODE by minimizing DKL (q0||p0) and use p0 (x0) for the continuous model. However, as σ0=0, we have γ0=-∞. Due to this, there are numerical issues near t=0 for both training and sampling, so it may be unavailable to directly compute the continuous model p0 at time 0. In practice, a small  starting time ∈>0 may be selected to improve numerical stability. After choosing ∈, the continuous model may be defined by pmodel (x) : =p∈ (x) .

[0073] At step 670, a likelihood of the sample may be estimated by providing the continuous model with the sample perturbed with a noise, wherein the noise follows a truncated-normal distribution.

[0074] In one aspect of the present disclosure, the noise u follows a truncated-normal distribution as:

[0075] The proposed u~q (u|x0) may fill the gap between the training input x∈=α∈x0+σ∈∈ (where and choosing a small starting time ∈>0 may improve numerical stability) and the testing input x0+u. By inducing the proposed noise u~q (u|x0) , the training input and the testing input may be virtually identically distributed, resulting in a negligible training-evaluation gap. Such a truncated-normal dequantization can provide a tighter variational bound yet without additional training costs.

[0076] In one aspect of the present disclosure, the truncated-normal dequantization is training-free, and the discrete model distribution has the following variational bound:

[0077] where

[0078] Φ is the cumulative distribution function of standard normal distribution, and erf (·) is the error function.

[0079] Additionally, the discrete model distribution has the following importance weighted variational bound under the truncated-normal dequantization:

[0080] where

[0081] In one or more aspects of the present disclosure, the truncated-normal dequantization may provide a guideline for choosing the start time ∈. To avoid a large deviation from the truncation by  (e.g.,  for N=8) , we need to ensure that  in most cases. We leverage the 3-σ principle for standard normal distribution and let ∈ to satisfy As the critical start time ∈satisfies that the negative log-SNR

[0082] Some experiment results are also provided herein to demonstrate advantages of one or more aspects of the proposed methods. The proposed methods or processes may be feasible for any noise schedule αγ, σγ. For illustration, two specific noise schedules are selected for the experiments.

[0083] Variance Preserving (VP) ,  This schedule is widely used in diffusion models, which yields a process with a fixed variance of one when the initial distribution has unit variance.

[0084] Straight Path (SP) , αγ+σγ=1. This schedule is claimed by other works that it leads to better dynamics, since the pairwise diffusion path is a straight line.

[0085] Under these two schedules, αγ, σγ are uniquely determined by γ.

[0086] Table 1 shows the experiment results on CIFAR-10 and ImageNet-32 datasets.

[0087] Table 1

[0088] where NLL denotes Negative log-likelihood in bits / dim (bpd) . Results with “ / ” means there is no result reported in the original papers. The proposed methods train a model with the velocity prediction and the designed IS, and finetune the model with the second-order flow matching. We report the likelihood values using the proposed importance weighted variational bound under the truncated-normal dequantization with importance weighted estimator with K=20.

[0089] FIG. 7 illustrates an example of a hardware implementation for an apparatus 700 according to one or more aspects of the present disclosure. The apparatus 700 for diffusion model may comprise a memory 710 and at least one processor 720. The processor 720 may be coupled to the memory 710 and configured to perform the methods 400, 500 and 600 described above with reference to FIGs. 4, 5 and 6. The processor 720 may be a general-purpose processor, or may also be implemented as a combination of computing devices, e.g., a combination of a DSP and a microprocessor, multiple microprocessors, one or more microprocessors in conjunction with a DSP core, or any other such configuration. The memory 710 may store the input data, output data, data generated by processor 720, and / or instructions executed by processor 720.

[0090] The various operations, models, and networks described in connection with the disclosure herein may be implemented in hardware, software executed by a processor, firmware, or any combination thereof. According an embodiment of the disclosure, a computer program product for diffusion model may comprise processor executable computer code for performing the methods 400, 500 and 600 described above with reference to FIGs. 4, 5 and 6. According to another embodiment of the disclosure, a computer readable medium may store computer code for diffusion model, the computer code when executed by a processor may cause the processor to perform the methods 400, 500 and 600 described above with reference to FIGs. 4, 5 and 6. Computer-readable media includes both non-transitory computer storage media and communication media including any medium that facilitates transfer of a computer program from one place to another. Any connection may be properly termed as a computer-readable medium. Other embodiments and implementations are within the scope of the disclosure.

[0091] In an embodiment, the diffusion model may comprise a diffusion ordinary differential equation (ODE) , and the score function may indicate a time-dependent gradient of distribution of the perturbed inputs. For example, the score function may be denoted as as described above.

[0092] In an embodiment, a second-order flow matching may be performed on the  optimized model to reduce a divergence between a trace for the outputs from the model and a trace for the velocities along the diffusion path. For example, the trained first-order model may be finetuned by using a mixture of a first-order and a second-order flow matching objectives. For another example, the trained first-order model may be finetuned by using the second-order flow matching objective.

[0093] In an embodiment, a designed importance sampling (IS) or a learned IS may be adopted in the optimizing of the model and / or the performing of the second-order flow matching on the optimized model. For example, an adaptive IS may be used in the learned IS. We parameterize:

[0094] where is a dense monotone increasing network. For example, we use a two-layer fully-connected network where φ is the sigmoid activation function, l1 and l2 are linear layers with positive weight and output units of 1024 and 1.

[0095] In an embodiment, the likelihood of the sample generated based on the score function estimated by the model may comprise a variational bound. For example, the variational bound may comprise a variational bound under the truncated- normal dequantization as denoted in Equation (22) , or an importance weighted variational bound under the truncated-normal dequantization as denoted in Equation (23) .

[0096] The preceding description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the various embodiments. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the scope of the various embodiments. Thus, the claims are not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the following claims and the principles and novel features disclosed herein.

Claims

1.A computer-implemented method for a diffusion model, comprising:providing a model with inputs, wherein the model is used to estimate a score function in the diffusion model, and the inputs have been perturbed with noises gradually in time to form a diffusion path starting from an original input to a noise;obtaining outputs from the model; andoptimizing the model by reducing an error between the outputs and velocities along the diffusion path.2.The computer-implemented method of claim 1, wherein the diffusion model comprises a diffusion ordinary differential equation (ODE) , and the score function indicates a time-dependent gradient of distribution of the perturbed inputs.3.The computer-implemented method of claim 1, further comprising:performing a second-order flow matching on the optimized model to reduce a divergence between a trace for the outputs from the model and a trace for the velocities along the diffusion path.4.The computer-implemented method of claim 1, wherein a designed importance sampling (IS) or a learned IS is adopted in the optimizing.5.The computer-implemented method of claim 3, wherein a designed importance sampling (IS) or a learned IS is adopted in the performing of the second-order flow matching.6.The computer-implemented method of claim 1, further comprising:generating a sample based on the score function estimated by the model, wherein the sample comprises discrete data;obtain a continuous model for estimating a distribution of the original input; andestimating a likelihood of the sample by providing the continuous model with the sample perturbed with a noise, wherein the noise follows a truncated-normal distribution.7.The computer-implemented method of claim 6, wherein the likelihood comprises a variational bound based on a prediction by the continuous model on the sample perturbed with the noise.8.A computer-implemented method for a diffusion model, comprising:providing a model with inputs, wherein the model is used to estimate a score function in the diffusion model, and the inputs have been perturbed with noises gradually in time to form a diffusion path starting from an original input to a noise;obtaining outputs from the model; andoptimizing the model by reducing an error between the outputs and velocities along the diffusion path;wherein the inputs comprise images or representations for texts, audios, or shapes.9.An apparatus for a diffusion model, comprising:a memory; andat least one processor coupled to the memory and configured to perform the method of one of claims 1-7.10.A computer program product for a diffusion model, comprising: processor executable computer code for performing the method of one of claims 1-7.11.A computer readable medium, storing computer code for a diffusion model, the computer code when executed by a processor, causing the processor to perform the method of one of claims 1-7.

Citation Information

Patent Citations

  • Single-frame image super-resolution processing method based on diffusion model

    CN113177882A

  • Acoustic model post-processing method based on probability diffusion model, server and readable memory

    CN114512114A

  • Making time-series predictions of a computer-controlled system

    US20210397955A1

  • Denoising diffusion generative adversarial networks

    US20230095092A1

  • Diffusion-based generative modeling for synthetic data generation systems and applications

    US20230109379A1

Cited By

  • Multi-modal small sample data driven anomaly detection method and system and storage medium

    CN119205736A

  • Large model memory extraction method and system

    CN122636786A