Any-Order GPT as Masked Diffusion Model: Decoupling Formulation and Architecture

Shuchen Xue, Tianyu Xie, Tianyang Hu, Zijin Feng, Jiacheng Sun, Kenji Kawaguchi, Zhenguo Li, Zhi-Ming Ma

International Conference on Machine Learning 2026 · Oral

Overview

When researchers compare autoregressive models with masked diffusion models, they typically pit a decoder-only autoregressive architecture with causal attention against an encoder-only masked diffusion model with full attention. This introduces a confounding experimental variable: it simultaneously alters the training formulation and the underlying neural architecture. In this talk, Shuchen Xue presents AO-GPT, a decoder-only any-order model designed to decouple these two dimensions. By implementing a masked diffusion training objective inside a causal decoder architecture, the authors isolate the algorithmic formulation from architectural mechanics.

Watch on SlidesLive

Visual summary for Any-Order GPT as Masked Diffusion Model: Decoupling Formulation and Architecture by Shuchen Xue, Tianyu Xie, Tianyang Hu, Zijin Feng, Jiacheng Sun, Kenji Kawaguchi, Zhenguo Li, Zhi-Ming Ma
Visual summary for Any-Order GPT as Masked Diffusion Model: Decoupling Formulation and Architecture by Shuchen Xue, Tianyu Xie, Tianyang Hu, Zijin Feng, Jiacheng Sun, Kenji Kawaguchi, Zhenguo Li, Zhi-Ming Ma

Key moments

  1. 0:00 Introduction and motivation for decoupling formulation and architecture
  2. 2:00 Training a causal masked diffusion model and architecture changes
  3. 4:00 Experimental settings and comparing autoregressive versus masked diffusion models
  4. 6:00 Left-to-right bias in language and mixed-order training strategy
  5. 7:30 Theoretical differences between encoder and decoder model conditionals
  6. 8:30 Context order ensembling and generation complexity throughput results
  7. 10:00 Q&A session on scaling observations to larger model sizes

Any-Order GPT as Masked Diffusion Model: Decoupling Formulation and Architecture

Speakers: Shuchen Xue; Tianyu Xie; Tianyang Hu; Zijin Feng; Jiacheng Sun; Kenji Kawaguchi; Zhenguo Li; Zhi-Ming Ma

Conference: ICML

YouTube: https://slideslive.com/39083613

Overview

When researchers compare autoregressive models with masked diffusion models, they typically pit a decoder-only autoregressive architecture with causal attention against an encoder-only masked diffusion model with full attention. This introduces a confounding experimental variable: it simultaneously alters the training formulation and the underlying neural architecture. In this talk, Shuchen Xue presents AO-GPT, a decoder-only any-order model designed to decouple these two dimensions. By implementing a masked diffusion training objective inside a causal decoder architecture, the authors isolate the algorithmic formulation from architectural mechanics.

The findings challenge conventional assumptions about sequence modeling in machine learning. The authors demonstrate that masked diffusion training objectives are mathematically equivalent to training any-order autoregressive models over uniformly selected permutations. However, enforcing uniform order distributions clashes with the inherent left-to-right structure of natural language. By systematically isolating parameter sharing, conditional probability spaces, and attention mechanisms, the work provides a rigorous framework for unifying autoregressive and diffusion paradigms within a single decoder-only stack.

This research matters for systems engineers and model builders operating at the intersection of generative modeling and inference optimization. While encoder-only masked diffusion models suffer from high generation overhead and combinatorial search spaces, decoder-only implementations can leverage KV caching to unlock dramatic throughput improvements. By identifying why random-order training lags behind standard left-to-right schedules—and how a simple 10% data mixture fixes it—this talk offers actionable insights for improving training efficiency and inference performance in next-generation language models.

Background

▶ Watch: Introduction and motivation for decoupling formulation and architecture (0:00)

The landscape of generative language modeling has long been bifurcated. Standard autoregressive models, such as GPT, generate text sequentially using a fixed left-to-right causal masking strategy. This design is highly optimized for inference throughput via KV caching and achieves fast initial training convergence. Conversely, masked diffusion models, exemplified by recent works like SEDD (Semi-Autoregressive Diffusion Models), operate over discrete tokens using masked corruption and iterative denoising processes.

