Looped Diffusion Language Models

Sanghyun Lee, Chunsan Hong, Seungryong Kim, Jonghyun Lee, Jongho Park, Dongmin Park

TL;DR

LoopMDM introduces a novel architecture for Masked Diffusion Models (MDMs) that selectively loops a small set of early-middle transformer layers during a single denoising step. This simple architectural tweak matches the performance of standard MDMs with up to 3.3× fewer training FLOPs, boosts downstream reasoning accuracy (e.g., +8.5 points on GSM8K), and enables flexible inference-time compute scaling.

What Problem Does This Paper Address?

Masked Diffusion Models (MDMs) have recently emerged as a powerful, highly parallel alternative to traditional Autoregressive Models (ARMs) for text generation. However, while substantial effort has gone into optimizing MDM training objectives and noise schedules, the underlying transformer architectures remain largely copied from standard autoregressive setups.

In autoregressive literature, looped transformers—which repeatedly pass data through a shared block of layers—are a popular way to achieve parameter efficiency and scale test-time compute. But it hasn't been clear whether looping makes sense for MDMs. Because diffusion models already perform iterative computation across external denoising timesteps, adding an internal loop inside the transformer layer stack might seem redundant or overly expensive. This paper tackles how to effectively integrate looped architectures into MDMs to maximize compute efficiency during both training and inference.

Methods

The authors introduce LoopMDM (Looped Masked Diffusion Model). Instead of uniformly looping the entire network (which degrades performance under a fixed compute budget), LoopMDM uses a selective looping strategy.

The architecture divides the denoising transformer into three sequential blocks:

  1. Head ($n_h$ layers): Processes the input tokens once to form low-level representations.
  2. Mid-block ($n_m$ layers): A shared stack of layers that is executed sequentially $S$ times.
  3. Tail ($n_o$ layers): Processes the final hidden states once to project them back to token distributions.
Figure 1: Overview of LoopMDM. (Left) LoopMDM selectively applies looping to a small early- middle layers of the denoising network. (Middle) Under matched training compute, LoopMDM (red) reaches the same test NLL as a non-looped MDM baseline with the same architecture (dashed black) using substantially fewer training FLOPs. (Right) Increasing the inference-time loop count consistently improves GSM8K accuracy; the dashed line denotes the same non-looped MDM baseline.

To make the model robust to different loop counts at inference time, LoopMDM is trained using a stochastic loop count. During each training forward pass, the loop count $S$ is sampled uniformly from $\{1, \dots, S_{max}\}$.

At inference time, the compute can be scaled by simply increasing $S$. Furthermore, the authors introduce an adaptive inference strategy: the model monitors the relative change in hidden states between successive loops ($\|H^{(k)} - H^{(k-1)}\| / \|H^{(k)}\|$) and dynamically stops looping once the representations stabilize below a threshold $\epsilon$.

Datasets

The models were pre-trained and evaluated on several prominent language modeling and reasoning datasets:

  • Pre-training Corpora: FineWeb-Edu, OpenWebText (OWT), LM1B (One Billion Word), and TinyGSM (a synthetic corpus of 11.8M math problems paired with Python solutions).
  • Zero-Shot Perplexity Benchmarks: Penn Tree Bank (PTB), WikiText, Lambada, AG News, PubMed, and Arxiv.
  • Downstream Tasks: GSM8K (math reasoning), BoolQ, RACE, HellaSwag, PIQA, SIQA, WinoGrande, OpenBookQA, ARC-Easy, and ARC-Challenge.
  • Controlled Study: A custom 100k Sudoku dataset used to isolate the effects of within-step computation.

Key Insights and Ideas

  • The "Sweet Spot" for Looping: Looping is highly position-dependent. The authors found that looping early-middle layers (specifically layers 1-2 in a 12-layer model) yields the highest performance gains. Looping the entire network or layers too close to the input/output boundaries actually hurts performance. This suggests looping is most effective after basic token features are formed but before representations specialize for final token prediction.
  • Masked Positions as a Parallel Workspace: Why does looping help MDMs so much? In a controlled Sudoku experiment with a restricted left-to-right generation order, LoopMDM successfully solved globally constrained puzzles that shallow baselines failed to complete. Attention analysis revealed that increasing loop counts directly increases mask-to-mask attention. The masked tokens act as a latent "scratchpad," allowing the model to iteratively revise and resolve complex global constraints before committing to a token.
  • Timestep-Dependent Utility: Internal looping does not provide uniform benefits across the entire diffusion process. The gains from looping peak at intermediate noise levels (middle timesteps), where the model has enough context to work with but still faces many unresolved positions.

Key Results

  • Training Efficiency: Under matched training compute, LoopMDM reached the same test negative log-likelihood (NLL) as standard MDM baselines while requiring significantly fewer FLOPs: 3.34× fewer on LM1B, 2.95× fewer on OpenWebText, and 2.34× fewer on FineWeb-Edu.
Figure 2: Test NLL across language pre-training datasets. Test NLL as a function of training FLOPs on FineWeb-Edu, OpenWebText (OWT), and LM1B. All models are iso-parameter (170M) and trained under matched training FLOPs. Looping is applied to two mid-layers 1-2 in zero-based indexing. Solid curves show LoopMDM with varying inference-time loop counts (S = 1, 6, 12, 24), where S = 24 exceeds the maximum loop count used during training (Smax = 12); the dashed curve shows the MDM baseline. Performance improves consistently with increasing S.
  • Reasoning Gains: On the GSM8K math benchmark, LoopMDM outperformed its same-size baseline by up to +8.5 points. Crucially, it also beat deeper, non-looped MDMs engineered to match LoopMDM's per-step training FLOPs, proving that weight-reusing loops are fundamentally more effective than naive depth scaling for reasoning tasks.
Figure 3: GSM8K accuracy as a function of training FLOPs. 14 layers LoopMDM (solid) is compared against MDM baselines with 14, 18, and 21 layers (dashed); the 21-layer baseline is sized so that its per-step training FLOPs approximately match those of LoopMDM. Inference-time loop counts S ∈{1, 2, 4, 6, 8, 16} are shown, with S =16 exceeding the training maximum. Results are reported under both Top-2 (left) and Top-3 (right) unmasking rules.
  • Adaptive Inference Savings: Using the adaptive stopping rule ($\epsilon = 0.1$) cut the average inference loop count from $S=12$ down to roughly $5$ iterations, slashing compute by half while preserving almost all downstream accuracy and perplexity gains.

Limitations and Future Work

While LoopMDM shows impressive efficiency gains, the authors note a few limitations:

  1. Manual Configuration: The choice of which layers to loop and the adaptive stopping threshold ($\epsilon$) are currently set manually via heuristics rather than being learned dynamically.
  2. Model Scale: The experiments were primarily conducted on medium-scale models (125M to 170M parameters). Verifying how these looping dynamics scale to billion-parameter models remains an open avenue for future research.
  3. Mechanistic Understanding: A precise theoretical explanation for why early-middle layers are uniquely suited for looping remains an open problem.

Summary updated

BibTeX
@inproceedings{lee2026looped,
  author = {Sanghyun Lee and Chunsan Hong and Seungryong Kim and Jonghyun Lee and Jongho Park and Dongmin Park},
  title = {{Looped Diffusion Language Models}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=UqgMsw7AZH},
}
Figure