Manuscript Offprint
arXiv:2610.34310Birth, Death and Diff: Insertion-Based Sequence Generation with Corrections
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
ABSTRACT
Insertion-based masked diffusion models enable flexible-length, parallel generation by interleaving mask insertion with token unmasking. However, because their generation decisions are irreversible, aggressive parallel decoding can introduce errors that subsequent steps cannot correct, necessitating conservative decoding with more forward passes (NFEs). Moreover, they exhibit higher entropy than standard MDMs because they marginalize over multiple alignments during training and therefore require even more conservative decoding in the absence of a correction mechanism. To address this limitation, we introduce δMDM, which makes intermediate generations revisable by equipping an insertion-based model with substitution and deletion operations. During training, we expose the model to errors caused by aggressive unmasking and insertion, teaching it to correct its own mistakes. At inference time, we interleave insertion and unmasking with correction steps that can revise previously unmasked tokens and remove unnecessary masks. This mechanism makes aggressive decoding practical, improving both generation speed and quality. δMDM Pareto-dominates FlexMDM, a vanilla insertion-based MDM, on the speed–quality trade-off. On high-diversity unconditional text generation on OpenWebText, it halves the generative perplexity relative to FlexMDM at the highest inference budget. It also achieves lower generative perplexity at all inference budgets compared to MDM trained from scratch with variable-length padded sequences. On low-diversity conditional text generation on TinyGSM, it matches FlexMDM accuracy with half as many NFEs.
1 INTRODUCTION
Non-autoregressive language models such as Masked Diffusion Models (MDMs) (Sahoo et al., 2024; Shi et al., 2024; Nie et al., 2025) provide speedups over autoregressive models (ARMs) by producing more tokens per forward pass. However, because they use absolute positions, the masked positions far from the context have high positional uncertainty, i.e., the model may know what to say but not where to place it (Patel et al., 2025b; Kim et al., 2026b). This forces MDMs to generate in a block-wise left-to-right manner, thereby limiting their parallelism (Nie et al., 2025). Insertion-based Masked Diffusion Models such as FlexMDM (Kim et al., 2025a) grow the sequence incrementally by inserting new [MASK] tokens and unmasking any existing [MASK] tokens simultaneously. This allows the model to draft by placing important tokens at their approximate positions, since later insertions can fill intermediate positions. However, insertion-based models are also prone to dependency errors under parallel decoding, and they have no mechanism to update positions that have already been unmasked, i.e., they have the irreversible generation problem. Furthermore, when trained with simple denoising objectives, insertion-based models average over possible alignments. This converts positional uncertainty into token uncertainty, i.e., each insertion location may correspond to several possible target tokens, producing a diffuse predictive distribution over the vocabulary. For instance, in the sentence “Your lazy dog jumped over the black box.”, an intermediate state “Your [MASK] black.” forces the [MASK] to distribute probability over all eligible target tokens, such as lazy, dog, and jumped, thereby inflating the predictive entropy. We call this the multiple alignments problem. As
Equal contribution.

Figure 1: Overview of the δMDM generation process. The plots on the right show GSM8K code-execution accuracy and OpenWebText generative perplexity versus the sampling budget. Numeric annotations on the OpenWebText plot are token-entropy values.
a result, confidence-based decoding must stay conservative to avoid errors, sacrificing the speedup of parallel decoding. One way to combat this is to use a non-uniform distribution over alignments during training or, equivalently, learn the unmasking order of the target positions using variational learning, which tightens the ELBO (Patel et al., 2026b; Zhang et al., 2026). However, this requires an additional model and can be slow to train as the models get larger.
We take an alternative approach and introduce MDM (Delta MDM), a time-blind insertion-based masked diffusion model that learns to revise its own generations. The name MDM emphasizes that the model can change both the length (increase or decrease) and the content of a partially generated sequence. Its generation process combines insertion (birth), deletion (death), and token substitution (diff). Deletion removes excess mask tokens, while substitutions are performed using token-to-token transitions. The supervision for these operations is derived by forcing the model to predict aggressively to form a state with potential mistakes and then feeding it back to the model to correct the wrong predictions (Figure 1). At inference time, we interleave the prediction (insertion and unmasking) and correction (deletion and substitution) steps. The knowledge that corrections can fix mistakes in subsequent steps and the model's time-blindness allow aggressive drafting in the prediction step, thereby improving both the speed and the quality of generation.
We perform a comprehensive evaluation comparing MDM with FlexMDM, which does not have a correction mechanism. On the synthetic planning task with controlled complexity, MDM achieves a improvement over FlexMDM in the hardest setting (Appendix C.1). On high-diversity unconditional text generation on OpenWebText, with matched training and inference compute MDM Pareto-dominates FlexMDM in terms of both speed and quality. Moreover, MDM keeps improving as the inference budget grows: at 1024 steps it halves the generative perplexity of FlexMDM and reduces that of MDM by 47%, and with only 128 steps it already outperforms both baselines at 1024 steps. At the other extreme, on low-diversity code-based reasoning on TinyGSM, MDM matches FlexMDM's accuracy with half as many NFEs.
We summarize the key contributions of this work below:
• We introduce a novel self-correction framework for insertion-based masked diffusion models, which is simple and fast to train and requires no auxiliary model.
• We conduct a comprehensive evaluation of MDM across three types of tasks: controlled-complexity synthetic planning, high-diversity unconditional text generation, and low-diversity reasoning via code generation, and find that MDM Pareto-dominates FlexMDM on the speed-quality trade-off, while also demonstrating superior inference-time scaling for unconditional generation.
• We present ablations demonstrating the importance of our design choices and provide qualitative insights into the behavior of MDM during generation.
2.1 INSERTION-BASED MASKED DIFFUSION MODELS
Let be the space of variable length sequences, where is the vocabulary including a special mask token denoted by . Denote by the target data distribution and by the initial distribution, which in our case is a dirac delta on the empty sequence. The generative process with going from 0 to 1 is a continuous time Markov chain modeled by its transition rates, which are assumed to be independent per sequence position for tractability. For , an intermediate partial sequence is obtained by first sampling a ground truth sequence and then randomly dropping some positions and masking some according to a schedule. To explain the details, we define some additional notation.
Notation. Define an auxiliary space of partial sequences as , where is the space of ordered tuples of positions, is the maximum length, , and superscripts are used to denote index in the sequence. An element of is a pair consisting of a sequence and its corresponding positions in the clean target sequence . Let denote the length of . Every sequence carries a special token at position , which is never dropped, masked, or deleted, and we set and . For , the -th gap is the slot immediately left of , and is its length, i.e., the number of tokens of missing in that slot. Note that the rightmost gap is the one immediately left of . In order to make the exposition cleaner, we will use to indicate a dropped position. Note that is not part of the vocabulary and is never used by the model. With this added notation, we note that the auxiliary space is isomorphic to another space . Specifically, the isomorphism is given by the mapping that removes the tokens from to form , while preserving the exact position information in to produce .
2.2 TRAINING
For a fixed linear interpolant schedule, an intermediate is obtained as follows. Sample , and . Then for each , the insertion and unmasking times are sampled as , . Obtain by setting:
The input to the model is obtained by removing the token markers from , i.e., is the first element of the pair as defined in the paragraph above. Denote this distribution as . The training objective is obtained by minimizing the Bregman divergence between the predicted and target rates. It contains two terms, the insertion loss and the unmasking loss :
The expectation in both losses is over and . Here is the scalar Bregman divergence. is the predicted token distribution at -th position, and is the number of tokens to be inserted in the -th gap of according to alignment w.r.t , and is read off the cell at position , which is the [E] cell for the rightmost gap. Therefore, the unmasking loss is nothing but a weighted cross-entropy and the insertion loss simplifies to a regression loss matching the predicted gap length to the true . Note that both the predicted unmasking distribution and the insertion mean condition on the value of .
Key Limitation: The model observes but not the alignment . In a fixed-length MDM, the -th mask always corresponds to , so the only uncertainty in its target is the content of . Once positions are dropped, the same can arise from the same under several alignments. In Fig. 2, arises from with either or . Each sample supervises a single token, but the minimizer of Eq. (2) is the mixture , which spreads probability mass over every token the mask could align to (here and ). The gap targets are ambiguous in the same way. We call this the multiple alignments problem (see Appendix D.1 for its effect on the entropy of the predicted token distributions).