Historically, comparing these two paradigms meant comparing decoder-only causal architectures against encoder-only BERT-style architectures equipped with full bidirectional attention. This comparison conflated two distinct design choices:

  1. The Modeling Formulation: The objective function (causal next-token prediction versus any-order masked denoising).
  2. The Systems Architecture: The attention mechanism (causal lower-triangular attention versus bidirectional full attention).

Furthermore, efficiency metrics varied wildly across these configurations. During training, decoder-only autoregressive models achieve close to 100% token utilization. In contrast, standard encoder-only masked diffusion models utilize only 50% of tokens on average, while encoder-only BERT models drop to 15–25%.

To resolve this ambiguity, the authors sought to implement the masked diffusion objective directly inside a causal decoder architecture. Doing so requires bridging two distinct lines of prior work on any-order autoregressive training: XLNet, which incorporates target positions via two-stream attention, and SigmaGPT, which injects target position encodings directly into the input stream. By building upon SigmaGPT, which closely mirrors standard modern GPT architectures, the authors created a controlled testbed to evaluate formulation versus architecture independently.

Key Findings

▶ Watch: Experimental settings and comparing autoregressive versus masked diffusion mo... (4:00)

The investigation yields several surprising empirical and theoretical discoveries regarding training dynamics, language inductive biases, and conditional probability spaces:

  • Training Convergence Discrepancy: When trained on the exact same decoder-only architecture and dataset, AO-GPT (using uniform random orders) converges significantly slower in early training stages than a standard left-to-right GPT baseline.
  • The Left-to-Right Bias of Language: Isolating parameter-sharing effects by training models on single fixed permutations revealed that natural language possesses a profound left-to-right inductive bias. Standard left-to-right orders converge vastly faster than arbitrary fixed random permutations or block-wise random permutations.
  • The Power of Mixed-Order Training: Introducing a hybrid training schedule—retaining 90% uniform any-order data alongside 10% standard left-to-right data—drastically accelerates left-to-right convergence and improves the final validation loss across both metrics.
  • Conditional Probability Complexity: Encoder-only and decoder-only models learn fundamentally different conditional probability spaces due to attention symmetry. Decoder models must learn a combinatorially larger space ($\mathcal{O}(e \cdot n!)$) compared to encoder models ($\mathcal{O}(n \cdot 2^{n-1})$).
  • Throughput Advantage: Despite the larger combinatorial space, decoder-only masked diffusion models achieve a 25× throughput speedup over encoder-only masked diffusion baselines (SEDD) during generation, largely due to linear generation complexity enabled by KV caching.

Technical Deep Dive

▶ Watch: Left-to-right bias in language and mixed-order training strategy (6:00)

To execute the masked diffusion formulation inside a causal decoder, the authors leverage the mathematical equivalence showing that masked diffusion training objectives are equivalent to training any-order autoregressive models over uniformly selected orders. While standard GPT implicitly conditions on the immediately preceding position, shuffled any-order formulations require the model to explicitly receive the original position of the target token.

Building upon SigmaGPT, the authors introduce modifications to inject target position information into every transformer block. Instead of simple input addition, AO-GPT modulates LayerNorm via token-wise scale, shift, and gating mechanisms—acting identically to AdaLN (Adaptive LayerNorm) popularized in DiT (Diffusion Transformers). Additionally, the training pipeline maintains an exponential moving average (EMA) of model parameters following standard diffusion practices. Empirically, combining AdaLN and EMA yielded a consistent 0.2 improvement in loss over the baseline.

The architectural divergence between encoder-only and decoder-only masked diffusion models dictates their conditional probability spaces. Encoder models use full attention over an unordered set of context tokens, meaning permuting context orders yields identical probabilities (provided positional encodings are correct). Conversely, decoder models rely on asymmetric lower-triangular causal attention, making predictions strictly order-dependent.

To bridge this gap during evaluation, the authors introduce context order ensembling. By randomly permuting context tokens $m$ times and averaging the predicted probabilities, evaluation loss drops precipitously. As the ensemble size $m$ scales from 1 to 8 or 16, AO-GPT matches and occasionally exceeds the zero-shot perplexity of encoder-only counterparts like SEDD, proving that the performance gap stems from order-dependency rather than inherent capacity limits.

