Raghuram Shankar
← Diffusion Language Models

Part 4 · The Maths II: Masked Discrete Diffusion

The reverse posterior

Exactly as before, the reversal conditioned on the clean token is available in closed form. For times s < t (so αs > αt), two cases:

q(zs | zt = m, x) = Cat( zs ;  1−αs1−αt·m  +  αs−αt1−αt·x )

So a masked token is revealed with probability (αs−αt)/(1−αt) — and when revealed, it is always the true token. At generation time we don’t know x, so the model supplies a prediction xθ(zt, t): a probability vector over the vocabulary at every masked position, computed by one bidirectional transformer pass. MDLM constrains this network in two ways, jointly called SUBS: zero masking probability (the prediction never puts mass on the mask symbol) and carry-over unmasking (visible tokens are copied through unchanged). These aren’t cosmetic — substituting them into the ELBO makes several terms vanish identically, a Rao-Blackwellization that removes estimation variance rather than merely reducing it.

Play with the reveal probability directly — it is the formula your sampler applies at every step, and the quiz below will ask you to compute it:

The fate of a token that is masked at time t when the sampler steps to the less-noisy time s. The sliders clamp to keep αs > αt. Note the endpoint behavior: as αt → 0 (very noisy) the reveal probability approaches αs itself, and a final step to αs = 1 reveals everything still masked.

The sliders show one point at a time; here is the entire landscape at once (hover anywhere for the exact value; the blank triangle is the forbidden region where s would be noisier than t):