Figure 2: Two alignments of the same to the same : and .
2.3 GENERATION
The generation proceeds through a tau-leaping (Gillespie, 2001) like procedure that approximately simulates the learned generative CTMC by superposing multiple independent generation decisions at each step. Specifically, given a time grid , the generation process proceeds by superposing the following independent decisions at each time step :
-
Sample Unmaskings: For each masked position , sample the arrival count for each vocabulary item . If , set to the unique with ; otherwise leave the position as [M]. We write SampleUnmask( ) for this operation applied to a sequence with token distributions at time and step size .
-
Sample Insertions: For each gap sample and insert masks in the -th gap of (immediately left of ), where is the time step size. Insertion is not performed at the last time step , because there will be no unmasking steps after it.
Key Limitation: The generation is iterative but does not have any kind of undo mechanism: once a token is unmasked, it cannot be changed even if it is incorrect, and similarly, once a [M] is inserted, it cannot be removed even if it is deemed unnecessary later on. We call this the irreversible generation problem.
3 MDM
Incorporating corrections can overcome both the limitations mentioned in Section 2. For this, we break down each generation step into two sub-steps: a proposal step, which is largely similar to the generation step in Section 2.3, and a newly introduced correction step, which is used to undo actions from any of the earlier generation steps that are deemed incorrect or unnecessary. In this section, we describe the training and sampling procedures for MDM that use proposal and correction steps.
3.1 THE Expand AND Remove OPERATORS
After insertions, all the positions on the right of the insertion point move further to the right by the number of inserted masks, and this movement compounds with more insertion points. Therefore, in practice, we need to record insertions and apply them in one vectorized operation. We describe the
These names are just intuitive names for the two steps, and are not to be confused with the more formal notions of predictor-corrector diffusion sampler (Song et al., 2021) or the proposal-rejection of Metropolis-Hastings.
vectorized operation in detail here, which greatly simplifies the description of the training and sampling procedures later. Given current , and insertion counts , where masks are inserted in the -th gap (i.e., immediately left of ), let be the position of the current -th cell after the insertions, for . Define to be the sequence of length with and [M] in all remaining cells. Note that all are defined in the coordinates of , before any insertion. Conversely, for a sequence and a set of positions , deletes the cells in and moves every cell on their right leftwards ([E] is never in ). With a slight abuse of notation, we reuse the same operator name when applied to , where it additionally assigns a value to every new cell instead of leaving it empty. Recall from Section 2 that is the number of ground-truth tokens missing in the -th gap of . As shown in the figure below, the existing entries of move with their tokens through , and the -th new cell of the -th gap ( , counted from the left) receives if and -1 otherwise. Thus new cells are aligned, left to right, to the missing ground-truth positions, and surplus insertions (marked -1) have no ground-truth counterpart. In the figure, . keeps , , and , aligned to positions 1, 3, and 6, and the second mask inserted before is marked -1 because that gap contains only the missing token . Arrows show the index movement under and the logit movement under . We write for this alignment. Likewise, applied to per-position model outputs such as carries each entry along with its token (below, and ).

Remove( , D)
3.2 TRAINING
Each training step for MDM consists of three sub-steps that work sequentially. Figure 3 depicts the training procedure for MDM.
① Proposal training. The proposal training step is identical to vanilla insertion-based masked diffusion model as described in Section 2.2.
② Sampling from the proposal. The goal of this sub-step is to simulate an aggressive proposal, which the correction step can use as the input and learn to correct. For this, we replace the standard -leaping sampler step (see Section 2.3) with the following:
-
Sample Aggressive Unmaskings: Instead of drawing Poisson arrivals over a step of size , which unmask only a random subset of the masks, we unmask every masked position in the current at once by greedy decoding, for all with . Additionally, we also allow already unmasked positions of to also be substituted using the same argmax operation. This is necessary to provide strong training signal for substitutions in the correction step.
-
Sample Aggressive Insertions: We sample an insertion fraction per sequence and, for every gap of , an insertion count . Since the insertion rate in Section 2.3 is , this corresponds to a single leap of size , which ranges from almost no insertions ( ) to inserting the entire predicted remaining gap length in one step ( ). Thus is the fraction of the predicted remaining gap that is inserted in one step, and covering exposes the corrector to every per-step insertion fraction that the sampler can produce (see Section 3.3).
Therefore, after this step, only the newly inserted masks remain in the proposal sequence.
Algorithm 1: δMDM Training Step.
Require: Dataset , parameters , learning rate
1: ① Sample ,
2: sample
3:
4: Get using Eq. (1) and
5:
6: ②
7: , set
8: for every gap of
9:
10: ③
11:
12: Update