Experimental Setup & Results

▶ Watch: Context order ensembling and generation complexity throughput results (8:30)

The empirical evaluation is conducted using the NanoGPT repository framework, pre-training language models on the OpenWebText dataset. Model scales are held at GPT-2 Small and GPT-2 Medium configurations, operating at a maximum context length of 1024 tokens.

Zero-shot validation perplexity is evaluated across four standard text benchmark datasets: LAMBADA, WikiText, Penn Treebank (PTB), and Language Model 1B.

  • Baseline Comparison: Purely uniform any-order training (AO-GPT) lags behind standard autoregressive GPT in initial loss reduction.
  • Order Ablations: Testing fixed training orders demonstrated that standard left-to-right ordering converges fastest. A block-wise random order (using a block size of 4) smoothly interpolates between left-to-right and fully random convergence speeds.
  • The 90/10 Mixture Result: Mixing 90% uniform any-order data with 10% standard left-to-right data improved left-to-right validation loss by a wide margin while unexpectedly improving the any-order objective itself. This indicates that structured left-to-right data injects a vital inductive bias for learning grammatical and semantic structure.
  • Generation Throughput: Simulating generation workloads demonstrated that causal masked diffusion models achieve a 25× speedup in throughput compared to full-attention encoder baselines (SEDD), translating quadratic computational complexity into linear complexity via KV cache integration.

Practical Implications

▶ Watch: Q&A session on scaling observations to larger model sizes (10:00)

For infrastructure teams and model deployers, these findings establish that decoder-only architectures are superior deployment vehicles for masked diffusion objectives. While encoder-only diffusion models like SEDD offer strong theoretical properties for non-autoregressive generation, their quadratic generation scaling and lack of KV cache support severely limit production throughput. AO-GPT demonstrates that migrating diffusion objectives into causal decoders recovers production-grade inference speeds (up to 25× faster) while retaining flexible generation capabilities.

For model builders, the research provides a critical training recipe: pure uniform shuffling ignores human language's inherent left-to-right structure, harming sample efficiency. Injecting even a small fraction (e.g., 10%) of structured left-to-right data into any-order or diffusion pre-training acts as an essential inductive regularizer.

However, practitioners must weigh certain trade-offs. Decoder-only any-order models face combinatorially larger conditional probability spaces than encoder equivalents. While context order ensembling successfully closes the zero-shot perplexity gap, it incurs additional compute overhead during evaluation. Furthermore, while experiments scale effectively up to initial 1-billion parameter tests, scaling laws across ultra-large foundation models running mixed diffusion-autoregressive schedules remain an open engineering frontier.

Key Takeaways

  • Formulation vs. Architecture: Standard comparisons between autoregressive and masked diffusion models conflate formulation differences with attention mechanism differences; decoupling them reveals distinct operational trade-offs.
  • Language Biases Matter: Standard uniform masked diffusion training conflicts with the strong left-to-right inductive bias of natural language, causing slower initial convergence.
  • The 10% Solution: Pre-training on a mixture of 90% uniform any-order data and 10% standard left-to-right data dramatically improves both convergence speed and final loss.
  • Decoders Win on Speed: Causal decoder-only masked diffusion models achieve a 25× throughput speedup over encoder-only equivalents by exploiting linear generation complexity via KV caching.
  • Bridging the Gap: Context order ensembling resolves the performance deficit caused by the decoder's order-dependent conditional probability space, matching encoder-only perplexity benchmarks.

About the Speaker(s)

  • Shuchen Xue: Presented work on Any-Order GPT as Masked Diffusion Model, investigating differences between autoregressive and masked diffusion models in terms of formulation and architecture.

Co-authors: Tianyu Xie, Tianyang Hu, Zijin Feng, Jiacheng Sun, Kenji Kawaguchi, Zhenguo Li, Zhi-Ming Ma.

Reviews

→ Top-rated talks at International Conference on Machine Learning 2026

All talks from International Conference on Machine Learning 2026