arXiv:2610.39293cs.CVOct 2026

Manuscript Offprint

arXiv:2610.39293

Unlocking Any-Order Generation in Pretrained Autoregressive Image Models

Rishav Pramanik, Marco Pedersoli, Zhaozheng Yin

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Autoregressive (AR) image generators are powerful in principle but inflexible in practice: training with a fixed raster-scan order hardcodes a single factorization of the image distribution into the model, leaving it unable to inpaint, outpaint, or edit at inference time. Existing solutions, including the modern discrete-diffusion family, train from scratch on a mixture of token orderings, paying roughly 3× the compute of standard raster-scan training; discrete diffusion further sacrifices compatibility with the AR inference ecosystem (KV caching, vLLM) by construction. We argue that this cost is unnecessary. A pretrained raster-scan AR model has already learned the joint distribution over image tokens; what it lacks is not knowledge but the ability to express that knowledge through non-sequential conditional pathways. We propose a recipe for adapting pretrained raster-scan models into any-order generators using two components: future-aware positional embeddings that resolve a target-position identifiability problem at negligible overhead, and an ordering curriculum that traces a stable optimization path from the pretrained solution to a good any-order basin. Applied to four base models across two architectures and two scales (LlamaGen-L/XL, RAR-L/XL), the recipe substantially outperforms MaskGIT on ImageNet inpainting (FID 6.21 vs. 10.44) and outpainting, is competitive with MAR-L, trades a 1.2–1.9 increase in class-conditional FID for this flexibility, and costs 13–33% additional compute beyond pretraining, while leaving the standard AR inference stack untouched. Inpainting, outpainting, and editing, our results suggest, need not be added to autoregressive image models. They can be unlocked from the ones that exist. Code is available at https://github.com/Ordered-AR/unlockedadaptation.

1 Introduction

Autoregressive (AR) modeling has become a common paradigm for image generation [3, 1, 4, 5], inheriting the scalability and training stability [6, 7, 8, 9] that made it standard in language [10, 11, 12, 13]. By tokenizing images into discrete codes and predicting them sequentially [14, 1, 15, 16], AR models reach generation quality comparable to that of leading diffusion and bi-directional models, while sharing the architecture of their language counterparts. Standard AR image models, however, impose a fixed generation order, typically raster scan, proceeding left to right and top to bottom. This ordering is convenient, but it hardcodes a single factorization of the image distribution into the model, leaving it unable to condition on non-contiguous context at inference time.

Any-order generation removes this restriction. Rather than committing to a single token ordering, an any-order AR model predicts any subset of image tokens conditioned on any other subset. This unlocks a range of capabilities from a single model: by treating observed tokens as context and sampling the remainder, the same weights perform inpainting, outpainting, and region-conditioned

40th Conference on Neural Information Processing Systems (NeurIPS 2026).

Figure

Figure 1: A single autoregressive image model, adapted from a pretrained raster-scan generator, performs inpainting (left), region-conditioned editing (center), and outpainting (right) without task-specific training, sampler modification, or auxiliary networks. The “Pretrained (raster)” column shows the same LlamaGen-L [1] model from which our model is adapted, prompted to perform the same tasks under the natural raster-scan generation procedure. Failure modes in this column reflect the structural incapacity of fixed-order AR models to condition on non-contiguous context, not weak performance at a shared task. After adaptation (“Ours”), the same weights produce coherent results across all three capabilities, varying only in which tokens are observed at inference time. Quantitative comparisons against MaskGIT [2] on inpainting and outpainting are reported in Section 4.

editing without inference-time modification, and admit parallel decoding strategies that predict multiple unobserved tokens jointly rather than strictly one at a time [17, 18]. Diffusion models support analogous tasks, but only through specialized samplers [19, 20] or auxiliary conditioning networks [21, 22] layered onto a fixed generation process. Any-order AR offers them as zero-shot capabilities of the native generation procedure: one model, one set of weights, one decoding loop.

