Manuscript Offprint
arXiv:2610.29255Hierarchical Masked Diffusion Language Models
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
ABSTRACT
Masked diffusion language models have emerged as an alternative to autoregressive models, enabling parallel token generation. However, standard masked diffusion language models use a shared noise schedule across positions without explicitly encoding which positions should be resolved first. Many tasks exhibit a natural priority among positions: document titles and section headings can guide the generation of body text, while Sudoku cells determined directly from the initial clues can help resolve more difficult cells. To incorporate this notion of priority (or hierarchy) among token positions, we introduce the Hierarchical Masked Diffusion Language Model (HMDLM), which augments each token position with a hierarchy level available as part of the training data, and requires zero or minimal additional annotations. It factors generation into two passes: the first predicts a hierarchy distribution over masked positions, the second predicts token distributions conditioned on it. Giving each hierarchy level its own noise schedule induces a soft, controllable preference for revealing higher-priority positions earlier while keeping decoding fully parallel. Our formulation is mathematically grounded, and we re-derive the forward and reverse processes and the NELBO for this factorization. Our evaluation shows that for the task of language generation on LM1B, HMDLM reduces perplexity by more than 1.5 points over Anchored Diffusion Language Model (ADLM), a recently proposed strong diffusion baseline; on WikiHow, we see a drop in perplexity of up to 4.4 pts on ADLM and up to 7 pts against MDLM (Masked Diffusion Language Model). A LLM judge on WikiHow, prefers HMDLM generations (the two variants combined) more than as often as the baseline. On the task of solving Sudoku puzzles requiring multi-step reasoning, it improves solution accuracy by up to 8.6% absolute points over existing diffusion baselines.
1 INTRODUCTION
Large language models (LLMs) have revolutionized the AI space, from general-purpose text generation to solving complex problems such as mathematical reasoning and theorem proving. Despite their success, limitations remain. One of the criticisms of modern-day LLMs, which are largely auto-regressive in nature, is that they generate text only in a strictly left-to-right manner. It has been argued that this style of decoding has specific disadvantages, such as not being able to correct past mistakes, and involving large computational costs. As a remedy, recent literature has proposed another class of models, referred to as Diffusion Models (Austin et al., 2021; Lou et al., 2024; Sahoo et al., 2024; Nie et al., 2025c), which do not subscribe to the left-to-right generation style, but rather generate multiple tokens in parallel. The formulation is based on a forward diffusion process, which translates the text into noise, and on learning the reverse process, can generate the desired text by iteratively denoising from complete noise. This line of work has shown significant promise for the future of language generation, both for increasing computational efficiency and solving complex tasks (e.g., solving Sudoku or generating structured text).
A key open question in masked diffusion language models is how to choose the order in which positions should be denoised. Standard masked diffusion treats token positions symmetrically: with a shared masking schedule and no task-dependent notion of priority. Recent work shows that token
Equal contribution.
ordering and decoding strategies can substantially affect generation quality (Kim et al., 2025; Garg et al., 2025; Hong et al., 2026; Fox et al., 2026). Recent approaches address this by identifying important anchor tokens (Rout et al., 2025; Xue et al., 2026), or adding planning-aware training and decoding mechanisms (Peng et al., 2025; Israel et al., 2025). These methods suggest that not all positions should be treated equally, but none provides a general hierarchy-aware forward and backward diffusion process. Such priority is often available: many problems carry a natural hierarchy over positions. In document generation, titles and section headings or summary often provide high-level semantic structure before the surrounding body text. In Sudoku, more constrained cells are easier to fill first, and their priority belongs to the position, not the digit it will contain.
We introduce HMDLM, a hierarchical extension of masked diffusion language models that associates each token position with a hierarchy variable. During the forward process, both the token and its hierarchy state are diffused toward a masked state. During the reverse process, the model first predicts the hierarchy for masked positions and then predicts token identities conditioned on the predicted hierarchy. This two-stage factorization allows the model to learn which hierarchy level each position belongs to before decoding its token value. Unlike anchor-based methods (Rout et al., 2025), which tie importance to token identities, HMDLM assigns hierarchy to positions, with a separate noise schedule per level to control how fast each level is unmasked (see Section 4.3.2). We also derive the negative evidence lower bound (NELBO) for this process which serves as our training objective 4.
We experimentally validate HMDLM across several benchmark domains. On language modeling benchmarks like LM1B, we train the model from scratch and compare with diffusion baselines (like MDLM (Sahoo et al., 2024), SEDD (Lou et al., 2024), the Anchored Diffusion Language Model (ADLM) (Rout et al., 2025), and DiffusionBERT (He et al., 2023)) on both perplexity and generation quality. On Wikihow, we fine-tune on pretrained checkpoints and compare with ADLM and MDLM on perplexity and qualitative generation. On Sudoku, we train from scratch, and more reliably produce accurate solutions than the diffusion baselines (like MGDM (Ye et al., 2025) and MDLM). These results demonstrate that explicitly modeling hierarchy over token positions can improve masked diffusion generation across both natural language and structured domains.
Our work makes the following contributions: (a) We present a novel formulation for incorporating the notion of hierarchy in the discrete diffusion models, referred to as HMDLM (b) We re-formulate the standard diffusion formulation to have a two stage training and inference process, where the first stage predicts distribution over hierarchy levels, and second one predicts token distribution given the hierarchy prediction. (c) We re-derive the ELBO to incorporate the notion of hierarchy in the forward and backward diffusion process. (d) We present experiments showing gains over masked diffusion baselines in perplexity and generation quality on LM1B and WikiHow, and report accuracy on Sudoku. We also plan to release the code for HMDLM on paper acceptance.
Generation order and decoding strategies: Masked diffusion is attractive because generation need not proceed left-to-right; tokens can be revealed in arbitrary or partially parallel orders. This flexibility also makes the choice of denoising order important. Prior work shows that adaptive or learned ordering can significantly improve masked diffusion, through inference-time token ordering.
(Kim et al., 2025), planner-aware training (Peng et al., 2025), planned generation where the model first constructs a high-level plan and then denoises the planned spans in parallel (Israel et al., 2025), variational order learning (Fox et al., 2026), or unified learnable-order formulations (Hong et al., 2026). Other methods (Wang et al., 2025; Huang et al., 2025) modify sampling trajectories to address irreversibility or decoding bias. Our work is complementary: rather than learning a free-form position policy or adding an external planner, HMDLM encodes a task-dependent hierarchy in the diffusion state itself and uses per-level schedules to induce a controllable soft generation order.
Anchoring, planning, and structured priors: Several recent works also argue that diffusion language models benefit from identifying important tokens or high-level structure before completing the full sequence. Anchored Diffusion Language Models (Rout et al., 2025) observe that masking important words early can remove useful context, and use a two-stage model that predicts anchor-token distributions before predicting missing tokens. Planned Diffusion (Israel et al., 2025) first constructs an explicit plan and then generates spans in parallel. In code generation, AnCoder (Xue et al., 2026) uses syntax-tree priors to prioritize keywords and identifiers, and code-focused diffusion models such as DiffuCoder and Dream-Coder further show the value of domain-specific structure (Gong et al., 2025; Xie et al., 2025). These works share our motivation that not all sequence positions should be treated equally. However, HMDLM differs by attaching hierarchy to positions rather than only token identities, supporting multiple task-defined hierarchy levels, and using these levels to control both the forward corruption process and the reverse denoising dynamics through level-specific schedules.
3 BACKGROUND
3.1 NOTATIONS
Let denote a sequence of discrete tokens each token is represented as one-hot column vector, and at position as the set of all such vectors. Define as the categorical distribution over classes, where and . Also we assume a special [MASK] token, and treat it as the category, i.e., . Let denote the state of the diffusion process at time step . The following description follows the treatment provided in Sahoo et al. (2024).
3.2 DISCRETE DIFFUSION MODELS
Forward process. Discrete diffusion process is defined using a forward process that gradually corrupts data over time steps, and replaces each token with a special MASK token. Let , with corresponding to clean data and to fully masked data, and denote progressively noisier latent variables where the timestep ranges from 0 (zero noise) to (maximum noise). The forward noising process at time and position is defined as:
where is the clean state, is the masking schedule where is a strictly decreasing function in , with and controlling the proportion of unmasked tokens at time . The corresponding posterior transition with is:
Reverse process. The reverse process iteratively denoises the data from timestep to until the sequence becomes fully unmasked. Diffusion model aims to approximate the reverse process by learning a backward model . Since the true posterior depends on the unknown clean token , it is approximated with a neural network , which predicts the clean token distribution from the noisy input at time . During the reverse diffusion process, unmasked tokens stay fixed, and clean inputs are never masked:
NELBO. The denoising model is trained using the following Negative ELBO:
4 HIERARCHICAL MASKED DIFFUSION LANGUAGE MODEL
In this section we introduce the Hierarchical Masked Diffusion Language Model (HMDLM), which extends discrete diffusion models by incorporating a notion of hierarchy into both the forward and backward processes. Our framework augments each token position with a hierarchy level. Let denote the gold hierarchy at position , represented as a one-hot vector over levels, i.e., . We introduce a distinct hierarchy mask state , giving possible hierarchy states. Positions to be unmasked at time step are governed by the level dependent masking schedule defined for time step and level which is a decreasing function. If a position at time step is sampled or is already unmasked, we then set and otherwise.
Since is shared, a token and its hierarchy level are always masked or revealed together, ruling out decoupled states such as a masked token with a revealed level.
4.1 FORWARD AND REVERSE PROCESS
Forward Process The forward process is a fixed Markov chain, that progressively masks tokens from the initial state to a noisy state at each time step over time steps, according to the hierarchy conditioned noise schedule . Tokens at lower hierarchy levels are masked more aggressively at early time-steps, than tokens at higher hierarchy levels. The forward marginal at a single token position with hierarchy and joint state is given by:
At , all tokens are fully masked regardless of the hierarchy level, i.e. . Let denote the probability that a masked level- position is revealed at step , with when . The true joint posterior is:
Reverse Process
The reverse process aims to recover the clean sequence from a fully masked sequence over denoising steps. We approximate the reverse process using the neural network , which is composed of two joined networks - the hierarchy head, and the token head, . It takes as input the noisy state at timestep and predicts the clean joint state .
Revealed positions are carried over unchanged, if . For a masked position ( ), the model first draws the hierarchy state and then the token conditioned on it:
(8)
where is the hierarchy head's distribution over the levels, is the token head's distribution over the vocabulary, and
, is the total probability that position is revealed at step . Since the gold hierarchy is unknown in the reverse process, replaces the true reveal probability of equation 7 by its expectation under the predicted hierarchy distribution. Because for , a masked position is more likely to be revealed at a higher level than at a lower one even when is uniform, which is what induces the soft generation order (Appendix D).
4.2 ELBO
We derive the discrete time ELBO 9 and its continuous-time limit 76 for the generative process . The detailed derivation is given in the Appendix A. The discrete ELBO is given as:
Each is a KL over the state . By the chain rule of KL divergence, can be expanded as:
The KL divergence splits into two terms 10, which we model using two stages in our architecture introduced in 4.3.
4.3 MODEL ARCHITECTURE
4.3.1 Two Stage Model