Figure 3: δMDM Training Step. Left: Algorithm 1; right: toy example. The three shaded blocks in the algorithm correspond to stages 1–3 of the illustration. ① Proposal training as described in Section 2.2. ② Sample proposal by filling every position with the argmax of , including tokens already unmasked in , and inserting from a Poisson count with mean between 0 and for each gap. All counts are drawn in the coordinates of , and inserting them shifts every later token to the right (Expand, Section 3.1). In the example the argmax replaces the already-unmasked A with Z, and the correction target at that cell remains A. ③ Correction training by aligning to via (Section 3.1): each new cell is aligned to a missing ground-truth position, or gets -1 and is deleted by predicting [DEL]. Then we substitute tokens ( ), fill the leftmost new [M] s, and delete the excess [M] s from the right ( ).
③ Correction training. Let be the proposal from ②. We feed it back into the same network and train the network to correct it. Note that may be low probability under for any time because all masks of have been filled, as if were close to 1, while the number of new masks depends on the random fraction . The aggressive proposal therefore destroys the time information, and we have to make time-blind. With that the same network serves as both proposer and corrector. Because is obtained by argmax and by sampling, no gradient flows through the construction of , which serves only as an on-policy input. The targets come from the alignment as shown in Algorithm 1. Every cell with has the ground-truth counterpart , and every cell with is a surplus insertion whose target is the deletion token [DEL]. In other words, within each gap, the new masks are matched from left to right to the missing ground-truth tokens, and the excess masks at the right end of the gap are deleted. Note that many other alignments are valid, but we fix this one for simplicity. The total correction loss is the sum of a substitution and deletion terms:
Unlike , which only covers masked positions, covers every cell of that has a ground-truth counterpart. The model therefore learns to replace wrong argmax fills, keep correct tokens (including the ones already unmasked in ), and unmask the new masks that align to ground truth. teaches it to delete masks that have no ground-truth counterpart. The full training objective is , where each term is normalized per-token across the whole batch.
3.3 GENERATION
For generation, we interleave proposal and correction steps in an alternating fashion. The sampler starts from the empty sequence and applies the proposal-correction step described in Algorithm 2 over a time grid , returning . The first forward pass, on , gives both the greedy fill and the insertion counts (lines 2–3). As in training, the greedy fill takes the argmax over the vocabulary at every position of , and the counts are sampled from the predicted gap lengths . Unlike the training fraction , the insertion scale multiplies the
Algorithm 2: δMDM Sampling Step.
Require: , apply_correction 1: 2: , set 3: , 4: , 5: if apply_correction then 6: , 7: 8: else 9: 10: end if 11: 12: return
Algorithm 3: Correction.
Require: , time , step size , unmasked positions , new mask positions 1: , , 2: Set 3: , set 4: 5: 6: return
-leaping rate, , so recovers the standard sampler of Section 2.3 and makes every step more aggressive. The same counts expand two sequences (line 4): is the sequence being edited and still contains the masks of , while the proposal has masks only at the newly inserted cells. Note that the greedy fill is not written into , it only serves as a proposal for the corrector. Then the corrector (Algorithm 3) performs a second forward pass, on , and uses to substitute incorrect tokens, delete unnecessary newly inserted masks, and provide the unmasking distributions for all remaining masks. For substitutions (line 3), we use argmax over the vocabulary items from at the positions , i.e., only at tokens that were already unmasked in . For deletions (line 1), we consider only the newly inserted masks , and if a deletion event is sampled for any of these positions, we remove the position and shift every later cell to the left along with the corresponding logits (lines 4–5). Masks inherited from are neither substituted nor deleted. The output of the correction is the new sequence and the updated token probabilities . The unmasking of all remaining masks in , both inherited and newly inserted, is then performed based on with a chosen sampling function. On steps where correction is skipped, and the logits are carried through the same shift, as shown in line 9 of Algorithm 2. In this case, the newly inserted cells have no logits yet and are therefore not unmasked in that step. Both proposal and correction steps are counted towards the total number of forward passes. Unless stated otherwise, we set apply_correction to true at every step, i.e., one correction step follows each proposal step, giving proposal and correction steps. Note that since the model is time-blind, the network never sees . It enters only through the factor in the Poisson rates for insertions, deletions, and unmasking (SampleUnmask), and through the same factor in the training losses.
4 EXPERIMENTS
Setup All models use a transformer backbone with rotary positional embeddings, pre-layernorm and are trained from scratch. For masked diffusion we use the time-agnostic version with unweighted cross-entropy loss (Zheng et al., 2025) as it has been shown to work better than time-conditioned MDLM that uses ELBO (Sahoo et al., 2026). Moreover, we pre-train MDM for variable length sequences using padded sequences instead of packed sequences for a fair comparison. For vanilla insertion-based masked diffusion we reimplement FlexMDM (Kim et al., 2025a), which is not time-blind and uses adaptive layer normalization conditioned on a time embedding. In order to obtain time-blind δMDM, we pin the time embedding to a constant value of 1, but keep the same architecture as FlexMDM. Since δMDM uses two forward passes per training step, we compare against baselines that are trained for twice the number of total training steps at the same global batch size. At inference, unless stated otherwise, δMDM applies one correction step after every proposal step with both steps counted towards the sampling budget T. We conduct comprehensive evaluation on three different types of tasks: controlled complexity synthetic planning, high-diversity
We use the transformer implementation provided in Patel et al. (2025a). See Appendix B for more details.
Removing time from the model’s input has only a small impact even for FlexMDM. See Appendix D.2 for more details.
| Model | Gen. PPL (↓) | Entropy (↑) | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Steps T | 32 | 64 | 128 | 256 | 512 | 1024 | 32 | 64 | 128 | 256 | 512 | 1024 |
| MDM | 230.96 | 87.48 | 54.18 | 45.08 | 40.10 | 38.16 | 3.33 | 3.59 | 3.98 | 4.32 | 4.56 | 4.71 |
| ILM | - | - | 222.19 | 53.70 | 51.21 | 49.74 | - | - | 4.27 | 4.42 | 4.30 | 4.42 |
| DILM-S | - | - | 36.10 | 29.91 | 23.20 | 21.21 | - | - | 3.45 | 3.61 | 3.71 | 3.79 |
| FlexMDM | 73.80 | 57.59 | 48.83 | 43.81 | 42.80 | 40.37 | 4.83 | 4.87 | 4.89 | 4.88 | 4.88 | 4.88 |
| δMDM | 75.23 | 46.76 | 32.85 | 25.94 | 22.89 | 20.35 | 4.47 | 4.55 | 4.60 | 4.64 | 4.69 | 4.72 |
Table 1: Generative perplexity and token entropy under GPT-2 Large at different sampling budgets (network forward passes). MDM uses insertion scale and one correction step per proposal step from the start, both counted in . ILM (Patel et al., 2025c) and DILM-S (Patel et al., 2026a), replicated from the implementation and checkpoints provided by Patel et al. (2026a).
unconditional text generation, and low-diversity reasoning using code generation. The rest of this section discusses the results on the text generation task with results on synthetic star-graph planning task provided in Appendix C.1.
4.1 UNCONDITIONAL GENERATION ON OPENWEBTEXT
We pretrain MDM, FlexMDM and MDM on a preprocessed version of OpenWebText (OWT) dataset tokenized using the GPT-2 tokenizer, where we remove documents that are longer than 1024 tokens, and pad the remaining documents to 1024 tokens creating a variable length corpus (Patel et al., 2026a). MDM is trained for 400k steps with global batch size of 512, while MDM and FlexMDM are trained for 800k steps. We additionally compare against the insertion language models ILM (Patel et al., 2025c) and DILM-S (Patel et al., 2026a), trained on OWT for 800k steps, which we evaluate using the implementation and checkpoints provided by Patel et al. (2026a). We generate 1000 samples per setting with nucleus sampling applied to all methods with and report generation perplexity under GPT-2 Large and as well as token entropy across total sampling step budgets. For MDM, we use the insertion scale in Table 1.
As shown in Table 1, MDM achieves lower generative perplexity compared to FlexMDM at all budgets except for . Interestingly, we observe that MDM keeps improving in quality at a higher rate compared to FlexMDM as the inference budget increases (see Fig. 1 bottom right). Specifically, at , MDM halves the generative perplexity of FlexMDM (20.35 vs. 40.37) and reduces that of MDM by (20.35 vs. 38.16). Conversely, MDM at 128 sampling steps obtains lower Gen. PPL than both FlexMDM and MDM at 1024 steps, an reduction in sampling steps. MDM also obtains lower Gen. PPL than the insertion language models ILM (Patel et al., 2025c) and DILM-S (Patel et al., 2026a) at every budget they report, while keeping a much higher token entropy than DILM-S (4.60–4.72 vs. 3.45–3.79). The token entropy for MDM is generally lower than that of FlexMDM but it remains stable across all budgets. Cross-budget plots of token entropy against generative perplexity are in Appendix D.3. Figure 5 shows the effect of the insertion scale at inference: for every budget, Gen. PPL is lowest for moderate scales () and rises sharply for , where the generated sequences approach the maximum length. We analyze the length of the generated sequences in Appendix D.6.
4.2 CONDITIONAL GENERATION ON TINYGSM
scratch on TinyGSM (Liu et al., 2023) dataset containing 11.8M grade school math problems converted to solutions in Python. This dataset is qualitatively different from OWT in several ways: (1) it is a conditional generation task, where there is an input question, and (2) since the solutions are Python code, the output sequences are much more structured and show less diversity. We use the same model architectures and training budgets as we do for OWT pretraining. Once trained, we evaluate the models on the test split of GSM8K (Cobbe et al., 2021) dataset containing 1.32K problems and report the pass@1 score by comparing exact numerical answers.
Note that the token entropies ranges are lower than the ones reported in the literature on MDMs because we train on variable length sequences which results in lower average entropy.

