Autoregressive Models Rival Diffusion Models at ANY-ORDER Generation

Tianqi Du, Lizhe Fang, Weijie Yang, Chenheng Zhang, Zeming Wei, Yifei Wang, Yisen Wang

TL;DR

Researchers have developed Any-order Any-subset Autoregressive modeling (A3), a framework that gives standard autoregressive (AR) models the "any-order" flexibility of diffusion models. By reformulating sequence generation into a structured multi-group prediction process, A3 maintains the deep dependency modeling of AR while enabling parallel generation, infilling, and bidirectional conditioning.

The Problem: Rigidity vs. Shallow Dependencies

For years, the NLP world has been split between two generative paradigms:

  1. Autoregressive (AR) Models: The gold standard for text generation (e.g., GPT-4, Llama). They predict tokens one-by-one from left to right. While excellent at capturing deep, hierarchical dependencies, they are inherently "rigid." They cannot easily perform tasks like infilling (filling in the middle of a text) or global rewriting without specialized workarounds.
  2. Diffusion Models (MDLMs): Highly flexible models that can generate text in any order and "denoise" a whole sequence at once. However, they often suffer from "shallow dependencies." In a single step, they predict a subset of tokens based on context but fail to model how those predicted tokens depend on each other recursively. This often leads to lower sample quality compared to AR models.

The authors of this paper ask a pivotal question: Can we achieve the flexibility of diffusion with the mathematical rigor and depth of AR?

Methods: The A3 Framework

The authors propose A3, which generalizes the standard AR factorization. Instead of predicting token $n$ based strictly on tokens $1$ to $n-1$, A3 partitions a sequence into $K$ disjoint groups ($G_1, G_2, \dots, G_K$) and predicts them in an arbitrary order.

To make this work technically without breaking the model's causal logic, they introduce two key components:

1. Two-Stream Attention

Borrowing an idea from XLNet, the model maintains two parallel representations for every position.

  • The Content Stream encodes "what" is in the observed tokens (contextual grounding).
  • The Query Stream encodes "where" to predict (positional conditioning).

This dual-stream approach allows the model to predict a token at any position without "cheating" by seeing the token's own value in the input.

Two-Stream Attention architecture in A3 showing Content and Query streams.

2. Progressive Adaptation

You cannot simply force a standard AR model to jump into any-order prediction. The authors use a three-stage training recipe to smoothly transition the model:

  1. Stage 1: AR Initialization: Start with a pretrained left-to-right model (like Llama).
  2. Stage 2: Group Expansion: Teach the model to predict small chunks (groups) of tokens instead of just one at a time.
  3. Stage 3: Order Permutation: Finally, train the model to predict these groups in random, shuffled orders.
The three stages of progressive adaptation: AR Initialization, Group Expansion, and Order Permutation.

Key Insights and Capabilities

  • Groups are the Bridge: By treating tokens as groups rather than individuals, A3 can vary the "granularity" of generation. For speed, you use large groups (parallelism); for quality, you use smaller groups (recursive depth).
  • Probabilistic Rigor: Unlike diffusion models that rely on complex noise schedules, A3 remains a likelihood-based model. This makes training more stable and allows it to use standard cross-entropy loss.
  • Dynamic Resampling: A3 supports "confidence-based" decoding. The model can evaluate all ungenerated positions, identify which ones it is most "sure" about (highest softmax probability), and commit to those first—mimicking how humans fill in the easy parts of a sentence before tackling the hard parts.

Datasets and Results

The models were trained on a mixture of the FineWeb and SlimPajama datasets (roughly 8 billion tokens) and evaluated across Question Answering (TriviaQA), Commonsense Reasoning (HellaSwag, Winogrande, etc.), Story Infilling (ROCStories), and Long Context tasks (LongBench v1).

Key Findings: * Outperforming Diffusion: A3-8B consistently beat state-of-the-art diffusion models like DiffuLlama and Dream across QA and reasoning tasks. On TriviaQA, A3-8B achieved 19.4% accuracy compared to DiffuLlama’s 18.5%, despite being trained on significantly less data. * Scaling Behavior: Performance improves steadily as the model size increases from 1B to 8B parameters, suggesting A3 benefits from standard LLM scaling laws. * Efficiency: Using groupwise sampling, A3 achieves significant speedups. In long-context QA tasks, A3 with a group size of 2 was 30% faster than the AR baseline while maintaining competitive accuracy. * Infilling: A3 proved highly capable at infilling tasks, outperforming or matching specialized diffusion models on ROCStories.

Limitations and Future Work

While A3 beats diffusion models, it still lags behind pure, left-to-right AR models (like the base Llama-3.1) in raw perplexity. The authors attribute this "AR Gap" to the much smaller training budget used for this research (8B tokens vs. the trillions used for Llama). Additionally, the multi-stage progressive training is inherently more complex than simple next-token prediction.

Future work will focus on scaling A3 to larger datasets and exploring its potential in extremely long-context reasoning, where the ability to "look ahead" or "fill in" could provide a significant edge over linear models.

Summary updated

BibTeX
@inproceedings{du2026autoregressive,
  author = {Tianqi Du and Lizhe Fang and Weijie Yang and Chenheng Zhang and Zeming Wei and Yifei Wang and Yisen Wang},
  title = {{Autoregressive Models Rival Diffusion Models at ANY-ORDER Generation}},
  booktitle = {International Conference on Learning Representations},
  year = {2026},
  url = {https://openreview.net/forum?id=vtDUomlazQ},
}
Figure