Diffusion Language Models › The Absorbing-Mask Forward Process
Language AI HandbookAll chapters Set up notation. A sequence is with for a vocabulary of size . The diffusion state space adds one symbol: , where denotes [MASK]. The model's output distribution will always be over the real tokens; it never predicts .
Fix a schedule . The forward process masks each position independently conditional on the clean sequence:
The quantity has a direct reading: it is the probability that a given position has survived unmasked after steps, which is why it decreases from one to zero as grows. The mask rate, the fraction of positions expected to be masked, is . At nothing is masked; at the terminal step with everything is masked.
Write for the per-step masking probability, so . The terminal step uses to mask every remaining token. The single-position transition matrix is
where:
- : the single-position transition matrix over
- : the probability of masking a visible token at step
- : the identity matrix over
- : the all-ones column vector
- : the one-hot column vector for the mask symbol
From any visible token the chain stays put with probability and jumps to with probability . The mask is absorbing, so the chain stays at with probability one. By the chain rule, surviving steps means multiplying the per-step survival probabilities conditional on being visible at the start of each step.
Because positions are corrupted independently, the joint conditional factorizes:
Let be the set of masked positions in . Independent masking gives the probability of that mask set. To give the probability of the entire corrupted state, also require that its visible values match the clean sequence:
where:
- : the set of masked positions at time
- : the number of masked positions
- : the complement of (the visible positions)
- : the sub-vector of state at the visible positions
- : the indicator function, one when the argument holds and zero otherwise
Only patterns consistent with the visible positions get probability mass, and among those, the probability depends only on the count of masks, not on which positions they are or what values they hold. The indicator enforces consistency: if the state claims a visible position holds a particular token, the clean sequence had better agree, or the pattern is impossible. The factor is the probability of that particular mask pattern under independent masking, and it depends on the pattern only through its size. That symmetry is what makes the exact computations below come out in closed form.
The schedule chooses how quickly survival drops between its endpoints. Let be the normalized forward step.
- Linear mask rate. , so the mask rate is . The worked examples use this choice.
- Cosine-squared survival. Set with , and use . This adapts the normalized image-diffusion schedule with an exact all-mask endpoint for this discrete process. Nichol and Dhariwal (2021), §3.2
- Exponential survival with terminal masking. For , use , where and increases. If remains finite at the endpoint, set with a final full-mask step.
Changing the schedule changes the weights and the intermediate states in a finite-step loss. In continuous time, a differentiable, strictly increasing mask rate from zero to one can replace time as the integration coordinate. The expected objective is invariant under this change when predictions depend only on the partial string, or when any time-dependent predictor is reparameterized to give the same predictions at matching mask rates. Finite grids, sampling variance, and decoding can still depend on the schedule.
Comments
Add to the conversation
A question, a correction, or an example from your own work.
No comments yet. Be the first to share your thoughts!