Figure 4: Entropy vs. generation perplexity (GPT-2 Large) on OWT at for nucleus sampling with .
Figure 5: Generation perplexity (GPT-2 Large) of MDM on OWT vs. insertion scale for different sampling budgets .
Figure 6: GSM8K pass@1 of MDM vs. insertion scale at (other budgets in Appendix D.5).
For this task, we use greedy decoding, i.e., we pick the token with the highest probability to fill the selected mask position for all the models. For MDM, we use the insertion scale . As seen in Table 2, MDM outperforms Flex-MDM at every budget, with the largest gap at low budgets, where MDM matches Flex-MDM's accuracy with half the steps. MDM is the strongest model at the lowest budgets (), but its accuracy plateaus around 40–41%, and MDM overtakes it from onward.
| Model | GSM8K pass@1 (% , ↑) | ||||
|---|---|---|---|---|---|
| Steps T | 125 | 250 | 500 | 1000 | 1500 |
| MDM | 37.38 | 40.71 | 40.33 | 40.64 | 41.09 |
| FlexMDM | 8.72 | 20.77 | 31.77 | 40.41 | 41.39 |
| δMDM | 20.62 | 33.06 | 42.23 | 46.85 | 47.01 |
Table 2: GSM8K test pass@1 vs. budget T (forward passes). MDM and FlexMDM are trained for 800k steps and MDM for 400k. MDM uses and one correction step per proposal step from the start, both counted in T.
4.3 ANALYSIS
In this section, we provide a more detailed analysis of the corrections performed by MDM.
When do corrections happen and how frequently? We measure correction intensity as the fraction of eligible positions that are substituted or deleted at each step, and plot it against normalized generation time (Figs. 11 and 12, Appendix D.4). On both OWT and GSM8K, substitutions peak early and deletions dominate near the end. Early in generation the sequence is short and many tokens were predicted with little context, so replacing them in place is the natural fix. Towards the end, most of the sequence is already fixed, and errors tend to show up as excessive addition of new masks.
What happens when we increase the aggressiveness of insertions? We can increase the aggressiveness of insertions by increasing the insertion scale at inference time. Note that is not an extrapolation beyond training: scales the per-step leap, and for all the fraction of the predicted gap inserted per step stays within the range (0, 1) seen during training (Section 3.3). As shown in Fig. 5, for unconditional generation, there is a diminishing return in quality as we increase the insertion scale especially at higher inference budgets. At small budgets (), Gen. PPL keeps improving up to and stays flat at , whereas for it is lowest at and rises sharply beyond. On GSM8K, we additionally vary the correction offset, i.e., the number of prediction steps taken before correction steps begin, which is 0 in all other experiments (Fig. 6, and Appendix D.5 for ). When correction is applied from the start (offset 0), accuracy increases with up to at and up to at . In contrast, with a late correction start, accuracy peaks at and then declines, so the gap to offset 0 widens as insertions become more aggressive, reaching roughly 10 points or more at the largest for every budget. At this ordering is reversed for , where a late start is slightly better, i.e., early corrections pay off mainly when the proposal is aggressive enough to introduce errors. Larger budgets raise accuracy across all settings, but do not remove the need for early correction: aggressive insertion pays off most when the model has enough correction steps to fix the resulting mistakes.
What is the impact of the correction step on predictive entropy? The correction step performs a second forward pass over the sequence after the aggressive proposal. We plot the average predictive entropy at the positions that are masked in , comparing from the proposal pass with from the correction pass, where these positions hold the greedy proposal tokens (Fig. 9 in Appendix D.1), and find that entropy is generally lower after the correction forward pass. Since the greedy fill places a concrete token at each of these positions, the proposal tends to favor some of the plausible alignments over others, and conditioning on it contributes to reducing the alignment ambiguity that inflates FlexMDM's entropy at mask slots (Fig. 8). We hypothesize that these sharper predictions are what allow MDM to unmask more tokens per step, consistent with the budget curves in Tables 1 and 2.
5 RELATED WORK
There have been several approaches proposed for incorporating corrections in fixed-length MDMs. Wang et al. (2026) propose re-masking decoded tokens based on decoding confidence. More recent works such as (Kim et al., 2025b; Huang et al., 2025; Liu et al., 2026b) add additional heads over pretrained MDMs to estimate token quality in a partially masked sequence, where lower-quality tokens are re-masked for the next unmasking step. Supervision for the correction heads is obtained by randomly replacing correct tokens with other tokens in the vocabulary (Huang et al., 2025), sampling from the model's own token distribution (Kim et al., 2025b), or introducing human-injected synthetic errors (Ji et al., 2025). Pretrained MDMs are then fine-tuned to optimize the correction loss with MDM loss regularization. Schiff et al. (2026) propose alternating unmasking and correction steps similar to our approach. However, they limit the corrections to substitutions only, and don't consider length changing operations. Von Rütte et al. (2025) uses a mixed noise schedule with both uniform vocabulary and masked noise, thereby enabling the model to perform token flips. (Zhao et al., 2025) also correct decoded tokens but require architectural changes to the denoising model, thereby necessitating retraining. While much of the prior work on correction focuses on fixed-length MDMs, few approaches address self-correction in variable-length settings. (Wu et al., 2026) introduces length control in MDMs using custom expansion and deletion operations that adaptively insert and remove masks. However, they focus on code infilling benchmarks and do not consider substitutions.
6 LIMITATIONS
The corrector is trained on a single step of aggressive proposal. At inference, proposals are built on the model's own earlier outputs, so errors can compound over many proposal-correction rounds and produce states that were not seen in training resulting in exposure bias. Unrolling several rounds during training or fully on-policy training could address this, but it would considerably more complex. The corrections can be made more expressive by allowing deletion of visible tokens, however, that would cause ambiguous supervision in the current framework. Further scaling and adaptation study is left as future work.
7 CONCLUSION AND OUTLOOK
This work introduces MDM, a variable-length masked diffusion model with insertion, deletion, and substitution actions. It learns the correction operations from its own aggressive proposals without requiring any auxiliary model. MDM Pareto-dominates FlexMDM on the speed–quality trade-off, exhibits better scaling with inference budget across unconditional as well as conditional text generation tasks. More broadly, our results hint at a division of labor. The discrete diffusion framework, with its fixed noising process and simple training objective, provides a stable recipe for training from scratch. However, the gains of MDM come from departing from it in two ways: the model is time-blind, and it is trained on corruptions produced by its own proposals. Together, these make each sampling step behave less like integrating a prescribed continuous-time process and more like repeatedly applying a single learned refinement operator. This suggests that adapting pretrained diffusion models with such self-correction objectives, in the spirit of fixed-point iteration, could be a promising route to faster and higher-quality generation.
AI USE STATEMENT
In this work, we used generative AI tools for some parts of the model implementation and analysis code. Additionally, we used generative AI tools for formatting some of the figures and tables, and for polishing the writing of some parts of the manuscript. The two main authors have reviewed all AI generated code as well as content, and all the authors take full responsibility for the final content of this work, including text, claims and artifacts produced with the aid of generative AI.
REPRODUCIBILITY STATEMENT
We provide complete details of our core algorithm in Section 3. Section 4 describes the datasets used, along with the details of preprocessing. The model architecture is also described in Section 4, with key hyperparameters listed in Appendix B. We implement all the baselines described in Section 4 using the xLM framework for non-autoregressive language modeling (Patel et al., 2025a). Anonymized source code is available at https://anonymous.4open.science/r/DeltaMDM. The trained model checkpoints and logged training loss curves on Weights and Biases will be made publicly available upon acceptance.
REFERENCES
Karl Cobbe, Vineet Kosaraju, Mohammad Bavarian, Mark Chen, Heewoo Jun, Lukasz Kaiser, Matthias Plappert, Jerry Tworek, Jacob Hilton, Reiichiro Nakano, Christopher Hesse, and John Schulman. Training verifiers to solve math word problems, 2021. URL https://arxiv.org/abs/2110.14168.
Daniel T Gillespie. Approximate accelerated stochastic simulation of chemically reacting systems. The Journal of chemical physics, 115(4):1716–1733, 2001.
Zemin Huang, Yuhang Wang, Zhiyang Chen, and Guo-Jun Qi. Don’t settle too early: Self-reflective remasking for diffusion language models, 2025. URL https://arxiv.org/abs/2509.23653.
Yatai Ji, Teng Wang, Yuying Ge, Zhiheng Liu, Sidi Yang, Ying Shan, and Ping Luo. From denoising to refining: A corrective framework for vision-language diffusion model, 2025. URL https://arxiv.org/abs/2510.19871.
BumJun Kim, Dongjae Jeon, Dueun Kim, Wonje Jeung, and Albert No. Rainbow padding: Mitigating early termination in instruction-tuned diffusion llms. In C. Vondrick, B. Hariharan, C. Raffel, L. Pinto, D. Yang, and A. Faust (eds.), International Conference on Learning Representations, volume 2026, pp. 18977–19001, 2026a. URL https://proceedings.iclr.cc/paper_files/paper/2026/file/203221ce5041eddbe0800cef81bfb987-Paper-Conference.pdf.
Jaeyeon Kim, Lee Cheuk-Kit, Carles Domingo-Enrich, Yilun Du, Sham Kakade, Timothy Ngotiaoco, Sitan Chen, and Michael Albergo. Any-Order Flexible Length Masked Diffusion, September 2025a. URL http://arxiv.org/abs/2509.01025.
Jaeyeon Kim, Seunggeun Kim, Taekyun Lee, David Z. Pan, Hyeji Kim, Sham Kakade, and Sitan Chen. Fine-tuning masked diffusion for provable self-correction, 2025b. URL https://arxiv.org/abs/2510.01384.
Seunggeun Kim, Jaeyeon Kim, Taekyun Lee, Yuyuan Chen, Yilun Du, Sham Kakade, and Sitan Chen. From interface to inference: Eliciting any-order inference from any-order models, 2026b. URL https://arxiv.org/abs/2607.26504.
Jinsong Li, Xiaoyi Dong, Yuhang Zang, Yuhang Cao, Jiaqi Wang, and Dahua Lin. Beyond fixed: Training-free variable-length denoising for diffusion large language models. In C. Vondrick, B. Hariharan, C. Raffel, L. Pinto, D. Yang, and A. Faust (eds.), International Conference on Learning Representations, volume 2026, pp. 91715–91731, 2026. URL https://proceedings.iclr.cc/paper_files/paper/2026/file/940380c12da75e64351cceff4c880557-Paper-Conference.pdf.
Bingbin Liu, Sebastien Bubeck, Ronen Eldan, Janardhan Kulkarni, Yuanzhi Li, Anh Nguyen, Rachel Ward, and Yi Zhang. Tinygsm: achieving 80 URL https://arxiv.org/abs/2312.09241.
Hengchang Liu, Zhao Yang, and Bing Su. Diffusion lms can approximate optimal infilling lengths implicitly, 2026a. URL https://arxiv.org/abs/2602.00476.
Liming Liu, Binxuan Huang, Zixuan Zhang, Xin Liu, Bing Yin, and Tuo Zhao. Backplay: Head-only look-back self-correction for diffusion language models, 2026b. URL https://arxiv.org/abs/2601.06428.
Shen Nie, Fengqi Zhu, Zebin You, Xiaolu Zhang, Jingyang Ou, Jun Hu, Jun Zhou, Yankai Lin, Ji-Rong Wen, and Chongxuan LI. Large language diffusion models. In D. Belgrave, C. Zhang, H. Lin, R. Pascanu, P. Koniusz, M. Ghassemi, and N. Chen (eds.), Advances in Neural Information Processing Systems, volume 38, Main Conference, pp. 50608–50646. Curran Associates, Inc., 2025. doi: 10.52202/085713-1689. URL https://proceedings.neurips.cc/paper_files/paper/2025/file/48b383b24230e0e6e649d9c98dae4d8c-Paper-Conference.pdf.
Dhruvesh Patel, Durga Prasad Maram, Sai Sreenivas Chintha, Benjamin Rozonoyer, and Andrew McCallum. XLM: A Python package for non-autoregressive language models, December 2025a. URL http://arxiv.org/abs/2512.17065.
Dhruvesh Patel, Tahira Naseem, Gaurav Pandey, Md Arafat Sultan, Andrew McCallum, and Ramón Fernandez Astudillo. Improved sampling from masked diffusion models with position contrastive guidance. In NeurIPS 2025 Workshop on Structured Probabilistic Inference & Generative Modeling, 2025b. URL https://openreview.net/forum?id=e0WmOrWbtc.
Dhruvesh Patel, Aishwarya Sahoo, Avinash Amballa, Tahira Naseem, Tim G. J. Rudner, and Andrew McCallum. Insertion language models: Sequence generation with arbitrary-position insertions, 2025c. URL https://arxiv.org/abs/2505.05755.
Dhruvesh Patel, Benjamin Rozonoyer, Soumitra Das, Tahira Naseem, Tim G. J. Rudner, and Andrew McCallum. A continuous time markov chain framework for insertion language models. In The 29th International Conference on Artificial Intelligence and Statistics, 2026a. URL https://openreview.net/forum?id=nCyV21FmUI.
Dhruvesh Patel, Benjamin Rozonoyer, Gaurav Pandey, Tahira Naseem, Ramón Fernandez Astudillo, and Andrew McCallum. Insertion based sequence generation with learnable order dynamics. ArXiv, abs/2602.18695, 2026b. URL https://api.semanticscholar.org/CorpusID:285973138.
Subham Sekhar Sahoo, Marianne Arriola, Yair Schiff, Aaron Gokaslan, Edgar Marroquin, Justin T Chiu, Alexander Rush, and Volodymyr Kuleshov. Simple and effective masked diffusion language models. In A. Globerson, L. Mackey, D. Belgrave, A. Fan, U. Paquet, J. Tomczak, and C. Zhang (eds.), Advances in Neural Information Processing Systems, volume 37, pp. 130136–130184. Curran Associates, Inc., 2024. doi: 10.52202/079017-4135. URL https://proceedings.neurips.cc/paper_files/paper/2024/file/eb0b13cc515724ab8015bc978fdde0ad-Paper-Conference.pdf.
Subham Sekhar Sahoo, Jean-Marie Lemercier, Zhihan Yang, Justin Deschenaux, Jingyu Liu, John Thickstun, and Ante Jukic. Scaling beyond masked diffusion language models, 2026. URL https://arxiv.org/abs/2602.15014.
Yair Schiff, Omer Belhasin, Roy Uziel, Guanghan Wang, Marianne Arriola, Gilad Turok, Ran Zilberstein, Michael Elad, and Volodymyr Kuleshov. Learn from Your Mistakes: Self-Correcting Masked Diffusion Models, February 2026. URL http://arxiv.org/abs/2602.11590.
Jiaxin Shi, Kehang Han, Zhe Wang, Arnaud Doucet, and Michalis Titsias. Simplified and generalized masked diffusion for discrete data. In A. Globerson, L. Mackey, D. Belgrave, A. Fan, U. Paquet, J. Tomczak, and C. Zhang (eds.), Advances in Neural Information Processing Systems, volume 37, pp. 103131–103167. Curran Associates, Inc., 2024. doi: 10.52202/079017-3277. URL https://proceedings.neurips.cc/paper_files/paper/2024/file/bad233b9849f019aead5e5cc60cef70f-Paper-Conference.pdf.
Yang Song, Jascha Sohl-Dickstein, Diederik P Kingma, Abhishek Kumar, Stefano Ermon, and Ben Poole. Score-based generative modeling through stochastic differential equations. In International Conference on Learning Representations, 2021. URL https://openreview.net/forum?id=PxTIG12RRHS.
Yuxuan Song, Zheng Zhang, Cheng Luo, Pengyang Gao, Fan Xia, Hao Luo, Zheng Li, Yuehang Yang, Hongli Yu, Xingwei Qu, Yuwei Fu, Jing Su, Ge Zhang, Wenhao Huang, Mingxuan Wang, Lin Yan, Xiaoying Jia, Jingjing Liu, Wei-Ying Ma, Ya-Qin Zhang, Yonghui Wu, and Hao Zhou. Seed Diffusion: A Large-Scale Diffusion Language Model with High-Speed Inference, August 2025. URL http://arxiv.org/abs/2508.02193.
Dimitri Von Rütte, Janis Fluri, Yuhui Ding, Antonio Orvieto, Bernhard Schölkopf, and Thomas Hofmann. Generalized interpolating discrete diffusion. In Aarti Singh, Maryam Fazel, Daniel Hsu, Simon Lacoste-Julien, Felix Berkenkamp, Tegan Maharaj, Kiri Wagstaff, and Jerry Zhu (eds.), Proceedings of the 42nd International Conference on Machine Learning, volume 267 of Proceedings of Machine Learning Research, pp. 61810–61843. PMLR, 13–19 Jul 2025. URL https://proceedings.mlr.press/v267/von-rutte25a.html.
Guanghan Wang, Yair Schiff, Subham Sekhar Sahoo, and Volodymyr Kuleshov. Remasking discrete diffusion models with inference-time scaling, 2026. URL https://arxiv.org/abs/2503.00307.
Zirui Wu, Lin Zheng, Zhihui Xie, Jiacheng Ye, Jiahui Gao, Shansan Gong, Yansong Feng, Zhenguo Li, Wei Bi, Guorui Zhou, and Lingpeng Kong. Dreamon: Diffusion language models for code infilling beyond fixed-size canvas, 2026. URL https://arxiv.org/abs/2602.01326.
Haobo Xu, Sirui Chen, Yuanchen Bei, Lingjie Chen, Yuchen Yan, Dongqi Fu, Jingrui He, and Hanghang Tong. Predict, don't iterate: Efficient adaptive-length infilling for diffusion language models, 2026. URL https://arxiv.org/abs/2609.02108.
Andrew Zhang, Anushka Sivakumar, Chia-Wei Tang, and Chris Thomas. Flexible-length text infilling for discrete diffusion models. In Christos Christodoulopoulos, Tanmoy Chakraborty, Carolyn Rose, and Violet Peng (eds.), Proceedings of the 2025 Conference on Empirical Methods in Natural Language Processing, pp. 31344–31359, Suzhou, China, November 2025. Association for Computational Linguistics. ISBN 979-8-89176-332-6. doi: 10.18653/v1/2025.emnlp-main.1597. URL https://aclanthology.org/2025.emnlp-main.1597/.
Yangtian Zhang, Zhe Wang, Arthur Gretton, Rex Ying, David van Dijk, Michalis K. Titsias, and Jiaxin Shi. Variational learning for insertion-based generation, 2026. URL https://arxiv.org/abs/2606.02133.
Yixiu Zhao, Jiaxin Shi, Feng Chen, Shaul Druckmann, Lester Mackey, and Scott Linderman. Informed correctors for discrete diffusion models, 2025. URL https://arxiv.org/abs/2407.21243.
Kaiwen Zheng, Yongxin Chen, Hanzi Mao, Ming-Yu Liu, Jun Zhu, and Qinsheng Zhang. Masked diffusion models are secretly time-agnostic masked models and exploit inaccurate categorical sampling. In Y. Yue, A. Garg, N. Peng, F. Sha, and R. Yu (eds.), International Conference on Learning Representations, volume 2025, pp. 63186–63227, 2025. URL https://proceedings.iclr.cc/paper_files/paper/2025/file/9e3b203e72c4e058de26d02a92a81844-Paper-Conference.pdf.
APPENDIX
A Summary of Notation 14
B Experimental Details 16
C Additional Tasks 16
C.1 Synthetic Planning: Star Graphs 16
D Additional Analysis 17
D.1 Multiple alignment problem 17
D.2 Time-blindness 18
D.3 Entropy vs. generation perplexity across sampling budgets 18
D.4 How are corrections distributed? 18
D.5 GSM8K accuracy vs. insertion scale 20
D.6 Length of generated sequences on OWT 20
E Extended Related Work 20
F Randomly Sampled Generations 21
F.1 OpenWebText 21
F.2 GSM8K 23
A SUMMARY OF NOTATION
Table 3 summarizes the notation used throughout the paper.
| Notation | Description |
| Sequences and spaces | |
| The set | |
| Vocabulary of tokens, including the mask token [M] | |
| Mask token | |
| Marker for a dropped position; not part of and never seen by the model | |
| Deletion token; the correction target for surplus inserted masks | |
| Maximum sequence length | |
| Space of variable length sequences, | |
| Space of partial sequences with positions, , where | |
| , and the isomorphism that removes the markers from and records the positions of the remaining tokens | |
| Length of the sequence | |
| -th token of the sequence (superscripts index positions) | |
| Noising and training | |
| Data distribution; initial distribution (a Dirac delta on the empty sequence) | |
| Time, | |
| Clean sequence; noisy partial sequence at time | |
| Noisy state in (Eq. (1)) and its contraction | |
| Positions in of the tokens of | |
| Insertion and unmasking times of the -th position | |
| Number of ground-truth tokens missing in the -th gap of , | |
| Unmasking and insertion losses (Eq. (2)) | |
| Substitution and deletion losses (Eq. (3)) | |
| Scalar Bregman divergence, | |
| Model | |
| Model parameters | |
| Predicted token distribution at the -th position of , over | |
| Predicted length of the -th gap of | |
| Proposal, correction, and sampling | |
| Number of masks inserted in each gap, in the coordinates of | |
| Training insertion fraction, ; the fraction of the predicted remaining gap inserted in one step | |
| Inference insertion scale multiplying the -leaping insertion rate; each step inserts the fraction | |
| Inserts masks into the gaps, shifting later cells to the right; is the new index of cell (Section 3.1) | |
| Deletes the cells in , shifting later cells to the left | |
| with every filled by the argmax of | |
| after insertions, | |
| Proposal given to the corrector, | |
| Alignment of to , ; marks a surplus mask with target | |
| Unmasked positions; newly inserted masks; new masks selected for deletion | |
| Deletion arrival count at position | |
| Sampling time grid; step size | |
| SampleUnmask | -leaping unmasking step (Section 2.3) |
Table 3: Summary of notation used throughout the paper.
B EXPERIMENTAL DETAILS
All trained models use the architecture and optimization settings in Table 4. δMDM is trained for 400k steps, while MDM and FlexMDM are trained for 800k steps. ILM (Patel et al., 2025c) and DILM-S (Patel et al., 2026a) are evaluated from the implementation and 800k step checkpoints provided by Patel et al. (2026a). OpenWebText sequences are padded to length 1024, and TinyGSM sequences use length 512. For the main results (Tables 1 and 2), δMDM uses the insertion scale on OpenWebText and on TinyGSM. Correction is applied after every proposal step from the first step (offset 0), and both proposal and correction steps count towards the budget .
| Hyperparameter | Value |
|---|---|
| Layers | 12 |
| Hidden size | 768 |
| Attention heads | 12 |
| Feed-forward width | 3072 |
| Rotary dimension | 64 |
| Dropout | 0.1 |
| Activation | ReLU |
| Non-embedding parameters | |
| Optimizer | AdamW |
| Learning rate | |
| Weight decay | 0.01 |
| Schedule | Constant with linear warmup |
| Warmup steps | 2,000 |
| Global batch size | 512 |
| Gradient clipping | 1 |
| Precision | bfloat16 mixed |
Table 4: Architecture and optimization settings shared by all trained models. The parameter count is the transformer body and excludes token embeddings.
C ADDITIONAL TASKS
C.1 SYNTHETIC PLANNING: STAR GRAPHS
Given a start node and a target node, the model must generate the unique path on a star-shaped graph. Following (Patel et al., 2025c), we use three splits (easy, medium, hard) with increasing difficulty in terms of variable arm lengths and non-junction start nodes. The model input is a flattened edge list followed by the start node, target node, and EOS token. We use an insertion scale factor of 2 (the best value from a sweep over ) and report exact match (EM) at sampling budget (Table 5). MDM uses confidence based decoding with the top probability value for choosing unmasking positions in the sequence during sampling. FlexMDM uses the same inference procedure detailed in (Kim et al., 2025a).
| Model | Stareasy (↑) | Starmedium (↑) | Starhard (↑) |
|---|---|---|---|
| MDM | 100 | 100 | 74.38 |
| FlexMDM | 92.00 | 93.13 | 7.27 |
| Ours | 98.70 | 98.60 | 96.47 |
Table 5: Star-graph exact match (%) at sampling steps.

