解锁预训练自回归图像模型中的任意顺序生成
研究论文 · 2026/10/31
自回归图像生成器训练时采用固定的光栅扫描顺序,导致推理时无法进行图像修复、外推或编辑。现有解决方案(如离散扩散)需要从头训练并混合多种顺序,计算成本约为标准训练的3倍,且牺牲了与自回归推理生态(如KV缓存、vLLM)的兼容性。本文提出一种方法,将预训练的光栅扫描自回归模型适配为任意顺序生成器,仅需两个组件:未来感知位置嵌入(以极小开销解决目标位置可识别性问题)和顺序课程(从预训练解到任意顺序最优解的稳定优化路径)。在四个基础模型(LlamaGen-L/XL、RAR-L/XL)上,该方法在ImageNet图像修复(FID 6.21 vs. 10.44)和外推任务上大幅优于MaskGIT,与MAR-L相当,类别条件FID增加1.2-1.9,额外计算成本仅为预训练的13-33%,且保持标准自回归推理栈不变。结果表明,图像修复、外推和编辑能力无需新增,可从现有自回归模型中解锁。
该研究以低成本将预训练自回归图像模型转化为灵活的任意顺序生成器,在修复和外推任务上显著优于现有方法,同时保持推理效率,为图像生成与编辑提供了实用且高效的解决方案。
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 3x 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.