Figure 1: HMDLM inference example. Positions are masked in . Step : Stage 1 reveals , then Stage 2 predicts . Step : Stage 1 reveals and , then Stage 2 predicts .
To model the factorized posterior, we introduce the following two stage architecture 1.
First Stage: Given the partially denoised sequence at time step , the first stage predicts the hierarchy distribution at every masked position , where is the set of masked positions at time ; together with the noise schedule, this defines in equation 8. Masked positions are fed the masked state as input to Stage I during both training and inference. During training, unmasked positions are provided with their gold pairs via teacher forcing. During inference, they are provided with the token and hierarchy sampled at the step when the position was first revealed, which remain fixed thereafter. At each inference step , every masked position draws its next hierarchy state from equation 8: it is revealed at level with probability and stays masked with probability . This single draw decides both whether position is revealed at this step and at which level, which forms the set of revealed positions .
Second Stage: The second stage predicts the token distribution at each masked position i at time step : . For masked positions, it receives as input with the hierarchy at the reveal set filled in: positions are assigned gold hierarchy , during training and the Stage-I sample during inference. For remaining masked positions, we pass the mask state as input. For unmasked positions, the token and hierarchy are copied directly from and without modification: if during inference and passed during training. Both stages use weight tying, with separate output heads (hierarchy predictor head and token predictor head) attached to the final hidden layer and a softmax applied at the end of each head. This design reduces the parameter count while ensuring that both stages benefit from the same rich contextual representation.
Note: Across iterations, the token and hierarchy at each position, , are masked and unmasked jointly through a shared Bernoulli variable 5. Within a single iteration, however, Stage 1 predicts the hierarchy before Stage 2 predicts the token. The partially unmasked state with therefore arises only between the two stages of the same iteration.
4.3.2 PER-LEVEL NOISE SCHEDULE AND HIERARCHY EMBEDDINGS
We use a different masking schedule for each hierarchy level . Tokens that are more informative are given a higher hierarchy level and a slower masking schedule. Consequently, during the forward noising process, these tokens are masked more slowly than lower level tokens, preserving them for longer. They are denoised faster than other tokens during the reverse de-noising process. These tokens are unmasked earlier than lower-hierarchy tokens, allowing the model to condition on higher level tokens when predicting the remaining masked positions.
The hierarchy of a position is represented by a row of the learnable hierarchy embedding matrix , where is the number of hierarchy levels and is the hidden dimension. Row is the embedding of level , and the last row is the embedding of the hierarchy mask state . The hierarchy embedding for each position is added to the token embedding at position and fed as input to the backbone.
4.4 TRAINING AND INFERENCE
Training The HMDLM model is trained end-to-end across both the passes. We sample a time step , and mask each token independently according to the token's hierarchy level masking schedule. The input to the Stage 1 is and it predicts the hierarchy probabilities , we pass updated to Stage 2 to get token distribution for each masked position. The final training loss is governed by:
where and are tunable hyperparameters, , and is the gold hierarchy and is the gold token, and are the hierarchy-head and token-head probabilities of equation 8 at position . The full training procedure is given in Algorithm 1.
Inference During the reverse process, we start from a fully masked sequence and iteratively unmask tokens at each time step . At time step all the tokens are [MASK] tokens and hence are assigned masked state, . In Stage I, we sample hierarchy value for each masked token position at time step from the predicted hierarchy probabilities as:
with and as in equation 8, and the per-step reveal probability of level . Higher levels are masked more slowly, and for the schedules we use for at every step at which level is still masked (Appendix D). A position predicted to be at level therefore receives a larger reveal mass and is revealed earlier. The full inference algorithm is given in the Appendix (Algorithm 2).
5 EXPERIMENTS
In this section, we evaluate the proposed Hierarchical Masked Diffusion Language Model (HMDLM) along two axes: (1) its ability to model language distributions, measured via perplexity, and (2) its effectiveness as a puzzle solver, measured by accuracy. We consider three representative benchmarks: the One Billion Word Benchmark (LM1B) (Chelba et al., 2013) and WikiHow (Koupaee & Wang, 2018) for generative modeling, and Sudoku (Palm et al., 2018)
5.1 LANGUAGE GENERATION TASKS
Setup. For both LM1B and WikiHow, HMDLM adopts the MDLM backbone (Sahoo et al., 2024): 12 transformer blocks, hidden size 768, 12 attention heads, rotary positional embeddings (Su et al., 2024), and the dataset-dependent tokenizer for each corpus: BERT-base-uncased for LM1B and GPT-2 for WikiHow. The hierarchy-specific components ( levels) are (i) a shared embedding matrix , with learnable level embeddings plus a learnable [MASK]-hierarchy row for unrevealed positions, and (ii) a hierarchy-prediction head that mirrors the token head's adaLN-modulated (Peebles & Xie, 2023) final layer, mapping . Together these add parameters, about of the 139M-parameter LM1B backbone and of the 170M-parameter WikiHow backbone. The Sudoku architecture differs and is described in Section 5.2.
Metrics. We evaluate generation quality with four complementary measures. Model PPL assesses density modeling. Generative PPL assesses fluency of sampled text, but can be artificially lowered by leaning on a few high-likelihood phrases, producing repetitive, low-entropy output. We therefore read it alongside two diversity measures: entropy, where a value close to the reference or a high value indicates the model has not collapsed onto safe phrases, and MAUVE, which measures the similarity between the model-generated and reference text distributions. To corroborate the above metrics, we also run a pairwise LLM-as-judge study (GPT-5 judge) that reports how often each model's generations are preferred.
5.1.1 LM1B DATASET
Task Description: We evaluate the generative modeling capability of HMDLM by training it from scratch on LM1B, a standard dataset for language modeling. We compare test perplexity against several diffusion-based baselines: MDLM (Sahoo et al., 2024), SEDD (Lou et al., 2024), the Anchored Diffusion Language Model (ADLM) (Rout et al., 2025), and DiffusionBERT (He et al., 2023).
Setup: Using the shared language backbone (Section 5.1), we set a context length of 128 and train HMDLM from scratch for 1.25M and 2.5M steps ( 33B and 65B tokens) on LM1B (see Section B).
Hierarchy Assignment: We define two hierarchy levels on LM1B by in-sentence word frequency ( ) following Rout et al. (2025). Tokens appearing at most times in a sample are assigned to level 1 (important words) and the rest to level 0 (common words). Although ADLM reports numbers with , this setting provides limited hierarchy separation: majority of the tokens get hierarchy 1 (99.16%). Under , around 79% tokens get level 1, and the rest get assigned level 0 - yielding a more meaningful hierarchy.
Noise Schedule: We use a linear denoising schedule (identical across all models for a fair PPL comparison) with a level offset , defined for HMDLM as and for , while for .
Table 1: Test perplexities (PPL ↓) on LM1B. Best value is bolded.
| Model | PPL (↓) |
|---|---|
| 33B tokens | |
| Diffusion BERT (He et al., 2023) | ≤ 63.78 |
| SEDD (Lou et al., 2024) | ≤ 32.79 |
| MDLM (Sahoo et al., 2024) | ≤ 27.04 |
| ADLM (Rout et al., 2025) | ≤ 26.40 |
| HMDLM | ≤ 24.30 |
| 65B tokens | |
| MDLM (Sahoo et al., 2024) | ≤ 25.49 |
| ADLM (Rout et al., 2025) | ≤ 24.46 |
| HMDLM | ≤ 22.88 |
Table 2: LM1B generative evaluation on 65B checkpoints. Mean ± std over 3 seeds.
| Model | Gen. PPL (↓) | MAUVE* (↑) | Entropy |
|---|---|---|---|
| MDLM | 177.94±0.82 | 0.66±0.03 | 6.022±0.003 |
| HMDLM | 83.35±0.83 | 0.76±0.06 | 5.876±0.014 |
*MAUVE is reported here in %.
Results: We generate 1000 samples across
three seeds for each model (128 token length and 256 steps). As can be seen from the Table 1 and Table 2, HMDLM attains the best model PPL and generative perplexity (measured using GPT-2 Large) among the diffusion baselines at the 65B-token budget, cutting generative PPL by nearly 95 points relative to MDLM . The reduction in generative PPL is accompanied by only a small decrease in entropy (5.876 vs. 6.022), providing no clear evidence of severe diversity collapse. MAUVE scores, though low, are higher for HMDLM as compared to MDLM. An independent LLM-as-judge evaluation (prompt: H) is consistent with the results: in blinded pairwise comparisons with randomized A/B assignment (100 samples per seed, 3 seeds, 2 runs each; 600 comparisons total), the judge preferred HMDLM to MDLM 56% to 44%, with no ties. Under the setting, HMDLM performs similar to MDLM, as nearly all real tokens are assigned to the same hierarchy level, leaving little scope for the hierarchical mechanism to provide an advantage.
5.1.2 WIKIHOW DATASET
Task Description: We next evaluate generative modeling on WikiHow. We initialize HMDLM from the publicly released MDLM checkpoint pretrained on OpenWebText (OWT) (Gokaslan & Cohen, 2019), which we refer to as MDLM-OWT, and fully fine-tune it on WikiHow. As baselines, we fine-tune the MDLM-OWT and ADLM-OWT checkpoints on WikiHow under an identical setting.
Table 3: Model PPL ( ) across sequence lengths on WikiHow. Best value is in bold.
| L | MDLM | HMDLM-P | ADLM | HMDLM-F |
|---|---|---|---|---|
| 256 | 24.60 ± 0.22 | 23.89 ± 0.11 | 22.05 ± 0.21 | 17.62 ± 0.12 |
| 512 | 21.04 ± 0.06 | 21.76 ± 0.15 | 20.15 ± 0.10 | 16.64 ± 0.06 |
| 1024 | 22.65 ± 0.04 | 22.58 ± 0.04 | 20.92 ± 0.05 | 16.90 ± 0.09 |
HMDLM-P: position-based hierarchy. HMDLM-F: frequency-based hierarchy.
Setup: We reuse the shared language backbone (Section 5.1), fully fine-tuning from the MDLM-OWT checkpoint. We experiment with maximum sequence lengths of , filtering WikiHow to corresponding token length. The train, val, and test set corresponding to each token length is kept consistent across all models for fair comparison. During inference, we use 256 sampling steps for all three sequence lengths. All the baseline models are trained for 30 epochs. Both the HMDLM variants are trained slightly longer because of lower expected masking fraction. Detailed discussion in Appendix C.
Hierarchy Assignment: We consider two hierarchy-assignment strategies. In the position-based scheme, we assign level 1 to summary tokens and level 0 to the rest; here we compare directly against the fine-tuned MDLM model, since ADLM defines its anchor tokens by frequency rather than position and is therefore not comparable under this assignment. In the Frequency-based scheme, we reuse the frequency rule from LM1B, assigning level 1 to tokens occurring at most once in a sentence and level 0 otherwise; this is directly comparable with ADLM, as we apply the same rule to define its anchor positions.
Table 4: Generative evaluation on WikiHow across sequence lengths . HMDLM-P/F: position-/frequency-based hierarchy. Gold is the reference data.
| Model | Gen. PPL | MAUVE (↑) | Entropy | ||||||
|---|---|---|---|---|---|---|---|---|---|
| 256 | 512 | 1024 | 256 | 512 | 1024 | 256 | 512 | 1024 | |
| Gold | 25.2 | 21.0 | 20.8 | 1.00 | 1.00 | 1.00 | 5.86 | 6.42 | 6.70 |
| MDLM | 76.0 | 67.4 | 62.7 | 0.33 | 0.11 | 0.12 | 6.47 | 7.10 | 7.60 |
| ADLM | 84.0 | 82.1 | 93.81 | 0.40 | 0.21 | 0.08 | 6.49 | 7.17 | 7.77 |
| HMDLM-P | 23.1 | 17.6 | 14.6 | 0.38 | 0.13 | 0.07 | 5.91 | 6.26 | 6.45 |
| HMDLM-F | 29.2 | 25.4 | 19.92 | 0.52 | 0.41 | 0.20 | 5.98 | 6.60 | 6.83 |
Noise Schedule: We use the power-function schedule with and . Setting recovers the log-linear schedule of MDLM.
Results: HMDLM-F (Frequency based hierarchy) achieves the best model PPL and its generative PPL is closest to reference distribution. HMDLM-P (Position based hierarchy) achieves the best gen PPL, on all three generation lengths (Tables 3 and 4), cutting gen PPL by nearly 50 points relative to the baselines. The improvement is not repetition-driven: MAUVE is higher for HMDLM-F at every length, and entropy stays close to that of the reference dataset, indicating a closer match in terms of token distribution. LLM-as-judge evaluation (prompt: H) is consistent with the results: in blinded
All the baseline results in Table 1 are taken from Rout et al. (2025). We tried training the ADLM model for comparison in Table 2, but the gradients were exploding.
comparisons (400 samples, 2 runs each; 800 comparisons total), the judge preferred HMDLM-P 40.75% times, HMDLM-F 31.88% times, ADLM 15.25%, and MDLM 12.12%. Therefore, HMDLM combined was preferred more than twice the times baselines were selected. We also find that, for this dataset, HMDLM-F has lower model PPL on test set, better MAUVE scores and entropy closer to that of reference data than the HMDLM-P for all lengths. Refer to Section G in the Appendix for a qualitative analysis
Position- vs. frequency-based hierarchy: On this dataset, HMDLM-F outperforms HMDLM-P in model PPL, MAUVE, and entropy (closer to reference distribution) at all lengths. We hypothesize that generating key tokens first matters more than their positions, since these tokens provide enough context to decode the rest of the text. This is domain-dependent: for tasks like Sudoku, position-based hierarchy is likely essential. Both variants improve over MDLM, and ADLM, which is implicitly frequency-driven, is consistently outperformed by HMDLM-F. This highlights the benefit of our principled treatment of hierarchy in diffusion models.
5.2 SUDOKU DATASET
Task Description: Sudoku is a useful test case for structured reasoning. Some cells can be filled directly from the given numbers, while others can be resolved only after several other cells have been filled; revealing the easy cells first therefore makes the harder cells easier to predict. In contrast, the current diffusion models (MDLM and MGDM (Ye et al., 2025)) reveal cells without exploiting such an order. Each puzzle has 81 cells and some given cells. We use the Sudoku dataset of Palm et al. (2018) with 180k training, 18k validation, and 18k test puzzles. The given cells are never masked and are excluded from the loss.
Hierarchy labels. Starting from the given cells, we repeatedly fill the masked cells that can be determined directly. A cell is assigned a level according to the round in which it is first determined. We use six levels (): level 5 contains cells determined directly from the given cells, while lower levels contain cells that require more rounds of solving. Level 0 contains cells that are determined only after six or more rounds, or that are never determined by these rules and therefore require search. At test time, the levels of blank cells are predicted by the hierarchy head. Architecture details for both variants (25M and 6M) are provided in Appendix F.
Table 5: Sudoku-hard results: 25M parameter models under stochastic & greedy decoding.
| Metric | Model | stochastic | Greedy |
|---|---|---|---|
| Board Acc. | MDLM | 0.81 | 0.83 |
| HMDLM | 0.86 | 0.88 | |
| Cell Acc. | MDLM | 0.94 | 0.94 |
| HMDLM | 0.96 | 0.97 |
Results. HMDLM consistently outperforms the baseline in both solve rate and cell accuracy: for the 25M model it wins under both stochastic and greedy decoding (Table 5), and the same advantage holds for the compact 6M model (Table 6). We also analyze the cell accuracy for each hierarchy level (Table 8), HMDLM shows the largest gains, up to over MDLM for level 0 cells (or the cells that are most difficult to fill). Additionally, we ran a qualitative analysis on Sudoku puzzles and found that, for the 25M model, among 287 puzzles solved by HMDLM but not MDLM across all three seeds, showed MDLM making an early commitment to a search cell, while HMDLM delayed filling the same cell until fewer candidates remained. Details in Appendix F
Table 6: Sudoku-hard test set (18k puzzles). Results are from 6M-parameter models trained for 100k steps with and confidence-based sampling. Mean std over 3 sampling seeds.
| Model | Board Acc. | Cell Acc. |
|---|---|---|
| MGDM | 63.07 ± 0.18 | 85.79 ± 0.10 |
| HMDLM | 71.69 ± 0.26 | 91.13 ± 0.07 |
6 CONCLUSION AND LIMITATIONS
We introduced HMDLM, a hierarchical extension of masked diffusion language models that assigns priority to token positions and incorporates it into both the forward and reverse processes. By using level-specific noise schedules and a two-stage architecture that first predicts hierarchy and then tokens, HMDLM enables structured and controllable generation while remaining lightweight and modular. Our model consistently outperforms strong diffusion baselines by decoding semantically important tokens early and using them to better condition the rest of the sequence. While this improvement comes at the cost of additional computation due to the two-stage design, our results highlight hierarchy-aware generation as a promising direction for diffusion-based language models.
REFERENCES
Jacob Austin, Daniel D Johnson, Jonathan Ho, Daniel Tarlow, and Rianne Van Den Berg. Structured denoising diffusion models in discrete state-spaces. Advances in neural information processing systems, 34:17981–17993, 2021.
Tiwei Bie, Maosong Cao, Kun Chen, Lun Du, Mingliang Gong, Zhuochen Gong, Yanmei Gu, Jiaqi Hu, Zenan Huang, Zhenzhong Lan, et al. Llada2. 0: Scaling up diffusion language models to 100b. arXiv preprint arXiv:2512.15745, 2025.
Ciprian Chelba, Tomas Mikolov, Mike Schuster, Qi Ge, Thorsten Brants, Phillipp Koehn, and Tony Robinson. One billion word benchmark for measuring progress in statistical language modeling. arXiv preprint arXiv:1312.3005, 2013.
David Fox, Sam Bowyer, Song Liu, Laurence Aitchison, Raul Santos-Rodriguez, and Mengyue Yang. Learning generation orders for masked discrete diffusion models via variational inference. In 2nd Workshop on Deep Generative Model in Machine Learning: Theory, Principle and Efficacy, ICLR 2026, 2026.
Prateek Garg, Bhavya Kohli, and Sunita Sarawagi. Masked diffusion models are secretly learned-order autoregressive models. In EurIPS 2025 Workshop on Principles of Generative Modeling (PriGM), 2025.
Aaron Gokaslan and Vanya Cohen. Openwebtext corpus. http://Skylion007.github.io/OpenWebTextCorpus, 2019.
Shansan Gong, Ruixiang Zhang, Huangjie Zheng, Jiatao Gu, Navdeep Jaitly, Lingpeng Kong, and Yizhe Zhang. Diffucoder: Understanding and improving masked diffusion models for code generation. arXiv preprint arXiv:2506.20639, 2025.
Zhengfu He, Tianxiang Sun, Qiong Tang, Kuanning Wang, Xuan-Jing Huang, and Xipeng Qiu. Diffusionbert: Improving generative masked language models with diffusion models. In Proceedings of the 61st annual meeting of the association for computational linguistics (volume 1: Long papers), pp. 4521–4534, 2023.
Chunsan Hong, Sanghyun Lee, and Jong Chul Ye. Unifying masked diffusion models with various generation orders and beyond. arXiv preprint arXiv:2602.02112, 2026.
Pengcheng Huang, Shuhao Liu, Zhenghao Liu, Yukun Yan, Shuo Wang, Zulong Chen, and Tong Xiao. Pc-sampler: Position-aware calibration of decoding bias in masked diffusion models. arXiv preprint arXiv:2508.13021, 2025.
Daniel Israel, Tian Jin, Ellie Cheng, Guy Van den Broeck, Aditya Grover, Suvinay Subramanian, and Michael Carbin. Planned diffusion. arXiv preprint arXiv:2510.18087, 2025.
Jaeyeon Kim, Kulin Shah, Vasilis Kontonis, Sham M Kakade, and Sitan Chen. Train for the worst, plan for the best: Understanding token ordering in masked diffusions. In International Conference on Machine Learning, pp. 30749–30768. PMLR, 2025.
Mahnaz Koupaee and William Yang Wang. Wikihow: A large scale text summarization dataset, 2018. URL https://arxiv.org/abs/1810.09305.
Xiang Li, John Thickstun, Ishaan Gulrajani, Percy S Liang, and Tatsunori B Hashimoto. Diffusion-lm improves controllable text generation. Advances in neural information processing systems, 35: 4328–4343, 2022.
Aaron Lou, Chenlin Meng, and Stefano Ermon. Discrete diffusion modeling by estimating the ratios of the data distribution. In Proceedings of the 41st International Conference on Machine Learning, pp. 32819–32848, 2024.
Shen Nie, Fengqi Zhu, Chao Du, Tianyu Pang, Qian Liu, Guangtao Zeng, Min Lin, and Chongxuan Li. Scaling up masked diffusion models on text. In Y. Yue, A. Garg, N. Peng, F. Sha, and R. Yu (eds.), International Conference on Learning Representations, volume 2025, pp. 82974–82997, 2025a. URL https://proceedings.iclr.cc/paper_files/paper/2025/file/celc1ff5d94079dea348a2317a889281-Paper-Conference.pdf.
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. arXiv preprint arXiv:2502.09992, 2025b.
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, 2025c. URL https://arxiv.org/abs/2502.09992.
Rasmus Palm, Ulrich Paquet, and Ole Winther. Recurrent relational networks. In S. Bengio, H. Wallach, H. Larochelle, K. Grauman, N. Cesa-Bianchi, and R. Garnett (eds.), Advances in Neural Information Processing Systems, volume 31, pp. 3372–3382. Curran Associates, Inc., 2018. URL http://nips.cc.
William Peebles and Saining Xie. Scalable diffusion models with transformers, 2023. URL https://arxiv.org/abs/2212.09748.
Fred Zhangzhi Peng, Zachary Bezemek, Jarrid Rector-Brooks, Shuibai Zhang, Anru R Zhang, Michael Bronstein, Alexander Tong, and Avishek Joey Bose. Planner aware path learning in diffusion language models training. arXiv preprint arXiv:2509.23405, 2025.
Litu Rout, Constantine Caramanis, and Sanjay Shakkottai. Anchored diffusion language model, 2025. URL https://arxiv.org/abs/2505.18456.
Subham S Sahoo, Marianne Arriola, Yair Schiff, Aaron Gokaslan, Edgar Marroquin, Justin T Chiu, Alexander Rush, and Volodymyr Kuleshov. Simple and effective masked diffusion language models. Advances in Neural Information Processing Systems, 37:130136–130184, 2024.
Jiaxin Shi, Kehang Han, Zhe Wang, Arnaud Doucet, and Michalis Titsias. Simplified and generalized masked diffusion for discrete data. Advances in neural information processing systems, 37:103131–103167, 2024.
Jianlin Su, Murtadha Ahmed, Yu Lu, Shengfeng Pan, Wen Bo, and Yunfeng Liu. Roformer: Enhanced transformer with rotary position embedding. Neurocomputing, 568:127063, 2024.
Guanghan Wang, Yair Schiff, Subham Sahoo, and Volodymyr Kuleshov. Remasking discrete diffusion models with inference-time scaling. In The Thirty-ninth Annual Conference on Neural Information Processing Systems, 2025. URL https://openreview.net/forum?id=IJryQAOy0p.
Zhihui Xie, Jiacheng Ye, Lin Zheng, Jiahui Gao, Jingwei Dong, Zirui Wu, Xueliang Zhao, Shansan Gong, Xin Jiang, Zhenguo Li, et al. Dream-coder 7b: An open diffusion language model for code. arXiv preprint arXiv:2509.01142, 2025.
Anton Xue, Litu Rout, Constantine Caramanis, and Sanjay Shakkottai. Ancoder: Anchored code generation via discrete diffusion models. arXiv preprint arXiv:2602.17688, 2026.
Jiacheng Ye, Jiahui Gao, Shansan Gong, Lin Zheng, Xin Jiang, Zhenguo Li, and Lingpeng Kong. Beyond autoregression: Discrete diffusion for complex reasoning and planning. In International Conference on Learning Representations (ICLR), 2025.
Lin Zheng, Jianbo Yuan, Lei Yu, and Lingpeng Kong. A reparameterized discrete diffusion model for text generation. arXiv preprint arXiv:2302.05737, 2023.
A DISCRETE-TIME ELBO
A.1 JOINT GENERATIVE MODEL
Hierarchy is jointly modelled with tokens. We represent the state of the model at time step as . When token is masked (), both the token and its hierarchy level are masked: the token is replaced by [MASK] and is set to masked hierarchy state (). HMDLM therefore targets the joint distribution:
For and a masked position , both and are revealed together upon unmasking, with the hierarchy fixed consistently to :
A.2 STEP 1 — INTRODUCE THE JOINT DIFFUSION PROCESS
We target the joint distribution . The joint is the diffusion state at time : when , both the token and its hierarchy label are masked and unobserved; when , both are revealed together. Introduce the latent noisy sequence of joint states at discrete time steps :
Because each denoising step depends only on the current state and not on the whole history, the joint model breaks into a product of one-step reverse predictions:
We now split each reverse step into two parts: first predict the hierarchy, then predict the token given that hierarchy. We also drop from the token prediction, since already carries the hierarchy information needed. Finally, since the last state is fully masked and fixed, its prior splits into a product . This gives:
Multiply and divide by the forward process in 15:
A.3 STEP 2 — APPLY JENSEN'S INEQUALITY
Since log is concave, Jensen's inequality gives:
A.4 STEP 3 — EXPAND THE LOG OF THE JOINT MODEL
The forward process factorises as:
Taking the log of equation 17 gives:
Substituting into equation 19:
(22)
A.5 STEP 4 — TELESCOPE THE FORWARD TERMS
Key identity. By Bayes' rule on the joint forward process:
Rearranging:
(24)
Telescoping. Substituting equation 24 into and using :
Substitute back. Applying equation 25 to equation 22, grouping separately, and identifying each pair as :
(26)
Here since the terminal prior factorises. The reverse model factorises as
We approximate the reverse process using the neural network , which is composed of two joined networks is modeled as and is modeled as .
A.6 STEP 5 — DECOMPOSE THE JOINT KL TERM (FULL DERIVATION)
Each is a KL over the joint state , so that the term of interest is .
Chain rule of KL divergence. For any two joint distributions and that are each factorised in the same variable order, the KL divergence obeys the exact identity
Hierarchy-first factorisation. We apply equation 28 with (hierarchy) and (token), matching the two-stage structure of the model. The true posterior factorises by the product rule,
Note: We drop since contains the latest state of the model.
The reverse model is defined to factorise in the same order - Pass 1 predicts and Pass 2 predicts conditioned on it
Apply the chain rule. Substituting the factorisations equation 29 and equation 30 into the identity equation 28 yields the two-term decomposition
A.7 STEP 6 — SIMPLIFY THE TERMINAL TERM
At , every token and hierarchy label is fully masked with probability . The joint prior is therefore also the fully-masked state, so
We drop this term.
A.8 STEP 7 — FULL JOINT DISCRETE ELBO
Dropping :
(33)
A.9 STEP 8 — EXPAND THE HIERARCHY KL (PASS 1)
From equation 33, the hierarchy contribution at reverse step t is:
Since the forward process factorizes independently across sequence positions, and the Pass-1 hierarchy head predicts each position independently given the noisy state ,
The joint KL therefore decomposes into a sum of independent per-position KLs,
Notation. Let
denote the Pass-1 softmax distribution over the K hierarchy classes at position i. For convenience we write
where is the gold reveal probability associated with the true hierarchy class , and is the (schedule-determined) reveal probability of class . The quantity is the model's total predicted reveal probability, obtained by averaging the class-dependent reveal probability under the Pass-1 distribution .
Forward posterior at masked positions. At an unmasked position we have deterministically, contributing zero KL. At a masked position the absorbing-state posterior is
Reverse hierarchy model (Pass 1). The head first assigns position to class with probability , and each class then reveals at its own known schedule probability . The reverse model is thus
Each class here reveals at its own probability , and on the gold class this gives the gold probability directly,
Per-position KL.
The KL divergence is
Since for every incorrect hierarchy class (), all such terms vanish — the off-gold entries never enter the KL and serve only to normalize . Only the gold-class and mask rows remain,
In the gold-class row the reveal rate cancels between numerator and denominator, leaving a pure cross-entropy on :
Hence
Summing over all the positions,
A.10 STEP 9 — EXPAND THE TOKEN KL (PASS 2)
We expand the per-position token contribution
By the shared reveal variable ( equation 5), position is governed by a single Bernoulli , and the joint state is a deterministic push-forward of : both streams reveal to when the position is kept and mask to otherwise. Consequently the joint reverse posterior over is equation 40.
Branch decomposition. The outer expectation in equation 49 runs over the two values , with marginal weights and from equation 40. We treat each branch in turn.
Revealed branch .
Masked branch .
Taking the outer expectation.
(52)
Summing over position,
The token loss is thus a reveal-weighted cross-entropy on the Pass-2 softmax: each position contributes the negative log-likelihood of its clean token , weighted by the class-dependent probability that the position is revealed at step .
Setup. Let , and let be the class- survival (unmasked) probability, decreasing with , .
Step A — per-step masked-position KL
Step B — sum over timesteps.
Step C — expose the mask indicator.
Step D — Riemann rescaling ().
Step E — limit : weight reveal hazard.
Step F — continuous-time loss.
Step G — Hierarchy head (same derivation, ).
Let , and
Both and every are , hence so is .
Step H — expose the mask indicator. Only masked positions contribute (unmasked positions give zero KL, cf. equation 49):
Step I — small-step expansion. Write and , both . Using ,
Multiplying by and collecting terms by order,
Step J — Riemann rescaling ( ).
Step K — limit : rate reveal hazard. For each class , as in Step E of the token derivation,
Applying this to and, term by term, to ,
so that
while the quadratic remainder vanishes.
Now, the term,
Since is continuous, as . Moreover, implies , so the denominator is nonzero. Therefore
The only singular point is : since ,
while remains bounded and is undefined only at itself.
In practice, we sample , and therefore never sample and hence the expression always stays bounded, where .
Step L — continuous-time extra term.
A.11 STEP 10 — FINAL TRAINING LOSS
Training losses. The final training loss consists of the following three components:
In practice we optimise a reweighted sum of the same three terms, replacing the tied weights above by tunable coefficients:
We tried training the second stage with all gold hierarchy. However, the performance during inference was not as expected since the model never learned to predict the correct token distribution without gold hierarchy, which is the case during inference (inference sees masked hierarchy during second stage). Therefore, we added steps 10 - 16 where in we sample token positions and pass gold hierarchy during training only for this subset, and rest of the positions mask their hierarchy.
Algorithm 1 HMDLM training
Require: data of clean pairs , with , ; per-class keep schedules with reveal probabilities ; hierarchy head (Pass 1), token head (Pass 2); number of inference time steps , weights , ; learning rate .
1: while not converged do 2: sample , // Forward corruption to level 3: for do 4: 5: if else 6: end for Pass 1 — hierarchy. 7: , , for all 8: 9:
10: 11: for with do 12: 13: 14: end for 15: 16: for ; otherwise Pass-2 context only: gold hierarchy at , elsewhere Pass 2 — token. 17: for all 18: // Combine and update 19: 20: 21: end while
B EXPECTED MASK FRACTION UNDER HIERARCHICAL LOG-LINEAR SCHEDULE
We derive the expected fraction of masked tokens per training step under our hierarchical masking schedule, which is needed to compute the effective training-token budget and compare fairly against baseline diffusion language models (Sahoo et al., 2024).
Setup. Let denote the number of hierarchy levels and let denote the per-level time offset. The effective time at level is
and the log-linear schedule for level k is
The probability that a token at level k is masked at time t is therefore
Algorithm 2 HMDLM ancestral sampling (reverse process)
Require: hierarchy head (Pass 1), token head (Pass 2); per-class keep schedules ; number of steps ; optional token temperature .
1: , for all : fully masked 2: for , do 3: , reverse step ; , persist across iterations Pass 1 — hierarchy. 4: for all with 5: 6: for with do 7: for per-step reveal probability of class 8: sample ; commit the sampled class (or ) into 9: if then 10: position revealed this step (shared across both streams) 11: end if 12: end for Pass 2 — token. Fill tokens at , conditioned on the just-sampled hierarchy . 13: for all carries at from line 9 14: for do 15: sample reveal token; masked positions keep 16: end for 17: freeze for all ; carry all of into step committed positions are never revisited 18: end for 19: return clean sample
Per-level expected mask probability. We compute . Splitting the integral at the clamp boundary :
With the substitution , the second integral becomes
Hence,
Plugging in our configuration. With , level offsets (rare tokens) and (frequent tokens), and :
Overall expected mask fraction. Let denote the fraction of real token positions assigned to level , with . The overall expected mask fraction is
For LM1B with the bert-base-uncased tokenizer and context length , we assign a token to level 1 if it occurs at most times within its own sequence (at , exactly once).
Measured over the full training split (30,301,028 sequences, 922,347,589 real tokens), level 1 holds 737,634,266 real tokens at and 914,638,961 at , so
Substituting into equation 85:
Effective training-token budget. The budget is denominated in supervised positions, i.e. those that are both masked and real. Padding is excluded from the loss. Given training steps S, batch size B, and mean real length , the expected number of supervised tokens is
With and , each step presents real positions and therefore supervises tokens at and at , against MDLM's . To reach a target budget , the required number of steps is
We instantiate this at two budgets. MDLM's 33B tokens on LM1B counts masked positions over the padded context ; of these, a fraction are real, so the same run supervises tokens. Matching it requires
For the extended budget, twice as large at supervised tokens (65.47B masked positions),
C EXPECTED MASKING FRACTION FOR WIKIHOW
Under the hierarchical power schedule, a response token at level with exponent is masked at diffusion time with probability . Its expected masking rate is therefore
Let be the fraction of tokens assigned to level , pooled over the training set and counted over diffused positions only (the prompt and padding are excluded). The expected masking rate of HMDLM is then
LM1B sequences are not packed, so a 128-position row holds real tokens on average and the remainder is padding.
Table 7: Step-matched training budgets on WikiHow at context lengths 512 and 1024. is the fraction of tokens at level 1. Under the summary rule, level 1 is the article summary. Under the count rule (), level 1 is any token occurring at most once in its own sample.
| Model | Steps | Extra steps (epochs) | ||
|---|---|---|---|---|
| MDLM | - | - | ||
| HMDLM (summary) | ||||
| HMDLM () | ||||
| MDLM | - | - | ||
| HMDLM (summary) | ||||
| HMDLM () |
MDLM corresponds to a single level with , giving . With two levels and exponents , ,
so the ratio to MDLM, in which cancels, is
To match the expected number of masked (loss-bearing) tokens seen by MDLM in steps at the same batch size, HMDLM is trained for
steps.
On WikiHow, MDLM is trained for epochs at each context length, with a global batch of 128: steps at (123,046 training examples, 961.3 steps per epoch) and steps at (176,696 training examples, 1,380.4 steps per epoch). Table 7 gives the resulting budgets.
D PER-LEVEL SCHEDULES AND THE INDUCED REVEAL ORDER
Levels are indexed so that a higher level is masked more slowly. Formally, for any two levels we require
with strict inequality at every step at which level is active, i.e. . Since and for every , the inequality is necessarily an equality at the two endpoints. Fewer level- positions are therefore masked at any interior point of the forward process.
The reverse dynamics are governed by the per-step reveal probability , and equation 101 does not by itself imply an ordering of the . We therefore state the property we use directly: for ,
Outside that interval, , no level- position is masked and ; the ordering is vacuous there, since there is nothing left at level to reveal. Both schedules used in our experiments satisfy equation 102, as the continuous-time hazards show:
-
Log-linear with per-level offset equation 78, used on LM1B: for and otherwise. For and we have , hence .
-
Power schedule , used on WikiHow: , so the ordering holds exactly when . We use , and recovers the log-linear schedule of MDLM.
The discrete inherit the ordering on the step grids used in our experiments ( on both LM1B, and WikiHow): the only steps at which are the 64 LM1B steps with , where level 1 is inactive and .
Consequently, while level is still being revealed, a position that Stage I predicts to be at level receives a larger reveal mass in equation 8 and is revealed earlier, which is the soft generation order HMDLM is designed to induce.
E PERPLEXITY: CONTINUOUS-TIME ELBO WEIGHT
We evaluate test-set perplexity under the continuous-time limit of the HMDLM ELBO. For a single hierarchy level , the masking schedule is linear with offset :
where is the survival (clean) probability of a level-k token at time t.
Per-level continuous-time weight. The standard absorbing-state ELBO weight is
For the schedule in equation 103, on the active interval ,
Substituting into equation 104,
For the level is fully unmasked and contributes no loss; we therefore extend by zero in that regime:
recovers the MDLM weight 1/t used by Sahoo et al. (2024), so equation 107 is a strict generalisation.
Posterior-weighted per-token weight. Since at evaluation, the gold hierarchy is not available, at position i, we replace the gold-hierarchy weight with its expectation under the model's posterior over hierarchy levels at time :
where is the Pass-1 hierarchy distribution at position i.
Token-level perplexity. Let denote the total number of tokens (non-padding) in the test set, and let be sampled by the joint forward process at time , with . The per-token negative log-likelihood is
and the reported test-set perplexity is
Numerical handling of . At is bounded in code by a denominator floor:
which leaves the weight unchanged everywhere except in a vanishingly small neighbourhood of and prevents single-sample gradient spikes from the Monte-Carlo estimator.
F ARCHITECTURE DETAILS AND QUALITATIVE ANALYSIS ON SUDOKU
F.1 ARCHITECTURE DETAILS
For the 6M MGDM and HMDLM models, we use a compact 3-layer GPT-2 Transformer (5.5M parameters) with hidden size 384, 12 attention heads of dimension 32, a 1536-dimensional GELU feed-forward layer, learned absolute position embeddings, and a 31-token character-level vocabulary whose output head shares weights with the input embedding and bidirectional attention. The hierarchical variant (HMDLM) adds only a level embedding and a level-prediction head, about 5K extra parameters.
For the 25M MDLM and HMDLM models, we use a 12-layer diffusion transformer (DiT, 25.0M parameters) with hidden size 384, 6 attention heads of dimension 64, a 1536-dimensional GELU feed-forward layer, rotary position embeddings, and bidirectional attention over a fixed 81-token sequence (one token per cell). Both the models are trained from scratch. The hierarchical variant (HMDLM, K=6 levels) adds a 7x384 level embedding (6 levels plus a [MASK] level), which is summed with the token embedding, and a level-prediction head that has the same form as the token output head. Together they add about 104K parameters (25.10M versus 24.99M).
F.2 QUALITATIVE ANALYSIS
For the sudoku 25M hmdlm and mdlm models - we identified 287 puzzles where MDLM failed to solve across all three seeds but HMDLM solved correctly across all three. We then performed 8 additional inference runs per model on these puzzles. We pick some of these examples and trace their unmasking order to show how HMDLM helped in getting the right answer:
Example 1: 506070800400000016000000000002000003070050400000900020960000500030002007000100000
9 clue 3 MDLM fill 8 HMDLM fill ✗ wrong fill ☐ trap cell ☐ cell that rules out MDLM's digit ☐ filled this round
3 gold level of a blank (blue = forced, grey = search)
MDLM - sample 0