Figure 7: Star exact match ( ) vs. sampling budget for MDM and FlexMDM at .
D ADDITIONAL ANALYSIS
D.1 MULTIPLE ALIGNMENT PROBLEM
Figure 8 shows the entropy of the predicted token distribution at masked positions as a function of time t on OWT for FlexMDM and MDM. Due to the multiple alignments problem (Section 2.2), the supervision for a [M] in FlexMDM is spread across several candidate positions of , resulting in much higher entropy than MDM for most of the generation. Figure 9 shows the same quantity for MDM at sampling budget T=512, before and after the correction step.

Figure 8: Entropy of the predicted token distribution at masked positions vs. time t on OWT for FlexMDM and MDM.

Figure 9: Entropy of the predicted token distribution at masked positions vs. time t on OWT for MDM at T=512, before and after correction.
D.2 TIME-BLINDNESS
Table 6 compares FlexMDM with time-blind FlexMDM on GSM8K with both models trained for 800k steps. As seen here, removing time from the model's input makes only a small difference in performance: the gap is within 0.25 points at and about 2.3 points at .
| Model | 250 | 500 | 1000 |
|---|---|---|---|
| FlexMDM | 20.77 | 31.77 | 40.41 |
| FlexMDM (time-blind) | 21.00 | 31.84 | 38.13 |
Table 6: GSM8K test pass@1 (%) vs. sampling budget for FlexMDM and time-blind FlexMDM, both trained for 800k steps.
D.3 ENTROPY VS. GENERATION PERPLEXITY ACROSS SAMPLING BUDGETS
Figure 4 in the main text reports entropy vs. Gen. PPL at . Here we include the corresponding plots for the remaining budgets .