The obstacle is cost of training. Existing approaches to any-order image generation train from scratch on a mixture of token orderings, a joint optimization that takes roughly 3× the compute of raster-scan training (e.g., RandAR [18] requires 300 epochs vs. 100 for the corresponding raster-scan LlamaGen-XL [1]). The most common modern approach is discrete diffusion [2, 23, 24], which re-frames any-order generation as iterative mask-token denoising under a non-causal transformer. Discrete diffusion reaches competitive quality, but its bidirectional attention and iterative-refinement decoding place it outside the standard AR inference ecosystem: KV caching, speculative decoding, and AR-oriented serving frameworks such as vLLM [25] do not accelerate it. The result is not just a training cost gap but a recurring inference gap: practitioners with existing AR pretraining pipelines and AR serving infrastructure cannot adopt these methods without parallel investment in a separate stack.

We argue that this cost reflects a conceptual conflation rather than a fundamental requirement. Any-order AR models need not be trained from scratch; they can be adapted from existing pretrained raster-scan models. A raster-scan AR model has already done the expensive work: it has learned an approximation of the joint distribution over image tokens, encoding texture statistics, spatial coherence, and semantic structure into its representations. The chain rule of probability guarantees that the true joint p(x1,…,xn)p(x_1, \ldots, x_n) factorizes equivalently under any token ordering, so a model that is a good fit under one factorization is a candidate fit under all of them. We hypothesize that the representations learned under raster-scan training are sufficiently order-agnostic to support any-order generation with light adaptation, because they encode properties of images rather than properties of scan lines. What the model lacks is not distributional knowledge but the ability to express that knowledge through non-sequential conditional pathways, and acquiring that ability, starting from a good initialization, need not be expensive.

To test this hypothesis, we propose a recipe for adapting a pretrained raster-scan AR model into an any-order generator. Two components are jointly necessary. First, we introduce future-aware positional embeddings that inject the identity of the next target position into each step of the generation sequence. This addresses an identifiability problem inherent to causal any-order generation: without target-position information, identical context must produce different outputs for different targets, generating conflicting gradient signals that prevent convergence. Our embeddings address this at negligible overhead, preserving the standard single-stream transformer architecture and the inference-time properties it confers. Second, we employ an ordering curriculum that gradually interpolates from raster-scan to fully random permutations over the course of adaptation. Without it, sudden exposure to random orderings produces large, high-variance gradients that move the model out of the pretrained basin before order-flexible routing has developed, eroding the representations we aim to reuse. The curriculum traces a stable optimization path from the pretrained solution to a good any-order basin. Both components are necessary: ablating either causes training to diverge or generation quality to drop noticeably (Section 4).

The resulting model reaches any-order generation at roughly 2.4× lower end-to-end cost than training from scratch, requiring only 25% additional computation beyond the original raster-scan pretraining budget on LlamaGen-XL (13–33% across base models); for practitioners who already have a pretrained AR model, the marginal adaptation cost is over an order of magnitude lower (12×) than training any-order from scratch. On LlamaGen-XL, FID moves from 2.63 to 3.91 while Inception Score, Precision, and Recall remain close to the pretrained values (252.94, 0.81, 0.53), a measured quality-flexibility trade-off rather than a lossless conversion. We observe a similar pattern across LlamaGen-L and RAR-L/XL (Section 4). The adapted model also gains the any-order capabilities promised by the construction (inpainting, outpainting, and region-conditioned editing), where it substantially outperforms MaskGIT [2] on ImageNet inpainting (FID 6.21 vs. 10.44) and outpainting (FID 5.84 vs. 12.17) and is competitive with MAR [3], despite never having been trained on either task (Section 4). Because the recipe leaves the causal transformer architecture untouched, the adapted model retains KV caching and parallel decoding and can be served with vLLM [25] through a custom model registration, whereas discrete-diffusion any-order approaches cannot reuse the KV cache, by construction. Flexible image generation (inpainting, outpainting, editing) need not be added to autoregressive models. It is, in our results, already accessible from the ones that exist.

References (42)