allowed in trap 1 2 3 4 5 6 7 8 9
0/60 filled · 0 wrong
HMDLM - sample 0

allowed in trap 1 2 3 4 5 6 7 8 9
Start. Initial board.
Figure 2: Example 1, Start.
9 clue 3 MDLM fill 8 HMDLM fill ✗ wrong fill □ trap cell □ cell that rules out MDLM's digit □ filled this round
3 gold level of a blank (blue = forced, grey = search)
MDLM · sample 0
stopped at first error (R2) · 2/60 filled · 1 wrong
HMDLM · sample 0
| 5 | 4 | 6 | 0 | 7 | 3 | 8 | 0 | 0 |
|---|---|---|---|---|---|---|---|---|
| 4 | 0 | 0 | 0 | 1 | 0 | 1 | 1 | 6 |
| 2 | 1 | 0 | 0 | 0 | 0 | 1 | 1 | 0 |
| 0 | 1 | 2 | 0 | 0 | 0 | 0 | 1 | 3 |
| 0 | 7 | 0 | 5 | 5 | 0 | 4 | 0 | 0 |
| 0 | 0 | 0 | 9 | 0 | 1 | 1 | 2 | 1 |
| 9 | 6 | 4 | 1 | 0 | 0 | 5 | 4 | 5 |
| 3 | 3 | 0 | 0 | 0 | 2 | 4 | 0 | 7 |
| 3 | 0 | 2 | 1 | 0 | 9 | 0 | 0 | 0 |
allowed in trap 1 2 3 4 5 6 7 8 9
| 5 | 4 | 6 | 0 | 7 | 3 | 8 | 0 | 0 |
|---|---|---|---|---|---|---|---|---|
| 4 | 0 | 0 | 0 | 1 | 0 | 1 | 1 | 6 |
| 2 | 1 | 0 | 0 | 0 | 0 | 1 | 1 | 0 |
| 0 | 1 | 2 | 0 | 0 | 0 | 0 | 1 | 3 |
| 0 | 7 | 0 | 5 | 5 | 0 | 4 | 0 | 0 |
| 0 | 0 | 0 | 9 | 0 | 1 | 1 | 2 | 1 |
| 9 | 6 | 4 | 1 | 0 | 0 | 5 | 4 | 5 |
| 3 | 3 | 0 | 0 | 0 | 2 | 4 | 0 | 7 |
| 3 | 0 | 2 | 1 | 0 | 9 | 0 | 0 | 0 |
allowed in trap 1 2 3 4 5 6 7 8 9
| 5 | 4 | 6 | 0 | 7 | 3 | 8 | 0 | 0 |
|---|---|---|---|---|---|---|---|---|
| 4 | 0 | 0 | 0 | 1 | 0 | 1 | 1 | 6 |
| 2 | 1 | 0 | 0 | 0 | 0 | 1 | 1 | 0 |
| 0 | 1 | 2 | 0 | 0 | 0 | 0 | 1 | 3 |
| 0 | 7 | 0 | 5 | 5 | 0 | 4 | 0 | 0 |
| 0 | 0 | 0 | 9 | 0 | 1 | 1 | 2 | 1 |
| 9 | 6 | 4 | 1 | 0 | 0 | 5 | 4 | 5 |
| 3 | 3 | 0 | 0 | 0 | 2 | 4 | 0 | 7 |
| 3 | 0 | 2 | 1 | 0 | 9 | 0 | 0 | 0 |
allowed in trap 1 2 3 4 5 6 7 8 9
Figure 3: Example 1, round 2.
9 clue 3 MDLM fill 8 HMDLM fill ✗ wrong fill □ trap cell □ cell that rules out MDLM's digit □ filled this round
3 gold level of a blank (blue = forced, grey = search)
MDLM · sample 0
stopped at first error (R2) · 2/60 filled · 1 wrong
HMDLM · sample 0
| 5 | 4 | 6 | 0 | 7 | 3 | 8 | 0 | 0 |
|---|---|---|---|---|---|---|---|---|
| 4 | 0 | 0 | 0 | 1 | 0 | 1 | 1 | 6 |
| 2 | 1 | 0 | 0 | 0 | 0 | 1 | 1 | 0 |
| 0 | 1 | 2 | 0 | 0 | 0 | 0 | 1 | 3 |
| 0 | 7 | 0 | 5 | 5 | 0 | 4 | 0 | 0 |
| 0 | 0 | 0 | 9 | 0 | 1 | 1 | 2 | 1 |
| 9 | 6 | 4 | 1 | 0 | 0 | 5 | 4 | 5 |
| 3 | 3 | 0 | 0 | 0 | 2 | 4 | 0 | 7 |
| 3 | 0 | 2 | 1 | 0 | 9 | 0 | 0 | 0 |
allowed in trap 1 2 3 4 5 6 7 8 9
| 5 | 2 | 6 | 0 | 7 | 3 | 1 | 8 | 3 | 0 |
|---|---|---|---|---|---|---|---|---|---|
| 4 | 0 | 3 | 0 | 5 | 2 | 8 | 7 | 1 | 6 |
| 2 | 7 | 1 | 0 | 0 | 0 | 0 | 1 | 2 | 0 |
| 0 | 1 | 5 | 2 | 0 | 1 | 4 | 9 | 7 | 3 |
| 0 | 3 | 7 | 0 | 5 | 2 | 5 | 4 | 0 | 1 |
| 0 | 1 | 0 | 0 | 9 | 3 | 1 | 6 | 2 | 5 |
| 9 | 6 | 1 | 1 | 0 | 8 | 3 | 5 | 0 | 2 |
| 3 | 8 | 3 | 0 | 6 | 4 | 2 | 4 | 0 | 7 |
| 3 | 2 | 0 | 2 | 1 | 9 | 0 | 0 | 6 | 8 |
allowed in trap 1 2 3 4 5 6 7 8 9
Round 25. HMDLM defers R9C6 and fills other cells first.
Figure 4: Example 1, round 25.
9 clue 3 MDLM fill 8 HMDLM fill ✗ wrong fill □ trap cell □ cell that rules out MDLM's digit □ filled this round
3 gold level of a blank (blue = forced, grey = search)
MDLM · sample 0
stopped at first error (R2) · 2/60 filled · 1 wrong
HMDLM · sample 0
| 5 | 4 | 6 | 0 | 7 | 3 | 8 | 0 | 0 |
|---|---|---|---|---|---|---|---|---|
| 4 | 0 | 0 | 0 | 1 | 0 | 1 | 1 | 6 |
| 2 | 1 | 0 | 0 | 0 | 0 | 1 | 1 | 0 |
| 0 | 1 | 2 | 0 | 0 | 0 | 0 | 1 | 3 |
| 0 | 7 | 0 | 5 | 5 | 0 | 4 | 0 | 0 |
| 0 | 0 | 0 | 9 | 0 | 1 | 1 | 2 | 1 |
| 9 | 6 | 4 | 1 | 0 | 0 | 5 | 4 | 5 |
| 3 | 3 | 0 | 0 | 0 | 2 | 4 | 0 | 7 |
| 3 | 0 | 2 | 1 | 0 | 9 | 0 | 0 | 0 |
allowed in trap 1 2 3 4 5 6 7 8 9
| 5 | 4 | 6 | 0 | 7 | 3 | 1 | 8 | 0 | 0 |
|---|---|---|---|---|---|---|---|---|---|
| 4 | 0 | 3 | 0 | 5 | 2 | 8 | 7 | 1 | 6 |
| 2 | 7 | 1 | 0 | 0 | 0 | 0 | 1 | 2 | 5 |
| 0 | 1 | 5 | 2 | 0 | 1 | 4 | 9 | 7 | 3 |
| 0 | 3 | 7 | 0 | 5 | 2 | 5 | 4 | 8 | 1 |
| 0 | 1 | 0 | 0 | 9 | 3 | 1 | 6 | 2 | 5 |
| 9 | 6 | 4 | 1 | 1 | 8 | 3 | 5 | 0 | 2 |
| 3 | 8 | 3 | 0 | 6 | 4 | 2 | 4 | 0 | 7 |
| 3 | 2 | 0 | 2 | 1 | 9 | 5 | 0 | 6 | 8 |
allowed in trap 1 2 3 4 5 6 7 8 9
Round 26. Finally, HMDLM gets the R9C6 cell right at round 25, when the only possible value left is 5 and gets it correct.
Figure 5: Example 1, round 26.
Example 2: 008100026000807000900000000010008900030000010000450000000309800200000400500020300
9 clue 3 MDLM fill 8 HMDLM fill x wrong fill trap cell cell that rules out MDLM's digit filled this round
3 gold level of a blank (blue = forced, grey = search)
MDLM · sample 0
| 2 | 1 | 8 | 1 | 5 | 1 | 1 | 2 | 6 |
|---|---|---|---|---|---|---|---|---|
| 3 | 0 | 0 | 8 | 0 | 7 | 2 | 0 | 0 |
| 9 | 1 | 0 | 1 | 0 | 1 | 2 | 0 | 0 |
| 0 | 1 | 0 | 0 | 4 | 8 | 9 | 0 | 0 |
| 0 | 3 | 0 | 5 | 3 | 1 | 0 | 1 | 0 |
| 0 | 0 | 2 | 4 | 5 | 5 | 0 | 0 | 0 |
| 0 | 0 | 3 | 4 | 9 | 8 | 4 | 5 | |
| 2 | 2 | 5 | 1 | 5 | 1 | 4 | 0 | 4 |
| 5 | 5 | 3 | 0 | 2 | 3 | 3 | 0 | 0 |
allowed in trap 1 2 3 4 5 6 7 8 9
0/59 filled · 0 wrong
HMDLM · sample 0
| 2 | 1 | 8 | 1 | 5 | 1 | 1 | 2 | 6 |
|---|---|---|---|---|---|---|---|---|
| 3 | 0 | 0 | 8 | 0 | 7 | 2 | 0 | 0 |
| 9 | 1 | 0 | 1 | 0 | 1 | 2 | 0 | 0 |
| 0 | 1 | 0 | 0 | 4 | 8 | 9 | 0 | 0 |
| 0 | 3 | 0 | 5 | 3 | 1 | 0 | 1 | 0 |
| 0 | 0 | 2 | 4 | 5 | 5 | 0 | 0 | 0 |
| 0 | 0 | 3 | 4 | 9 | 8 | 4 | 5 | |
| 2 | 2 | 5 | 1 | 5 | 1 | 4 | 0 | 4 |
| 5 | 5 | 3 | 0 | 2 | 3 | 3 | 0 | 0 |
allowed in trap 1 2 3 4 5 6 7 8 9
Start. Initial Board.
Figure 6: Example 2, Start.
9 clue 3 MDLM fill 8 HMDLM fill x wrong fill trap cell cell that rules out MDLM's digit filled this round
3 gold level of a blank (blue = forced, grey = search)
MDLM · sample 0
stopped at first error (R1) · 1/59 filled · 1 wrong
HMDLM · sample 0
| 2 | 1 | 8 | 1 | 5 | 1 | 1 | 2 | 6 |
|---|---|---|---|---|---|---|---|---|
| 3 | 0 | 0 | 8 | 0 | 7 | 2 | 0 | 0 |
| 9 | 1 | 0 | 1 | 0 | 1 | 2 | 0 | 0 |
| 0 | 1 | 0 | 0 | 4 | 8 | 9 | 0 | 0 |
| 0 | 3 | 0 | 5 | 3 | 1 | 0 | 1 | 0 |
| 0 | 0 | 2 | 4 | 5 | 5 | 0 | 0 | 0 |
| 0 | 0 | 3 | 4 | 9 | 8 | 4 | 5 | |
| 2 | 2 | 5 | 1 | 5 | 1 | 4 | 0 | 4 |
| 5 | 5 | 3 | 0 | 2 | 3 | 3 | 0 | 0 |
allowed in trap 1 2 3 4 5 6 7 8 9
Round 1. MDLM predicts the R7C1 cell and gets it wrong. There are multiple possible values for the cell 1,4,6,7. HMDLM on the other hand, pushes the unmasking of this cell to later rounds.
Figure 7: Example 2, round 1.
9 clue 3 MDLM fill 8 HMDLM fill x wrong fill trap cell cell that rules out MDLM's digit filled this round
3 gold level of a blank (blue = forced, grey = search)
MDLM · sample 0
stopped at first error (R1) · 1/59 filled · 1 wrong
HMDLM · sample 0
| 2 | 1 | 8 | 1 | 5 | 1 | 1 | 2 | 6 |
|---|---|---|---|---|---|---|---|---|
| 3 | 0 | 0 | 8 | 0 | 7 | 2 | 0 | 0 |
| 9 | 1 | 0 | 1 | 0 | 1 | 2 | 0 | 0 |
| 0 | 1 | 0 | 0 | 4 | 8 | 9 | 0 | 0 |
| 0 | 3 | 0 | 5 | 3 | 1 | 0 | 1 | 0 |
| 0 | 0 | 2 | 4 | 5 | 5 | 0 | 0 | 0 |
| 0 | 0 | 3 | 4 | 9 | 8 | 4 | 5 | |
| 2 | 2 | 5 | 1 | 5 | 1 | 4 | 0 | 4 |
| 5 | 5 | 3 | 0 | 2 | 3 | 3 | 0 | 0 |
allowed in trap 1 2 3 4 5 6 7 8 9
Round 29. HMDLM predicts the neighbouring cells first.
Figure 8: Example 2, round 29.
9 clue 3 MDLM fill 8 HMDLM fill ✗ wrong fill □ trap cell □ cell that rules out MDLM's digit □ filled this round
3 gold level of a blank (blue = forced, grey = search)
MDLM · sample 0
stopped at first error (R1) · 1/59 filled · 1 wrong
HMDLM · sample 0