(a)
(b)
(c)

(d)
(e)
(f)
Figure 10: Entropy vs. generation perplexity (GPT-2 Large) on OWT for nucleus sampling with at the remaining sampling budgets.
D.4 HOW ARE CORRECTIONS DISTRIBUTED?
Figures 11 and 12 show the distribution of correction intensity over normalized time. The intensity is defined as the percentage of eligible positions that are corrected (substituted or deleted) at that time step. Each cell counts how often a given intensity occurs at that time across all the generations. As shown in the figures, the substitutions peak early in the generation process while the deletions increase towards the end. This intuitively makes sense because isolated substitutions are difficult to make towards the end of the generation when most of the sequence is already generated. Moreover, early on there isn't much need for deletions because the sequence is still short.

(a) Substitutions,

(b) Deletions,

(c) Substitutions,

(d) Deletions,
Figure 11: Distribution of substitution and deletion intensity over normalized time for MDM on OWT.

(a) Substitutions,

(b) Deletions,

(c) Substitutions,

(d) Deletions,
Figure 12: Distribution of substitution and deletion intensity over normalized time for MDM on GSM8K.
D.5 GSM8K ACCURACY VS. INSERTION SCALE

(a) T=250
(b)
(c)
Figure 13: GSM8K pass@1 vs. insertion scale at sampling budgets .
D.6 LENGTH OF GENERATED SEQUENCES ON OWT
Figure 14 compares the quantiles of the generated sequence lengths against the OWT validation set, and Fig. 15 shows how the mean length of MDM generations changes with the insertion scale .

