arXiv:2610.25949cs.AIOct 2026

Manuscript Offprint

arXiv:2610.25949

OrderGPT: Generation Order as a Learnable Modeling Choice

Chenhe Yang, Yuhuan Lyu, Tianyang Hu

Chenhe Yang 1^{1}, Yuhuan Lyu 1^{1} and Tianyang Hu ∗1^{*1}

1^{1}SAGA Lab, The Chinese University of Hong Kong, Shenzhen

Generative modeling of discrete data has two popular paradigms: autoregressive models such as GPT, which factorize a sequence in a left-to-right (L2R) order, and masked diffusion models, which are essentially any-order autoregressive modeling. Rather than competing methods, these are the two extreme points of a single axis—the generation order. For structured discrete domains without a natural traversal, both extremes may be suboptimal, yet the intermediate choice—a single well-adapted order—remains largely unexplored. We introduce OrderGPT, which builds on Any-Order GPT to learn a task-level generation order without canonical-order supervision. Our key observation is that predicting variables from randomly sampled reveal prefixes produces recurring attention patterns in the backbone that provide a model-dependent signal of predictive dependencies. We aggregate this signal into a reciprocal dependency graph and use a spectral teacher to derive continuous generation priorities. A lightweight OrderMLP integrated into the GPT backbone learns to predict these priorities from attention, incorporating order learning into the architecture within a single training run. Training gradually shifts toward the learned order, which is then frozen for subsequent autoregressive training and generation. The same mechanism adapts across modalities: adaptively it recovers near-L2R dependency structure in language, learns anatomically organized factorizations on human pose, and discovers a factorization on tabular data that places statistically and semantically related fields nearby, while improving downstream modeling metrics across all domains. The code is available at GitHub.

1. Introduction

Autoregressive generative models represent a joint distribution as a sequence of conditional prediction problems. This formulation underlies modern language models and has also been applied to visual tokens (Esser et al., 2021), human poses (Lucas et al., 2022), tabular data (Yang et al., 2019), graphs (You et al., 2018), and other structured domains (Uria et al., 2016). Although the chain rule permits the variables (or tokens) to be generated in any order, the choice of order matters for finite models: it determines the context available at each step, the difficulty of the conditional predictions, and the path along which errors propagate during generation (Bengio et al., 2015). Generation order is therefore an important modeling choice rather than merely an implementation detail.

Current methods largely occupy two endpoints of this design space. Conventional autoregressive models, such as GPT (Radford et al., 2019; Brown et al., 2020), commit to a single prescribed factorization, typically the L2R order for language. When this order matches the structure of the data, it provides a strong inductive bias and allows the model to concentrate its capacity on a stable family of prediction problems. Masked diffusion models (MDMs) take the opposite approach (Lou et al., 2023; Shi et al., 2024; Sahoo et al., 2024; Nie et al., 2026; Xie et al., 2026) by reconstructing masked variables from arbitrary observed subsets without specifying a canonical traversal. Their objective can be interpreted as any-order autoregressive training that averages over randomly sampled reveal

*Corresponding author: hutianyang@cuhk.edu.cn

Figure

Figure 1 | OrderGPT augments the AO-GPT backbone with an Order MLP. The Spectral Teacher constructs a reciprocal affinity graph from aggregated AO-GPT attention, recovers a Fiedler axis, and orients it using directed attention. The resulting continuous priorities supervise the Order MLP, whose outputs are sorted to obtain the task-level generation order used by the backbone.

permutations (Ou et al., 2025; Xue et al., 2025). This flexibility is useful when no natural order exists, but it spreads a finite model's capacity across many factorizations of potentially unequal difficulty without identifying a stable order for training and generation.

GPTs and MDMs can be viewed as two extremes along a common axis; both may be suboptimal for structured domains without a natural one-dimensional traversal. This motivates an intermediate alternative: learn a single task-level generation order and then use it in autoregressive factorization. Learning such an order is nontrivial: the search space is factorial, canonical-order supervision is generally unavailable, and the most useful factorization may evolve with the model.

The decoder-only GPT architecture provides a natural backbone for this goal. Its computational architecture and its conventional L2R factorization are conceptually separable: the same decoder can support different generation orders while retaining the GPT training and generation framework. AO-GPT (Xue et al., 2025) makes this flexibility explicit by supporting arbitrary reveal orders within a decoder-only Transformer. It therefore provides both the architectural foundation for learning a generation order and an opportunity to observe predictive relationships across different reveal contexts. Building on this backbone, we introduce OrderGPT, which incorporates a lightweight OrderMLP into AO-GPT to learn a task-level generation order without canonical-order supervision. Figure 1 summarizes the OrderGPT pipeline.

Our key observation is that predicting the same variable from different randomly sampled prefixes produces recurring attention patterns that provide model-dependent evidence of predictive relationships. We aggregate these patterns to construct a reciprocal dependency graph. Our Spectral Teacher recovers a continuous axis from the graph Laplacian, placing strongly related variables nearby, then uses directed attention to orient it, favoring attended context before its prediction targets. The resulting continuous generation priorities supervise OrderMLP, which learns to predict them from aggregated attention across successive windows, consolidating recurring dependency evidence. Sorting its predictions yields a task-level order that gradually replaces random orders during backbone training. The final order is frozen for subsequent autoregressive training and generation. OrderGPT thus integrates order learning into the GPT architecture within a single training run.

We evaluate OrderGPT across three domains with different structural properties. In language, it learns an order close to L2R without L2R supervision and lowers perplexity relative to matched any-order baselines. On H3WB human-pose generation (Zhu et al., 2023), where no unique one-dimensional traversal exists, it learns anatomically coherent factorizations and improves density fitting and free-running generation. On the CENSUS tabular dataset (Meek et al., 2001), it places related fields nearby, improves density estimation, and reduces tail cardinality-estimation errors.

References (30)