allowed in trap 1 2 3 4 5 6 7 8 9

allowed in trap 1 2 3 4 5 6 7 8 9
Round 36. HMDLM predicts cell R7C1 correctly.
Figure 9: Example 2, round 36.
Both the samples show the same pattern, MDLM tends to unmask ambiguous cells in the beginning and gets the prediction wrong. On the other hand, HMDLM tends to defer the unmasking of such cells to later rounds until neighbouring cells get filled first. Across 287 puzzles (where HMDLM passed and MDLM failed) with 8 samples per model, we find 131 cases where MDLM's first error is an early commit to a search cell and HMDLM fills that same cell only once a single candidate remains.
F.3 CELL ACCURACY PER HIERARCHY LEVEL
Table 8: Cell accuracy (%) by hierarchy level.
| Level | Cells | MDLM | HMDLM |
|---|---|---|---|
| 5 | givens + round 0 | 99.76 | 100.00 |
| 4 | round 1 | 99.59 | 99.99 |
| 3 | round 2 | 99.29 | 99.98 |
| 2 | round 3 | 98.73 | 99.92 |
| 1 | rounds 4-5 | 96.77 | 99.45 |
| 0 | round 6+ / never forced | 78.78 | 86.57 |
Each cell is assigned a level by the constraint-propagation round in which it becomes forced: level 5 cells are givens or forced immediately (round 0), while level 0 cells are forced only after 6+ rounds or never, and so require search. We see that HMDLM improves the accuracy for the most difficult cells (label 0) by up to 8% than MDLM.
G QUALITATIVE ANALYSIS ON WIKIHOW
In this section we look at the generative quality of samples from HMDLM, MDLM, and ADLM models.
G.1 PROMPT: HOW TO REPLACE THE REAR SHOCK ON AN 1150RT
MDLM Find the parts that you need to build in order not to replace the rear shock. diagnose the problem. assemble your latest model. that will take you to points where you want to attach ground cable. shop older models with an antenna kit — the replacement might come with 80mm screw for a zoom lens. when you find your pictures of the 110054ares, youll see an obvious slot on the shelf. disconnect the screws. you may disconnect them above the antenna mast if you connect the kit on the antenna that acts as the zoom lens. tighten up the screws. the wiring actually begins. enjoy wiring it. also make sure that the carbon fiber shaft meets the rest of the parts. that then download the latest version of the wireless and chargers. so by now, you will complete your replacement order. youll need to separate the stand like the new shock like your christmas boots from the cables that you use to replace your rear and front shocks. on model ebola suggest that the connection and the handle on disengage. then you should isolate the wires from a stainless steel. set up your stepper mount separately. it identifies the wattage and this one turns on the wire. you will need wiring
ADLM Remove the clutch and cut the 17 braided cable from valvages up to about 12th inch into the driver shock. insert the valve valve in a branch of the comparison valve about 1 mm in the bottom lip. insert in the valve valve with a minimal cussist pressure about 5,000remp. push your gently next to a pump station, four thumbs up and the lever about two inches down. insert one of the bearings into the hard valve, which usually fits into the internal part. along with pulling on a slow wheel, the vr should be left into the quick valve. insert a pin, but novel adjustment is an option in the bottom lip. make sure it stills your heel while pushing the valve, as found in normal mode. insert in two screws into the vr and tighten the jl band. begin twisting the traction steel - socket into the rac socket, lid of the driver or shock. push through the valve flex and, using a cork, or cauterized rubber band, remove the slide from the inside., the traction valve cuts the force of the cussist when the valve is closed.
HMDLM Check the components you need to help you replace the rear shock. unscrew the rear bolt to the rear. put the shocks on the ground. remove the shock bolt you have. now you can replace the front shocks. remove the rear bolt with the nut that the rear shock bolt is attached to. with the wheel on the back on the open side, pull. you should pull this with the nut that the front bolt is near it. you should do this in the direction on the rear bolt shown with the bolt. when you do this, you should notice how the pressure is applied. when you do this, you should find that the rear bolt, shock bolt are in place. after this, find that the rear bolt is in place with the front shock bolt. do this a couple of times until you can the find the replacement parts.
Conclusion: Among the three samples, HMDLM produces the most faithful response: it stays on the task of replacing a rear shock throughout and refers to relevant components such as shocks, bolts and nuts, although its step order is repetitive and somewhat confused. ADLM maintains a mechanical register but is largely incoherent, with invented terms (e.g., “valvages”, “cussist”) and physically implausible instructions. MDLM drifts off topic almost immediately, moving to antenna kits, zoom lenses and wiring, and never addresses the shock replacement. Overall, HMDLM shows the strongest prompt adherence and topical consistency, ADLM is second, and MDLM is the weakest.
G.2 PROMPT: HOW TO BUY A CUSTOM FIT CAR COVER
MDLM Find a vanity cover if there are none on your list. celebrate who is going to drive. buy the car cover you need. get it framed. label the cover. make sure that it isn't just a side cover but if you still have one, get a frame and create some polo paint. coat your cover with black to make it, drywall post paper or more ply window covers for material covers. get a cheap cover. these will be cheaper than your usual store window cover. since you're planning to sell the car you're going to build you either choose a cover with floor windows. if you do not intend to build it as is, be sure to buy an inexpensive cover. car cover can't go over the years, unless you have a plan to make your best you'll always need to make up new windows going forward. tips are useful, so select a cover and not a framing cover as will help sell the idea that it works for that purpose. accessories on the cover cover will free up cover wastage, if you can't find the little scratches in the car you need to wipe them out before you've made your final cover.
ADLM, first, make sure the you have the nail links. go down the edge. look at the details on top. put detail here and think some thoughts on if your arms fit correctly. look toward cushion areas where you would like you get a good fit like the pieces under the jeep under the convenience button. frames is fine, but less than works. where you find where you think you are more fit, good. look over the shoulders. the rest of the seats unless you get at the side of the neck try some chair. find the front cover and try the front wheel. put a few inserts near the peephole. add some glosses or any more products in the top section. look over the interior of the cover, slip or pop the back. are you wearing a high top, or just would like to see the final mix out dress options couch pants did just get too tight for the shoulders are you fit do you want the skin soft or tight attention to face, hair, etc. are you sure of movement a little caution.
HMDLM Look at the records of most retailers. locate the cover that fits the vehicle you're looking to buy. look for car covers online. locate the stores you can find your custom fit car covers at. look for different types of car covers from depending on what you're buying or looking for specific vehicles. visit a local shop and call and ask them if they will get what you are looking for. pay for or buy custom covers. some stores may keep car bins or keep a box of cars that will fit the type of cover that you can get from the shop. if you want medium - sized vehicles to be as large as you want, you can be able to buy it. however, it is usually not much more than what you want. look for a car type store or a retailer that tailor a car cover to you for a cheaper price.
Conclusion HMDLM produces the most relevant response: it stays focused on buying a custom-fit car cover and follows a sensible sequence of steps (checking retailers, searching online, contacting local shops and comparing prices), although a few sentences are garbled (e.g., keep a box of cars). MDLM repeatedly mentions car covers but quickly drifts into unrelated and contradictory instructions such as framing the cover, applying "polo paint" and adding windows. ADLM departs furthest from the prompt, shifting from car covers to garment fitting (shoulders, pants, dress options) with largely incoherent instructions. Overall, HMDLM shows the strongest prompt adherence and coherence, followed by MDLM, with ADLM the weakest.
H PROMPT FOR LLM-AS-JUDGE
H.1 LM1B PROMPT
For evaluating the LM1B generated samples under LLM-as-judge, we pass the following prompt:
""You are an expert evaluator judging two pieces of machine-generated English text. Your task is to determine which text is BETTER in overall quality. You must choose exactly ONE of:
A - Sample A is better
B - Sample B is better
tie - The two samples are approximately equal in quality
There is NO prompt or instruction the text is responding to; these are standalone generated passages. Evaluate each text holistically, considering:
-
Fluency: Is the text grammatical and natural English?
-
Coherence: Do the sentences follow each other in a logical, connected way?
-
Consistency: Does the text stay on a consistent topic without contradictions or abrupt, incoherent drift?
-
Overall readability: Does the passage read like plausible, well-formed human-written text?
SCORING RULES:
-
Judge ONLY the two texts.
-
Do NOT assume that either sample is better because it is longer.
-
Do NOT penalize a response merely for being brief or terse.
-
Judge each text independently on its own quality.
-
Do NOT use any information about the source/model that generated the text.
-
The labels A and B are randomly assigned and have no meaning.
-
Choose tie only when the two texts are genuinely comparable in overall quality.
Return ONLY valid JSON: "winner": "A" | "B" | "tie" ""
H.2 WIKIHOW PROMPT
On similar lines, for running the LLM-as-judge on WikiHow dataset we use the following prompt:
""You are an expert evaluator judging four responses to the same how-to prompt.
Your task is to determine which ONE response is the BEST for the given prompt.
You must choose exactly ONE of: A, B, C, D.
Evaluate the responses holistically, considering:
-
Adherence: Does the response address the specific topic in the prompt, or does it drift?
-
Coherence: Do the steps follow a logical, connected order?
-
Fluency: Is the response grammatical and natural English?
-
Overall usefulness: Would the response plausibly help someone accomplish what the prompt asks?
SCORING RULES:
- Judge ONLY the prompt and the four responses. 2. Do NOT assume that a sample is better because it is longer. 3. Do NOT penalize a response merely for being brief or terse if it adequately answers the prompt. 4. Judge each response independently against the prompt. 5. Do NOT compare based on writing style alone; prioritize usefulness and correctness for the prompt. 6. Do NOT use any information about the source/model that generated the responses. 7. The labels A, B, C and D are randomly assigned and have no meaning. 8. If several responses are close, still pick the single best one.
Return ONLY valid JSON:
"winner": "A" | "B" | "C" | "D" ""
I SOCIETAL IMPACT OF THE MODEL
The proposed HMDLM advances masked diffusion language modeling by introducing hierarchical decoding, which improves reasoning and text generation quality. The positive societal impacts include more efficient and accurate language models that can benefit downstream NLP applications such as question answering, text generation, and reasoning tasks. On the negative side, as with all pre-trained language models, HMDLM could potentially be misused to generate misleading or harmful text.
J COMPUTATIONAL RESOURCES
For language modelling, all experiments were conducted on NVIDIA A100 80GB GPUs. The HMDLM model was trained for approximately four days on 8 GPUs with a batch size of 512, completing 2.5M (65B tokens) training steps on LM1B dataset.
For WikiHow, All experiments were conducted on NVIDIA A100 80GB GPUs. The HMDLM model was trained for approximately 8 hours on 4 GPUs.
For Sudoku, again we used the same machine and trained on 4GPUs for 4 hours.