Binomial Diffusion
A first-principles reading note on Sohl-Dickstein et al. (2015)
This tutorial develops the paper’s binomial diffusion model from a two-state Markov chain. The paper writes the state at time \(t\) as \(x^{(t)}\); here we write \(X_t\). The main thread is the forward kernel, the analytically available posterior target, the likelihood-bound objective, and ancestral sampling. This discrete construction does not require a score, Gaussian noise prediction, or a continuous-time SDE.
1. The generative question
Let the data distribution be \(q_0(x)\). We define a known forward Markov chain
\[X_0\longrightarrow X_1\longrightarrow\cdots\longrightarrow X_T,\]
whose transitions progressively remove information about \(X_0\). The terminal law is chosen to be simple, so that generation can start from it. The generative model then runs a learned Markov chain in reverse:
\[X_T\sim\pi,\qquad X_{t-1}\sim p_\theta(\cdot\mid X_t),\quad t=T,T-1,\ldots,1.\]
The forward kernel \(q(x_t\mid x_{t-1})\) is known. The desired marginal reverse kernel,
\[q(x_{t-1}\mid x_t),\]
depends on the data distribution and is generally not available in closed form. But if a training example \(x_0\) is also given, Bayes’ rule gives an analytical target:
\[\boxed{q(x_{t-1}\mid x_t,x_0).}\]
The central training question is how learning against this example-conditioned target can teach a model that only sees \(x_t\) at generation time. We first solve that question for a single binary variable.
2. A two-state forward Markov chain
Let \(X_t\in\{0,1\}\). Sohl-Dickstein et al. define the forward corruption step this way: with probability \(1-\beta_t\), keep the current bit; with probability \(\beta_t\), replace it by a fresh fair bit. Replacement does not always change the bit: the new fair bit matches the old one half of the time. Therefore the probability of an actual flip is
\[r_t=\frac{\beta_t}{2}.\]
The same forward step can now be written directly as a transition kernel:
\[Q_t=\begin{pmatrix} 1-r_t&r_t\\ r_t&1-r_t \end{pmatrix},\qquad 0\le\beta_t\le 1.\]
Rows index \(X_{t-1}\) and columns index \(X_t\). Thus each bit flips with probability \(r_t\) and stays the same with probability \(1-r_t\). In scalar form, the same kernel is
\[q(X_t=1\mid X_{t-1}=x) =r_t+(1-2r_t)x =\frac{\beta_t}{2}+(1-\beta_t)x.\]
When \(r_t=0\), the bit is copied with certainty. When \(r_t=1/2\), the next bit is a fresh fair Bernoulli sample, independent of the previous bit.
2.1. The common invariant distribution
The rate can vary with time, so the forward process is generally time-inhomogeneous. Still, the fair distribution \(\pi=(1/2,1/2)\) is unchanged by every individual forward kernel:
\[\pi Q_t=\pi.\]
To see why it is the stationary law, write a general distribution as \(\pi=(\pi_0,\pi_1)\). After one transition, the probability of state \(1\) is
\[\pi_0r_t+\pi_1(1-r_t).\]
At stationarity this must equal \(\pi_1\). If \(r_t>0\), rearranging gives \(\pi_0=\pi_1\), and because the probabilities sum to one, \(\pi_0=\pi_1=1/2\). Thus the fair distribution is unique whenever the bit can actually flip. When \(r_t=0\), the chain never changes state, so every initial distribution is stationary. Stationarity describes the marginal law; individual bit trajectories can continue to change even when their marginal distribution is already fair.
2.2. Repeated transitions
The eigenvectors of \(Q_t\) do not depend on \(t\). The vector that treats the two states equally and the vector that contrasts them are
\[u_+=\frac1{\sqrt2}\begin{pmatrix}1\\1\end{pmatrix},\qquad u_-=\frac1{\sqrt2}\begin{pmatrix}1\\-1\end{pmatrix}.\]
The first is unchanged by the transition, so its eigenvalue is \(1\). The second is multiplied by \(1-2r_t\): each flip reduces the difference between the probabilities of states \(0\) and \(1\). Put these eigenvectors into the orthogonal matrix \(U=[u_+\;u_-]\). Then
\[Q_t=U\begin{pmatrix}1&0\\0&1-2r_t\end{pmatrix}U^\mathsf T.\]
For a constant flip rate \(r\), all steps use the same matrix \(Q\), so its \(n\)-step transition is obtained by raising each eigenvalue to the \(n\)th power:
\[Q^n=U\begin{pmatrix}1&0\\0&(1-2r)^n\end{pmatrix}U^\mathsf T =\frac12\begin{pmatrix} 1+(1-2r)^n&1-(1-2r)^n\\ 1-(1-2r)^n&1+(1-2r)^n \end{pmatrix}.\]
For a time-varying rate, the matrices still share the same eigenvectors. Multiplying the diagonal forms therefore multiplies the contrast eigenvalues:
\[Q_1Q_2\cdots Q_t =U\begin{pmatrix}1&0\\0&\prod_{s=1}^t(1-2r_s)\end{pmatrix}U^\mathsf T.\]
Since \(r_s=\beta_s/2\), define
\[\alpha_t=1-\beta_t,\qquad \bar\alpha_t=\prod_{s=1}^t\alpha_s,\qquad \bar\alpha_0=1.\]
Expanding the product gives the closed-form forward kernel:
\[Q_1Q_2\cdots Q_t= \frac12\begin{pmatrix} 1+\prod_{s=1}^{t}(1-2r_s)&1-\prod_{s=1}^{t}(1-2r_s)\\ 1-\prod_{s=1}^{t}(1-2r_s)&1+\prod_{s=1}^{t}(1-2r_s) \end{pmatrix} =\frac12\begin{pmatrix} 1+\bar\alpha_t&1-\bar\alpha_t\\ 1-\bar\alpha_t&1+\bar\alpha_t \end{pmatrix}.\]
The \((x_0,x_t)\) entry of this matrix sums over every possible intermediate state:
\[q(x_t\mid x_0) =\sum_{x_1,\ldots,x_{t-1}} q(x_1\mid x_0)q(x_2\mid x_1)\cdots q(x_t\mid x_{t-1}).\]
Thus matrix multiplication has already summed out the unobserved intermediate bits. We can evaluate the distribution at any time \(t\) directly from \(x_0\) and the schedule, without simulating or recording the intervening states.
In particular,
\[\boxed{q(X_t=1\mid X_0=x_0) =\frac12+\bar\alpha_t\left(x_0-\frac12\right).}\]
The coefficient \(\bar\alpha_t\) is the fraction of the initial bit’s contrast with a fair bit that remains at time \(t\). We can sample \(X_t\) directly from this formula without simulating every intermediate transition.
For a fixed \(0<r\le 1/2\), the state-dependent part vanishes as \(n\) increases, and each row approaches the fair distribution. At the edge case \(r=0\), no mixing occurs and the initial state is retained forever.
2.3. The paper’s binomial schedule
Sohl-Dickstein et al. choose a schedule that removes an equal fraction of the original signal at each step:
\[\beta_t=\frac1{T-t+1},\qquad \bar\alpha_t=\frac{T-t}{T}.\]
This schedule reaches \(\bar\alpha_T=0\), so the terminal bit is exactly fair and independent of its initial value.
2.4. A general Bernoulli reference distribution
Fair-bit replacement is the special case where the reference law is \(\operatorname{Bernoulli}(1/2)\). More generally, let the desired stationary reference be \(\pi=\operatorname{Bernoulli}(p_\star)\). At each step, copy the current bit with probability \(1-\beta_t\) and otherwise draw a fresh bit from \(\operatorname{Bernoulli}(p_\star)\). Then
\[q(X_t=1\mid X_{t-1}=x)=(1-\beta_t)x+\beta_t p_\star.\]
If \(X_{t-1}\sim\operatorname{Bernoulli}(p_\star)\), this transition leaves its law unchanged. The cumulative conditional probability is
\[q(X_t=1\mid X_0=x_0)=p_\star+\bar\alpha_t(x_0-p_\star).\]
Thus the same schedule with \(\bar\alpha_T=0\) ends exactly at the chosen reference law. Table App.1 displays the fair-bit case; Appendix D.1.2 uses an independent Bernoulli terminal prior with \(p_\star=0.2\) for the binary-heartbeat experiment, matching its data’s mean activity. Both fit the general replace-from-\(\pi\) construction; the fair-bit chain above is the symmetric special case.
3. Forward corruption of a binary vector
Now let \(X_0\in\{0,1\}^d\). The forward process corrupts coordinates independently, conditional on the preceding vector:
\[q(x_t\mid x_{t-1})=\prod_{i=1}^d q(x_{t,i}\mid x_{t-1,i}).\]
It follows that
\[q(x_t\mid x_0)=\prod_{i=1}^d q(x_{t,i}\mid x_{0,i}),\]
with each factor given by the single-bit formula above. This conditional factorization holds even if the coordinates in the data distribution \(q_0\) are strongly dependent. The marginal \(q_t(x_t)\) can still have dependencies because it averages over dependent clean data.
At the final step of the schedule above, \(\bar\alpha_T=0\) and, for the fair-bit case,
\[q(x_T\mid x_0)=2^{-d}.\]
Thus the terminal prior is a vector of independent fair bits in the symmetric case. Under the general reference in Section 2.4, it is instead a vector of independent \(\operatorname{Bernoulli}(p_\star)\) bits. The forward process has produced a tractable starting law for the reverse generative chain.
4. An analytical reverse target for one bit
For a single bit, Bayes’ rule and the forward Markov property give
\[q(x_{t-1}\mid x_t,x_0) =\frac{q(x_t\mid x_{t-1})q(x_{t-1}\mid x_0)} {q(x_t\mid x_0)}.\]
We derive the target for the symmetric forward kernel from Section 2, where the actual bit-flip probability is \(r_t=\beta_t/2\). Every quantity on the right is known once \(x_0\) and \(x_t\) are given. The distribution of the previous bit before observing \(x_t\) is
\[a_{t-1}=q(X_{t-1}=1\mid X_0=x_0) =\frac12+\bar\alpha_{t-1}\left(x_0-\frac12\right).\]
For the observed bit \(b=x_t\), the forward kernel gives the likelihoods under the two possible previous bits:
\[L_1(b)=q(X_t=b\mid X_{t-1}=1) =\left(1-r_t\right)^b r_t^{1-b},\]
\[L_0(b)=q(X_t=b\mid X_{t-1}=0) =r_t^b\left(1-r_t\right)^{1-b}.\]
The posterior probability that the previous bit was one is
\[\boxed{\rho_t(x_0,b) =q(X_{t-1}=1\mid X_t=b,X_0=x_0) =\frac{a_{t-1}L_1(b)} {a_{t-1}L_1(b)+(1-a_{t-1})L_0(b)}.}\]
So the example-conditioned reverse target is a Bernoulli distribution:
\[q(X_{t-1}\mid X_t=b,X_0=x_0) =\operatorname{Bernoulli}(\rho_t(x_0,b)).\]
A three-step calculation
Take \(T=3\) and Sohl-Dickstein’s schedule. Then \(\beta_1=1/3\), \(\beta_2=1/2\), and \(\beta_3=1\). Suppose \(X_0=1\) and at step \(t=2\) we observe \(X_2=1\). Since \(\bar\alpha_1=2/3\),
\[a_1=q(X_1=1\mid X_0=1)=\frac12+\frac23\frac12=\frac56.\]
At step 2, \(r_2=1/4\). The likelihoods are \(L_1(1)=3/4\) and \(L_0(1)=1/4\), so
\[q(X_1=1\mid X_2=1,X_0=1) =\frac{(5/6)(3/4)}{(5/6)(3/4)+(1/6)(1/4)} =\frac{15}{16}.\]
This is a soft posterior target. In another forward draw with the same \(x_0\) and observed \(x_t\), the sampled \(x_{t-1}\) could differ; the posterior probability summarizes that uncertainty.
5. Cross-entropy training recovers the marginal reverse probability
The neural network sees the noisy bit and its time, not the clean origin. Let
\[f_\theta(x_t,t)\in(0,1)\]
be its predicted probability that \(X_{t-1}=1\). Train it against the analytical posterior target \(\rho_t(X_0,X_t)\) using binary cross-entropy:
\[\ell_t(\theta;X_0,X_t) =-\rho_t\log f_\theta(X_t,t) -(1-\rho_t)\log\left(1-f_\theta(X_t,t)\right).\]
The population objective averages over the data and the known forward corruption:
\[\mathcal L_t(\theta) =\mathbb E_{X_0\sim q_0,\,X_t\sim q(\cdot\mid X_0)} \left[\ell_t(\theta;X_0,X_t)\right].\]
The target depends on \(X_0\), but the model output depends only on \(X_t\) and \(t\). To see why this is appropriate, condition on \(X_t\) and average the target over possible clean origins:
\[\begin{aligned} \eta_t(x_t) &=q(X_{t-1}=1\mid X_t=x_t)\\ &=\sum_{x_0}q(X_{t-1}=1\mid X_t=x_t,X_0=x_0) q(X_0=x_0\mid X_t=x_t)\\ &=\mathbb E[\rho_t(X_0,X_t)\mid X_t=x_t]. \end{aligned}\]
Conditioning the loss on \(X_t=x_t\) therefore gives
\[\begin{aligned} \mathbb E[\ell_t\mid X_t=x_t] =-&\eta_t(x_t)\log f_\theta(x_t,t)\\ &-\left(1-\eta_t(x_t)\right)\log\left(1-f_\theta(x_t,t)\right). \end{aligned}\]
For a fixed \(x_t\), this binary cross-entropy is minimized at \(f_\theta(x_t,t)=\eta_t(x_t)\). Thus, for one bit and a sufficiently expressive model,
\[\boxed{f_{\theta^*}(x_t,t)=q(X_{t-1}=1\mid X_t=x_t).}\]
The same loss can be written as a KL divergence plus the entropy of the known posterior target:
\[\begin{aligned} \ell_t(\theta; x_0,x_t) ={}&D_{\mathrm{KL}}\left( \operatorname{Bernoulli}(\rho_t(x_0,x_t)) \,\middle\|\, \operatorname{Bernoulli}(f_\theta(x_t,t)) \right)\\ &+H\!\left(\operatorname{Bernoulli}(\rho_t(x_0,x_t))\right). \end{aligned}\]
The entropy term depends on the training pair but not on \(\theta\). Therefore, minimizing the expected cross-entropy in this section is equivalent to minimizing the example-conditioned KL objective in Section 6.
We did not need to calculate \(q(x_0\mid x_t)\). Sampling clean/noisy pairs makes the regression average over those possible clean origins automatically.
6. The KL identity behind the training objective
We now show, one step at a time, why training against the posterior that also knows \(X_0\) can teach a model that only receives \(X_t\). This argument directly justifies the reverse-kernel training objective; it does not require deriving the full likelihood bound first. Assume the relevant conditional probabilities or densities exist and the KL quantities are finite. For discrete states use sums; for continuous states use integrals. Fix a time \(t\) and abbreviate
\[U=X_0,\qquad V=X_{t-1},\qquad W=X_t.\]
The forward process gives us the tractable conditional distribution \(q(v\mid u,w)\). At generation time, however, the model only has \(w\), so it must learn the marginal reverse distribution \(q(v\mid w)\). Let
\[\mathcal J_t(\theta)= \mathbb E_{q(u,w)} D_{\mathrm{KL}}\left( q(v\mid u,w)\,\middle\|\,p_\theta(v\mid w) \right).\]
The expectation over \(q(u,w)\) means: draw a clean point \(u\) from the data, then draw its noisy version \(w\) from the forward process. Inside each KL, the variable \(v\) is averaged under the known posterior \(q(v\mid u,w)\). Write out the definition of KL divergence:
\[\mathcal J_t(\theta)= \mathbb E_{q(u,w)}\mathbb E_{q(v\mid u,w)} \left[\log\frac{q(v\mid u,w)}{p_\theta(v\mid w)}\right].\]
The numerator knows both the clean origin \(u\) and the noisy observation \(w\); the learned reverse model only knows \(w\). Insert the intermediate distribution \(q(v\mid w)\) by multiplying and dividing inside the logarithm:
\[\frac{q(v\mid u,w)}{p_\theta(v\mid w)} =\frac{q(v\mid u,w)}{q(v\mid w)} \frac{q(v\mid w)}{p_\theta(v\mid w)}.\]
Taking logarithms turns this product into a sum. Substituting that sum into the expectation gives
\[\begin{aligned} \mathcal J_t(\theta) ={}&\mathbb E_{q(u,w)}\mathbb E_{q(v\mid u,w)} \left[\log\frac{q(v\mid u,w)}{q(v\mid w)}\right]\\ &+\mathbb E_{q(u,w)}\mathbb E_{q(v\mid u,w)} \left[\log\frac{q(v\mid w)}{p_\theta(v\mid w)}\right]. \end{aligned}\]
We identify these two terms separately.
First term: information supplied by the clean origin
The nested expectations over \(q(u,w)\) and \(q(v\mid u,w)\) together form an expectation over the joint distribution \(q(u,v,w)\). The first term is therefore
\[\mathbb E_{q(u,v,w)} \left[\log\frac{q(v\mid u,w)}{q(v\mid w)}\right].\]
By definition, conditional mutual information is
\[I_q(U;V\mid W) =\mathbb E_{q(u,v,w)} \left[\log\frac{q(v\mid u,w)}{q(v\mid w)}\right].\]
It measures how much knowing the clean origin \(U\) tells us about the previous state \(V\), after we already know the current state \(W\). This term depends on the data distribution and the forward process, but not on the model parameters \(\theta\).
Second term: error in the learned reverse distribution
The logarithm in the second term depends on \(v\) and \(w\), but not on \(u\). Consequently, averaging over all possible clean origins leaves the marginal joint distribution \(q(v,w)\). The marginalization is the law of total probability:
\[q(v,w)=\int q(u,v,w)\,du =\int q(u,w)q(v\mid u,w)\,du.\]
For discrete variables, replace the integrals by sums. If we call the logarithm in this term \(h(v,w)\), the same step can be written as
\[\begin{aligned} &\mathbb E_{q(u,w)}\mathbb E_{q(v\mid u,w)}[h(v,w)]\\ &=\int\!\int\!\int q(u,w)q(v\mid u,w)h(v,w)\,dv\,dw\,du\\ &=\int\!\int q(v,w)h(v,w)\,dv\,dw\\ &=\mathbb E_{q(v,w)}[h(v,w)]. \end{aligned}\]
Now substitute the particular logarithm \(h(v,w)=\log[q(v\mid w)/ p_\theta(v\mid w)]\):
\[\begin{aligned} &\mathbb E_{q(u,w)}\mathbb E_{q(v\mid u,w)} \left[\log\frac{q(v\mid w)}{p_\theta(v\mid w)}\right]\\ &\qquad=\mathbb E_{q(v,w)} \left[\log\frac{q(v\mid w)}{p_\theta(v\mid w)}\right]\\ &\qquad=\mathbb E_{q(w)} D_{\mathrm{KL}}\left( q(v\mid w)\,\middle\|\,p_\theta(v\mid w) \right). \end{aligned}\]
This is the average error between the desired marginal reverse distribution and the learned one.
Combining the two terms gives the identity
\[\boxed{\begin{aligned} &\mathbb E_{q(x_0,x_t)}D_{\mathrm{KL}}\left( q(x_{t-1}\mid x_t,x_0)\parallel p_\theta(x_{t-1}\mid x_t)\right)\\ &=I_q(X_0;X_{t-1}\mid X_t) +\mathbb E_{q(x_t)}D_{\mathrm{KL}}\left( q(x_{t-1}\mid x_t)\parallel p_\theta(x_{t-1}\mid x_t)\right). \end{aligned}}\tag{1}\]
The left side is the tractable training objective. The right side separates it into the information supplied by knowing \(X_0\) and the error in the learned marginal reverse distribution. With the data law and forward process held fixed, the information term does not depend on \(\theta\). Thus the two objectives differ only by an additive constant: they have the same gradient and the same minimizers over \(\theta\), even if the chosen model family cannot represent the exact reverse kernel. Their numerical values are generally different. Even a perfect marginal reverse model leaves the information term, because its training target had the extra information \(X_0\). If the forward schedule is also optimized, this information term can depend on that schedule and cannot generally be discarded for schedule optimization.
6.1. Where the KL term appears in the paper’s likelihood bound
Sohl-Dickstein et al. define a forward trajectory \(q(x_{0:T})\) and a reverse generative trajectory \(p(x_{0:T})\). Jensen’s inequality gives a lower bound \(K\) on the data log likelihood. Their decomposition has the form
\[\begin{aligned} K={}&-\sum_{t=2}^{T}\mathbb E_{q(x_0,x_t)} D_{\mathrm{KL}}\left( q(x_{t-1}\mid x_t,x_0)\parallel p_\theta(x_{t-1}\mid x_t) \right)\\ &+H_q(X_T\mid X_0)-H_q(X_1\mid X_0)-H_p(X_T). \end{aligned}\]
With the forward schedule and terminal prior fixed, the entropy terms do not depend on the reverse-kernel parameters. Maximizing this bound with respect to \(\theta\) is therefore equivalent to minimizing the sum of example-conditioned KL terms. Equation (1) explains why those tractable terms train the marginal reverse kernel that is used at generation time.
If the schedule is learned as well, the conditional mutual information and entropy terms generally depend on that schedule. They may not then be dropped when optimizing the schedule. The equivalence in Equation (1) is for optimizing the reverse model while holding the forward process fixed.
6.2. From the Gaussian KL term to the DDPM training loss
The KL identity above applies to any corruption process. For DDPM, use a Gaussian forward process. This keeps the same idea—fit an example-conditioned posterior, then average over clean examples—but makes the KL reducible to a squared-error loss.
Define
\[\alpha_t=1-\beta_t,\qquad \bar\alpha_t=\prod_{s=1}^t\alpha_s,\qquad \bar\alpha_0=1,\]
and construct a noisy training example with
\[X_t=\sqrt{\bar\alpha_t}X_0+ \sqrt{1-\bar\alpha_t}\,\epsilon,\qquad X_0\sim q_0,\quad \epsilon\sim\mathcal N(0,I).\]
The example-conditioned reverse posterior is
\[q(x_{t-1}\mid x_t,x_0) =\mathcal N\!\left(\widetilde\mu_t(x_t,x_0), \widetilde\beta_t I\right),\]
where
\[\widetilde\beta_t= \frac{\beta_t(1-\bar\alpha_{t-1})}{1-\bar\alpha_t},\]
\[\widetilde\mu_t(x_t,x_0) =\frac{\sqrt{\bar\alpha_{t-1}}\beta_t}{1-\bar\alpha_t}x_0 +\frac{\sqrt{\alpha_t}(1-\bar\alpha_{t-1})} {1-\bar\alpha_t}x_t.\]
For the interior steps \(2\le t\le T\), take the learned reverse kernel to be
\[p_\theta(x_{t-1}\mid x_t) =\mathcal N\!\left(\mu_\theta(x_t,t),\sigma_t^2I\right),\]
with fixed variance \(\sigma_t^2\). The KL divergence between these two Gaussians is
\[\begin{aligned} &D_{\mathrm{KL}}\left( \mathcal N(\widetilde\mu_t,\widetilde\beta_tI) \,\middle\|\, \mathcal N(\mu_\theta,\sigma_t^2I)\right)\\ &=\frac{\|\widetilde\mu_t-\mu_\theta\|^2}{2\sigma_t^2} +\frac d2\left( \frac{\widetilde\beta_t}{\sigma_t^2}-1 +\log\frac{\sigma_t^2}{\widetilde\beta_t} \right). \end{aligned}\]
The second term depends on the schedules and fixed variances, but not on \(\theta\). Thus, minimizing this KL over the reverse mean is the same as minimizing the squared error between \(\mu_\theta\) and the known posterior mean \(\widetilde\mu_t\).
The noise used to construct \(x_t\) is known in each training pair. Rearrange the forward equation:
\[x_0=\frac{x_t-\sqrt{1-\bar\alpha_t}\,\epsilon} {\sqrt{\bar\alpha_t}}.\]
Substitute this expression into the posterior mean above. Using \(\beta_t+\alpha_t(1-\bar\alpha_{t-1})=1-\bar\alpha_t\), the coefficients simplify as follows:
\[\begin{aligned} \widetilde\mu_t ={}&\frac{\beta_t}{\sqrt{\alpha_t}(1-\bar\alpha_t)} \left(x_t-\sqrt{1-\bar\alpha_t}\,\epsilon\right)\\ &+\frac{\sqrt{\alpha_t}(1-\bar\alpha_{t-1})} {1-\bar\alpha_t}x_t\\ ={}&\frac{1}{\sqrt{\alpha_t}} \left(x_t-\frac{\beta_t}{\sqrt{1-\bar\alpha_t}}\epsilon\right). \end{aligned}\]
For each training pair, \(\epsilon\) is known because it was sampled to create \(x_t\). At generation time, only \(x_t\) and \(t\) are available, so the noise cannot be recovered exactly from the noisy state alone. The network must estimate the appropriate noise prediction from \(x_t\) and \(t\).
This suggests parameterizing the learned mean by a neural network that predicts the training noise:
\[\mu_\theta(x_t,t)=\frac{1}{\sqrt{\alpha_t}} \left(x_t-\frac{\beta_t}{\sqrt{1-\bar\alpha_t}} \epsilon_\theta(x_t,t)\right).\]
Subtract the two means; the \(x_t\) terms cancel:
\[\widetilde\mu_t-\mu_\theta =-\frac{\beta_t}{\sqrt{\alpha_t(1-\bar\alpha_t)}} \left(\epsilon-\epsilon_\theta(x_t,t)\right).\]
Putting this into the Gaussian KL gives its trainable part:
\[\boxed{\mathcal L_{t-1}(\theta) =w_t\,\mathbb E_{\substack{X_0\sim q_0\\ \epsilon\sim\mathcal N(0,I)}} \left[\|\epsilon-\epsilon_\theta(X_t,t)\|^2\right]+C_t,}\]
where
\[w_t=\frac{\beta_t^2} {2\sigma_t^2\alpha_t(1-\bar\alpha_t)},\qquad C_t=\frac d2\left( \frac{\widetilde\beta_t}{\sigma_t^2}-1 +\log\frac{\sigma_t^2}{\widetilde\beta_t} \right).\]
Here \(X_t\) is generated from \(X_0\) and \(\epsilon\) using the forward equation. For fixed reverse variances, \(C_t\) is constant with respect to \(\theta\) and can be dropped during network optimization. This is the weighted noise-prediction objective obtained from the interior KL terms (Ho et al., Eq. 12).
Ho et al.’s simplified objective makes one additional choice: it removes the time-dependent weights \(w_t\) and samples the time index uniformly. In their notation, the resulting loss is
\[\boxed{\mathcal L_{\mathrm{simple}}(\theta) =\mathbb E_{\substack{t\sim\operatorname{Uniform}\{1,\ldots,T\}\\ X_0\sim q_0,\;\epsilon\sim\mathcal N(0,I)}} \left[\|\epsilon-\epsilon_\theta(X_t,t)\|^2\right],}\]
with \(X_t\) constructed as above. The weighted ELBO derivation applies to interior steps \(2\le t\le T\); the simplified loss also uses this noise-regression form at \(t=1\). It is therefore a reweighted training objective, rather than the unmodified negative ELBO. See Ho et al. (2020), Eqs. 12 and 14.
Why the noise target is a score target
For a given clean example, the conditional forward density is
\[q(x_t\mid x_0)=\mathcal N\!\left( x_t;\sqrt{\bar\alpha_t}x_0,(1-\bar\alpha_t)I\right).\]
Its score with respect to the noisy observation is known exactly:
\[\nabla_{x_t}\log q(x_t\mid x_0) =-\frac{x_t-\sqrt{\bar\alpha_t}x_0}{1-\bar\alpha_t} =-\frac{\epsilon}{\sqrt{1-\bar\alpha_t}}.\]
Thus each sampled pair \((x_0,x_t)\) supplies a known conditional score target. Predicting \(\epsilon\) is equivalent to predicting this score up to the known scale factor \(-1/\sqrt{1-\bar\alpha_t}\).
Why does regression on this conditional target give the score we need at generation time? The network sees \(x_t\), not \(x_0\). For squared error, fix an input \(x_t\) and write \(m=\mathbb E[\epsilon\mid X_t=x_t]\). Then
\[\mathbb E[\|\epsilon-a\|^2\mid X_t=x_t] =\mathbb E[\|\epsilon-m\|^2\mid X_t=x_t]+\|m-a\|^2,\]
so the minimizing prediction is \(a=m\). Therefore, at the population optimum, \(\epsilon_\theta(x_t,t)=\mathbb E[\epsilon\mid X_t=x_t]\). Averaging the conditional score over the possible clean origins gives the marginal score. To see this, first write the noisy marginal density as
\[p_t(x_t)=\int q(x_t\mid x_0)\,q_0(dx_0).\]
Differentiate with respect to \(x_t\) and use \(\nabla q=q\nabla\log q\):
\[\begin{aligned} \nabla_{x_t}p_t(x_t) &=\int \nabla_{x_t}q(x_t\mid x_0)\,q_0(dx_0)\\ &=\int q(x_t\mid x_0) \nabla_{x_t}\log q(x_t\mid x_0)\,q_0(dx_0). \end{aligned}\]
Divide by \(p_t(x_t)\) and apply Bayes’ rule to the posterior measure \(q(dx_0\mid x_t)=q(x_t\mid x_0)q_0(dx_0)/p_t(x_t)\). This gives
\[\nabla_{x_t}\log p_t(x_t) =\mathbb E\left[ \nabla_{x_t}\log q(x_t\mid X_0)\mid X_t=x_t \right].\]
Now substitute the Gaussian conditional score and the optimal noise regression prediction:
\[\begin{aligned} \nabla_{x_t}\log p_t(x_t) &=-\frac{\mathbb E[\epsilon\mid X_t=x_t]} {\sqrt{1-\bar\alpha_t}}\\ &=-\frac{\epsilon_\theta^*(x_t,t)} {\sqrt{1-\bar\alpha_t}}. \end{aligned}\]
The sampled noise is the supervised label; the learned function is its conditional mean given the noisy input. After rescaling, that conditional mean is the marginal score used by score-based sampling. It also gives the mean of the marginal reverse kernel: averaging \(\widetilde\mu_t\) over \(X_0\mid X_t=x_t\) is equivalent to replacing \(\epsilon\) in its linear formula by \(\mathbb E[\epsilon\mid X_t=x_t]\). The noise predictor therefore provides both the marginal score and the posterior-mean reverse update.
7. Extending the target to binary vectors
For a binary vector, the example-conditioned posterior factorizes coordinate by coordinate:
\[q(x_{t-1}\mid x_t,x_0) =\prod_{i=1}^d\operatorname{Bernoulli} \left(x_{t-1,i};\rho_{t,i}(x_0,x_t)\right).\]
This follows because both \(q(x_{t-1}\mid x_0)\) and the one-step likelihood \(q(x_t\mid x_{t-1})\) factorize. A network can output probabilities \(f_{\theta,i}(x_t,t)\) and be trained with the sum of coordinatewise soft-label cross-entropies.
There is an important distinction after averaging over \(X_0\). A mixture of factorized distributions need not itself factorize. Thus the true marginal reverse distribution \(q(x_{t-1}\mid x_t)\) can have dependencies between coordinates, even though every example-conditioned target factorizes. Independent Bernoulli outputs recover the correct marginal probability for each bit, but do not in general represent the full joint reverse kernel. They represent the exact joint kernel only when it factorizes, or when the model has a richer joint-output parameterization.
The KL identity in Equation (1) still holds for a full joint model. With a factorized reverse model, it says that the training objective finds the best reverse approximation within that restricted family; it does not make the factorized approximation exact. This distinction matters when moving from the scalar derivation to sequences and images.
7.1. The minimum KL need not be zero
Even if the learned model matches the desired marginal reverse kernel exactly,
\[p_{\theta^*}(x_{t-1}\mid x_t)=q(x_{t-1}\mid x_t),\]
the example-conditioned KL objective generally has the positive value
\[\mathcal J_t(\theta^*)=I_q(X_0;X_{t-1}\mid X_t).\]
This residual is not reverse-model error. It is the information advantage of knowing the clean origin \(X_0\) in the training target. The model at generation time sees only \(X_t\).
8. Reverse ancestral sampling
Once the reverse probabilities have been learned, generation starts from the terminal prior. For the schedule with \(\bar\alpha_T=0\), draw the bits independently:
\[X_{T,i}\overset{\mathrm{iid}}{\sim}\operatorname{Bernoulli}(p_\star).\]
Then, for \(t=T,T-1,\ldots,1\), sample
\[X_{t-1}\sim p_\theta(\cdot\mid X_t,t).\]
For one bit, this is simply
\[X_{t-1}\sim\operatorname{Bernoulli}(f_\theta(X_t,t)).\]
For a factorized vector model, sample each coordinate independently conditional on \(X_t\). No score function, Gaussian noise predictor, SDE, or ODE is required for this discrete model. Its sampler is the ancestral sampling procedure associated with the learned reverse Markov chain.
In the paper’s binary-heartbeat experiment, the data consist of length-20 sequences with one pulse in each block of five positions; the phase is uniform over the five possible positions. The model uses 2,000 binomial diffusion steps and initializes from independent \(\operatorname{Bernoulli}(0.2)\) bits, matching the data’s mean activity. A multilayer perceptron predicts the reverse Bernoulli probabilities. This is an instance of the general reference law in Section 2.4 with \(p_\star=0.2\).
9. Why noise prediction is not the fundamental principle
A common introduction to diffusion models says: add Gaussian noise, train a network to predict that noise, then subtract its prediction during generation. That is a useful description of one Gaussian DDPM parameterization, but it can hide the more general probabilistic construction.
9.1. The reverse transition is the object being learned
The generative objective is to learn a reverse process that transforms a simple reference distribution into the data distribution. In a discrete-time model, the learned object is the reverse kernel
\[\boxed{p_\theta(x_{t-1}\mid x_t).}\]
The forward process supplies tractable conditional targets for fitting this kernel. The binomial model makes this direct: the network predicts Bernoulli transition probabilities. No Gaussian noise variable is involved.
9.2. Noise prediction is a Gaussian parameterization
For the variance-preserving Gaussian forward process,
\[X_t=\sqrt{\bar\alpha_t}X_0+ \sqrt{1-\bar\alpha_t}\,\epsilon,\qquad \epsilon\sim\mathcal N(0,I),\quad \epsilon\perp X_0,\]
where \(\alpha_t=1-\beta_t\) and \(\bar\alpha_t=\prod_{s=1}^t\alpha_s\).
The exact conditional reverse mean is
\[\tilde\mu_t(X_t,X_0)= \frac{1}{\sqrt{\alpha_t}}\left( X_t-\frac{\beta_t}{\sqrt{1-\bar\alpha_t}}\epsilon \right).\]
One can parameterize the learned reverse mean using a network that predicts \(\epsilon\):
\[\mu_\theta(x_t,t)= \frac{1}{\sqrt{\alpha_t}}\left( x_t-\frac{\beta_t}{\sqrt{1-\bar\alpha_t}} \epsilon_\theta(x_t,t)\right).\]
With a fixed isotropic reverse covariance \(\sigma_t^2 I\), the mean-dependent part of the Gaussian KL becomes a weighted noise-prediction loss:
\[\mathcal L_t^{\mathrm{Gaussian}}= w_t\,\mathbb E_{X_0\sim q_0,\,\epsilon\sim\mathcal N(0,I)}\left[ \lVert\epsilon-\epsilon_\theta(X_t,t)\rVert^2 \right]+\text{constant},\]
where
\[w_t=\frac{\beta_t^2} {2\sigma_t^2\alpha_t(1-\bar\alpha_t)}.\]
The familiar unweighted noise-prediction MSE is a further choice of objective or timestep weighting. Thus noise prediction follows from a convenient parameterization of Gaussian reverse-mean learning; it is not the defining objective of diffusion modeling. In practice, predicting standardized Gaussian noise can be numerically useful, but that is a separate point from the probabilistic derivation. This is the parameterization used in later Gaussian DDPM work, including Ho, Jain, and Abbeel (2020).
The general sequence is
\[\text{forward corruption}\;\longrightarrow\; \text{tractable posterior targets}\;\longrightarrow\; \text{learned reverse kernels}\;\longrightarrow\; \text{ancestral sampling}.\]
The state space may be discrete or continuous. In the binomial model, the learned reverse transition is Bernoulli; in Gaussian diffusion it may be parameterized through its mean, variance, clean-data estimate, score, or noise estimate.
10. Summary: The central result
The binary construction isolates the central logic of diffusion training:
- Specify a forward corruption kernel whose cumulative effect is analytically available.
- Use Bayes’ rule to compute an example-conditioned reverse posterior.
- Train a reverse model that sees only the current noisy state.
- Average the posterior target over possible clean origins through the expected loss.
- Sample from the learned reverse chain starting at a tractable terminal law.
For one bit, cross-entropy directly recovers the marginal reverse probability. For vectors, the same per-coordinate loss recovers reverse marginals; exact joint recovery depends on the reverse model’s factorization assumptions. The KL decomposition makes the role of the hidden clean origin explicit and links this denoising objective to the log-likelihood lower bound in the original paper.
References and attribution
Primary paper. Jascha Sohl-Dickstein, Eric A. Weiss, Niru Maheswaranathan, and Surya Ganguli. “Deep Unsupervised Learning using Nonequilibrium Thermodynamics.” Proceedings of the 32nd International Conference on Machine Learning, PMLR 37, 2015, pp. 2256–2265. Paper PDF · arXiv:1503.03585. Relevant parts include Sections 2.1, 2.2, and 2.4; Appendix B; Table App.1; and Appendix D.1.2.
Gaussian noise-prediction parameterization. Jonathan Ho, Ajay Jain, and Pieter Abbeel. “Denoising Diffusion Probabilistic Models.” Advances in Neural Information Processing Systems 33, 2020. arXiv:2006.11239.
The forward and reverse diffusion construction and the likelihood lower bound are from Sohl-Dickstein et al. The conditional-mutual-information decomposition and the detailed comparison with Gaussian noise prediction are derivations and interpretations supplied in this tutorial; they are not equations explicitly stated by the 2015 authors.