In machine learning, discrete diffusion models are a class of diffusion models, which themselves are a class of latent variable generative models. Each discrete diffusion model consists of two major components: the forward jump diffusion process, and the reverse jump diffusion process. The goal of diffusion modeling is, given a given dataset and a forward process, to learn a model for the reverse process, such that the reverse process can generate new elements that are distributed similarly as the original dataset. A trained discrete diffusion model can be sampled in many ways, which trades off computational efficiency and sample quality. In general, higher quality data can be obtained, but at the price of higher computational cost. In standard diffusion modeling, the diffusion process takes place over a state space that is continuous space of ℝn, but over a discrete set S. A discrete set is simply a set where one cannot speak of "infinitesimally close" points. Points can be more or less separated from each other, but the separation is always a finite number. This in particular means the standard framework of continuous diffusion does not apply, since it uses gaussian noise, which is continuous. Nevertheless, an analogous theory can be produced. Discrete diffusion is usually used for language modeling. In practice, the state space S is not only discrete, but finite, so this is what we will assume from now on.
Continuous time Markov process In the case of continuous state space, during the forward discrete diffusion process, at each step t→t+dt, we mix in an infinitesimal amount of gaussian noise dxt=−12β(t)xtdt+β(t)dWt. This changes the probability density function, by first a convolution with the density of a gaussian, followed by a scaling. In the case of discrete state space, the gaussian noise must be replaced by a noise that takes values over a finite set. For example, if the noise is the uniform distribution over S, then the probability distribution at time t+dt satisfiesqt+dt(x)=(1−dt)qt(x)+dt(1|S|∑y∈Sqt(y))More succinctly,∂tqt(x)=−(1−1|S|)qt(x)+∑y∈S,y≠x1|S|qt(y)In general, we do not need to convolve with a uniformly distributed noise, but with an arbitrary noise process. That is, we use an arbitrary matrix Qt such that∂tqt(y)=∑x∈SQt(y,x)qt(x)where Qt is called the rate matrix. Any matrix may be used as a rate matrix if it has non-negative off-diagonals, and each column sums to 0:Qt(y,x)≥0∀y≠x,∑y∈SQt(y,x)=0∀xA continuous time Markov chain (CTMC) is defined by a continuous function Q that maps any time t∈[0,T) to a rate matrix Qt. Given the function Q, time-evolution under the CTMC is done as follows: Given state xt at time t, and given an infinitesimal dt, the state at t+dt is xt+dt, such thatPr(xt+dt|xt)={1+Qt(xt+dt,xt)dtif xt+dt=xtQt(xt+dt,xt)dtelseThis implies that the probability distribution function evolves according to∂tqt(y)=∑x∈SQt(y,x)qt(x)which is what we previously specified.
Backward process Similarly to the case of continuous diffusion, in discrete diffusion, there exists a backward diffusion process Q¯t:s(x,t)y:=qt(y)qt(x),Q¯t(y,x):={s(x,t)yQt(x,y)if y≠x−∑y:y≠xQ¯t(y,x)if y=xwhere s(x,t)y should be interpreted as the discrete score or concrete score, since, abusing notation a bit, the score function is ∇lnρt(x)=1dx(ρt(x+dx)ρt(x)−1). If we picture the distribution qt as a bunch of point-masses, one per state x∈S, then the forward diffusion from time t to t+dt is performed by removing Qt(x,y)qt(y)dt from the mass at y and moving it to the mass at x, for each pair x≠y. Thus, the process is reversed in detail by the CTMC defined by Q¯, since Q¯t(y,x)qt(x)=Qt(x,y)qt(y). Given Q¯t, if we have a way to sample from qt, then we can sample from qt−dt by first sampling xt∼qt, then sampling xt−dt according toPr(xt−dt|xt)={1+Q¯t(xt−dt,xt)dtif xt−dt=xtQ¯t(xt−dt,xt)dtelse
Overall plan of score-matching discrete diffusion modeling Similar to score-matching continuous diffusion, score-matching discrete diffusion is a method to sample an initial distribution. If we have a certain function sθ that approximates the true score function sθ(x,t)y≈s(x,t)y, then it allows a corresponding Q¯θ to be defined in the same way. If we also have a base distribution qbase such that it is easy to sample from, and approximately equal to the true terminal distribution qbase≈qT, then we can perform the backward CTMC with Q¯θ and qTθ:=qterminal. When both approximations are good, the backward CTMC would give q0θ≈q0. This is the idea of score-matching discrete diffusion modeling. If qdata is sharp, in the sense that for some x,x′, we have qdata(x)≫qdata(x′), then the score function would diverge as 1/t at the t→0 limit. To avoid this in practice, it is common to use early stopping, which is to stop the backward process at some time δ>0, and sample from qδθ instead of q0θ.
… excerpt ends here. Continue reading the full article.