Figure 14: Q–Q plot of the sequence length quantiles of MDM, FlexMDM, and MDM generations vs. OWT validation.

Figure 15: Mean length of MDM generations on OWT vs. insertion scale for different sampling budgets T.
E EXTENDED RELATED WORK
Remasking: Prior correction approaches in MDMs involve re-masking decoded tokens based on decoding confidence, where tokens are re-masked during inference in proportion to the negative of this probability (Wang et al., 2026). More recent works such as (Kim et al., 2025b; Huang et al., 2025; Liu et al., 2026b) add additional heads over pretrained MDMs to estimate token quality in a partially masked sequence, where lower-quality tokens are re-masked for the next unmasking step. Supervision for the correction heads is obtained by randomly replacing correct tokens with other tokens in the vocabulary (Huang et al., 2025), sampling from the model's own token distribution (Kim et al., 2025b), or introducing human-injected synthetic errors (Ji et al., 2025). Pretrained MDMs are then fine-tuned to optimize the correction loss with MDM loss regularization.
Non-remasking Correction: Contrary to re-masking approaches, (Schiff et al., 2026) proposes alternating unmasking and correction steps. The corrector is conditioned on a more informative sequence obtained by unmasking all positions, and then modifies incorrectly decoded tokens while readjusting the predictive distributions over masked positions. Pretrained MDMs can be fine-tuned to learn this correction, though it requires an additional forward pass during inference. Von Rütte et al. (2025) uses a mixed noise schedule with both uniform vocabulary and masked noise, thereby enabling the model to perform token flips. (Zhao et al., 2025) also correct decoded tokens but require architectural changes to the denoising model, thereby necessitating retraining. Seed Diffusion (Song et al., 2025) augments MDM training with an edit-based objective that teaches the model token-level edits by recovering the clean sequence from a noisy version that is generated by a controlled corruption process. It drops carry-over unmasking, so the model re-evaluates already-unmasked tokens and can implicitly self-correct.
Variable-Length Masked Diffusion: Fixed-canvas MDMs achieve variable-length control by filling extra positions with padding tokens. Rainbow Padding Kim et al. (2026a) improves on this by using a cyclic sequence of distinct padding tokens to avoid premature truncation. DAEDAL Li et al. (2026) instead iteratively inserts mask tokens at the end of the initial canvas based on EOS confidence, adapting the canvas length to the prompt before denoising, and further expands low-confidence masked regions with additional mask tokens for dynamic length control during inference. In contrast, insertion-based diffusion approaches such as FlexMDM Kim et al. (2025a) start from an empty canvas and grow the sequence by iteratively inserting new masks at arbitrary positions while unmasking previously inserted ones. Several flexible-length infilling methods predict the optimal infilling length before denoising, such as using initial-step denoising confidence Liu et al. (2026a) or a lightweight trained length-probing head Xu et al. (2026). Zhang et al. (2025) takes an orthogonal approach, allowing token positions to evolve during denoising while using optimal-transport position coupling to preserve relative order, which enables flexible-length text infilling without explicit insertion or deletion operations. Although most prior work on correction focuses on fixed-length MDMs, few approaches address self-correction in variable-length settings like DreamOn (Wu et al., 2026), which controls length through expansion and deletion operations that adaptively insert and remove masks, achieving superior performance on code-infilling benchmarks. However, it does not perform substitutions, so errors from carry-over unmasking persist.
F RANDOMLY SAMPLED GENERATIONS
F.1 OPENWEBTEXT
T=128
Google's new Google Now series is coming. (Photo: YouTube)
Google is now expanding its Android. It also plans to help it deliver its 4K Chromecast, which allows users to stream their videos from anywhere in their homes, as they do social media like Netflix. Google said that it has a wide set of messaging features and integration with Android. The company also said communication features allow conversations between YouTube and users to up to 18 percent in short-range videos and up to 90 percent. Android users said the Android Chromecast works well with Netflix, while holding back on user engagement when compared to Netflix's.
The Chromecast, which is available to all Android device makers as part of its new cross-platform standards, was released with Android 2.0, as well as support for iPhone and iPad devices as well. It will be made available soon.
T=256
Please enable Javascript to watch this
COLUMBUS, Ohio -- The Columbus Crew today announced the signing of 21-year-old international forward Jermain Zargent and a number of players.
21-year-old Zargent, MLS's second overall pick in the 2014 SuperDraft and was selected in the 2015 MLS Draft, joined by the Columbus Crew for training on Wednesday.
The first time Zargent has come to Columbus since he made it to the United States national team team last summer to join the New York Red Bulls.
Zargent is the second-ever player named to the National Team squad (17 caps) this season. He was the 13th International and returned to the team after a video of him that went viral.
Speaking to The Columbus Pioneer Press, Zargent said: “I came to the team and let me play in the summer. This is the first year I’ve found my opportunity to play in Columbus and I am excited to have opportunity and play with a good team.”
Zargent will join the Red Bulls and the United States’ first-ever head coach, head coachumberto Gonzalez.
He had a few words: “I know what my first year is to be, and training in the name of. I do a great job of working, and think about hard environment.”
native Zargent has also played for Germany and some medals at the European Championships. Zargent is happy to be out with the Red Bulls and in Columbus.
“I’m excited to play for the team, and I’m going to to Columbus. is a great opportunity for my teammates and fans and it’s a big part of my game this year,” Zargent. “It’s a great year and that’s why I put myself in Columbus. I’m going to play with myself. I love this team, my teammates and coaches and myself. I’m blessed and I’ll be a part of this team this year.”
Thank you to The Columbus Journal Sentinel for continuing to reach out to Zargent and his New Red Bulls teammates.
T=512
A former city worker is in the jail and a local who was convicted of his crimes is now off the job and a $1 million fine.
A Cook County district judge yesterday placed thei on probation, according to the Daily News. Court documents show that Esther Laili, 27, was convicted on first-degree burglary, criminal mischief, attempted grand larceny, obstruction of public service, forgery, and unlawful use of a firearm. Laili was already on his probation when he was arrested and released from jail.
"I just woke up," said Laili and his wife. "It's a sad day for the city's entire community."
The city also claims the former worker has been arrested and and is now off the job. City officials say they’re being contacted by police about Laili’s record. He’s also threatened with the release of his wife, according to court documents. If they say, “with support, shock,” and “belief, fear and harm,” Laili is going to have to pay the rest of his sentence.
Last year, the county stepped in to the McDonald McDonald case, and then even revoked the city’s five-year probation. For Laili, the judge cast a reasonable doubt that the county would maintain his probation instead of his five-year prison sentence, the Daily News reports.
T=1024
Federal authorities have responded to an Oklahoma oil spill 150 miles north of Michalaw, N.C., and containment units in several areas close to the site. The structures at the Hoover Dam are more than three times the size and have been working to contain the entire oil spill, officials said.
Andrew Coles, a project operations supervisor for the agency, said authorities immediately responded to the emergency response and oil spill.
“We have personnel at the center, and we hope can assist them.” Coles said.
If containment units fail, the damage could be catastrophic or be significant.
“We expect our response team to work not only for those areas but for the natural and environment and public safety,” said Department of Natural Resources spokesman Robert Reyna.
The structures at the Hoover Dam ---- the unit, containment tube, and chemical reinforcement ducts ---- are hazardous to about 500 feet of water, officials said.
“While Hoover Dam is safe, this spill is dangerous and has the potential to cause damage to the natural and environment,” Reyna said in a statement.
Rivera officials said a decision was made to allow the response team to work with those responsible to restore safety to public health, but did not comment on the cost or impact of the cleanup or the impact of the spill.
“This cleanup is ongoing as is always planned,” Department of Natural Resources Reyna said. “The full cleanup of the spill will be carried out in any major waste facility.”
Just as containment equipment works at water tanks behind the shores of the Great Lakes, destructive dispersants at the tanks can be taken, and the water can be released from smog.
The Sept. Sept. 11 earthquake destroyed the oil industry’s largest operating power plant, and killed more than 230,000 people in Oklahoma alone, according to the Department of Energy and Environment.
F.2 GSM8K
T=125
Question
To be promoted to the next school year, Jane takes 3 tests that together must total at least 42 points. On her first test, Jane scored 15 points, on the second test she scored 18 points. What is the minimum number of points she must score on the third test to pass?
def simple_math_problem() -> int: ...
To be promoted to the next next school year, Jane takes 33 that together must total at least 42 points. On her first test, Jane scored 15 points, on the second test she scored 18 points. What is the minimum number of points she must score on the third test to pass? ...
minimum_total_score = 42 first_test_score = 15 second_test_score = 18 third_test_score = minimum_total_score - (first_test_score + second_test_score) result = third_test_score return result
T=250
Question
Samwell owns an appliances store. For this week, one-fourth of their sales are smart TVs, one-eighth are analog TVs, and the rest are OLED TVs. If they were able to sell a total of 40 TVs, how many OLED TVs were they able to sell?
def simple_math_problem() -> int: ...
Samwell owns an appliances store. For this week, one-fourth of their sales are smart TVs, one-eighth are analog TVs, and the rest are OLED TVs.
If they were able to sell a total of 40 TVs, how many OLED TVs were they able to sell? ", total_tvs = 40 smart_tvs = total_tvs * 1/4 analog_tvs = total_tvs * 1/8 OLED_tvs = total_tvs - smart_tvs - analog_tvs result = OLED_tvs return result
T=500
Question
Brian’s basement was damp and musty, so he bought a dehumidifier to remove moisture out of the air. The device has three speeds: low, medium, and high. Brian tested the device’s efficiency and he found that the low setting removes 1 liter of water out of the air per day, the medium setting removes twice as much water per day as the low setting, and the high setting removes twice as much water per day as the medium setting. If Brian ran the dehumidifier for 3 days on the low setting, then an additional 3 days on the medium setting, and then an additional 5 days on the high setting, what is the total amount of water that the dehumidifier removed from the air in his basement, in liters?
def simple_math_problem() -> int: ", Brian’s basement was damp and musty, so he bought a dehumidifier to remove moisture out of the air. The device has three speeds: low, medium, and high. Brian tested the device’s efficiency and he found that the low setting removes 1 liter of water out of the air per day, the medium setting removes twice as much water per day as the low setting, and the high setting removes twice as much water per day as the medium setting. If Brian ran the dehumidifier for 3 days on the low setting, then an additional 3 days on the medium setting, and then an additional 5 days on the high setting, what is the total amount of water that the dehumidifier removed from the air in his basement, in liters? ", low_setting = 1 medium_setting = 2 * low_setting high_setting = 2 * medium_setting
low_setting_days = 3 medium_setting_days = 3 high_setting_days = 5
low_removed = low_setting * low_setting_days medium_removed = medium_setting * medium_setting_days high_removed = high_setting * high_setting_days
total_water_removed = low_removed + medium_removed + high_removed
result = total_water_removed return result
T=1000
Question
In a dance class of 20 students, 20% enrolled in contemporary dance, 25% of the remaining enrolled in jazz dance, and the rest enrolled in hip-hop dance. What percentage of the entire students enrolled in hip-hop dance?
def simple_math_problem() -> int: ", In a dance class of 20 students, 20%
What percentage of the entire students enrolled in hip-hop dance? '' total_students = 20 contemporary_percentage = 20 contemporary_students = (contemporary_percentage/100) * total_students remaining_students = total_students - contemporary_students jazz_percentage = 25 jazz_students = (jazz_percentage/100) * remaining_students hip_hop_students = remaining_students - jazz_students percentage = (hip_hop_students / total_students) * 100 result = percentage return result
Below we show the substitutions from three intermediate steps of a GSM8K generation trajectory with a total budget of steps, followed by the final completion. Mask tokens are denoted by , and orange highlighted transitions mark the substitutions that occurred at that time step.
Question
Marilyn wants to buy a pair of boots online. On Amazon.com, the boots cost 4. On eBay, those same pair of shoes are only $13, but shipping costs twice as much as it does on Amazon. How much more expensive do the boots work out to be on eBay?
t=146
def[M][M][M][M][M][M] Marilyn[M] to[M][M][M][M] online. [M] Amazon the boots[M] [M][M][M][M] as[M][M] does on Amazon[M][M][M] more expensive[M] the[M] work out[M] be[M][M] [M][M]n[M][M][M][M] [M] amazon_shipping = [M][M][M][M] amazon[M][M][M][M][M][M][M][M][M] = amazon_shipping_cost[M] [M][M][M][M][M]n_boots + amazon[M][M][M][M][M][M] + [M][M][M] [M] [= → ebay] _total -_total_cost[M][M][M][M] return result
t=148
def[M][M][M] int[M][M][M] Marilyn[M] to[M][M][M][M] online. [M] Amazon the boots[M] [M][M][M][M] as[M][M] does on Amazon[M][M][M] more expensive[M] the[M] work out[M] be[M][M] [M] n[M][M][M][M] [M] amazon_shipping = [M][M][M][M] [amazon → ebay] [M][M][M][M][M][M][M][M][M] = amazon_shipping_cost[M] [M][M][M][M][M]n_boots + amazon[M][M][M][M][M][M] +[M][M][M] [M] ebay_total -_total_cost[M][M][M][M] return result
t=152
def[M][M][M] int[M][M][M] Marilyn[M] to[M][M][M][M] online. [M] Amazon[M] the boots[M] [M][M][M] twice as[M][M] does on Amazon[M][M][M] more expensive[M] the[M] work out[M] be eBay[M] [M] n[M][M][M][M] [M] amazon_shipping = [M][M][M] ebay[M][M][M][M][M][M][M] ebay[M][M][M] [= → *] amazon_shipping_cost[M] [M][M][M][M][M]n_boots + amazon[M][M] ebay[M][M][M]oes +[M][M][M] [M] ebay_total -_total_cost[M][M][M][M] return result
Final
def simple_math_problem() -> int: ", Marilyn wants to buy a pair of boots online. On Amazon.com, the boots cost 4. On eBay, those same pair of shoes are only $13, but shipping costs twice as much as it does on Amazon. How much more expensive do the boots work out to be on eBay? ", martn_boots = 16 amazon_shipping_cost = 4 ebay_shoes = 13 ebay_shipping_cost = 2 * amazon_shipping_cost
martn_total_cost = martn_boots + amazon_shipping_cost ebay_total_cost = ebay_shoes + ebay_shipping_cost
cost_difference = ebay_total_cost - martn_total_cost
result = cost_difference return result