Visual Autoregressive Modeling: Scalable Image Generation via Next-Scale Prediction
Visual Autoregressive Modeling: Scalable Image Generation via Next-Scale Prediction
视觉自回归建模:通过下一尺度预测实现可扩展图像生成
Keyu Tian, Yi Jiang, Zehuan Yuan, Bingyue Peng, Liwei Wang † † thanks: Corresponding authors: wanglw@pku.edu.cn , yuanzehuan@bytedance.com ; : project lead Email: yuanzehuan@bytedance.com, bingyue.peng@bytedance.com, wanglw@pku.edu.cn Try and explore our online demo at:˜ https://var.vision Codes and models:˜ https://github.com/FoundationVision/VAR Affiliation: Peking University Affiliation: Bytedance Inc Email: keyutian@stu.pku.edu.cn Email: jiangyi.enjoy@bytedance.com
Abstract
摘要
We present Visual AutoRegressive modeling (VAR), a new generation paradigm that redefines the autoregressive learning on images as coarse-to-fine “next-scale prediction” or “next-resolution prediction”, diverging from the standard raster-scan “next-token prediction”. This simple, intuitive methodology allows autoregressive (AR) transformers to learn visual distributions fast and can generalize well: VAR, for the first time, makes GPT-style AR models surpass diffusion transformers in image generation. On ImageNet 256256 benchmark, VAR significantly improve AR baseline by improving Fréchet inception distance (FID) from 18.65 to 1.73, inception score (IS) from 80.4 to 350.2, with 20 faster inference speed. It is also empirically verified that VAR outperforms the Diffusion Transformer (DiT) in multiple dimensions including image quality, inference speed, data efficiency, and scalability. Scaling up VAR models exhibits clear power-law scaling laws similar to those observed in LLMs, with linear correlation coefficients near as solid evidence. VAR further showcases zero-shot generalization ability in downstream tasks including image in-painting, out-painting, and editing. These results suggest VAR has initially emulated the two important properties of LLMs: Scaling Laws and zero-shot generalization. We have released all models and codes to promote the exploration of AR/VAR models for visual generation and unified learning.
我们提出视觉自回归建模(Visual AutoRegressive modeling,VAR):把图像上的自回归学习改写成由粗到细的「下一尺度预测」或「下一分辨率预测」,而不再沿用光栅扫描式的「下一词元预测」。这一简明思路让自回归(AR)Transformer 能更快学会视觉分布,并具有良好泛化。VAR 首次使 GPT 风格的 AR 模型在图像生成上超过扩散 Transformer。在 ImageNet 256256 基准上,VAR 把 AR 基线的 Fréchet inception distance(FID)从 18.65 提到 1.73、inception score(IS)从 80.4 提到 350.2,推理速度约快 20 倍。经验上,VAR 在图像质量、推理速度、数据效率与可扩展性等多个维度也优于 Diffusion Transformer(DiT)。放大 VAR 模型可观察到与大语言模型类似的幂律缩放律,线性相关系数接近 。VAR 还在图像修补、外扩与编辑等下游任务上展现零样本泛化。这些结果说明 VAR 初步复现了 LLM 的两个重要性质:缩放律与零样本泛化。我们已开源全部模型与代码,以推动 AR/VAR 在视觉生成与统一学习上的探索。
图 1:在 ImageNet 上训练的视觉自回归(VAR)Transformer 生成样本。上行为 512512,中行为 256256,下行为零样本图像编辑结果。
Figure 2: Standard autoregressive modeling (AR) vs. our proposed visual autoregressive modeling (VAR). (a) AR applied to language: sequential text token generation from left to right, word by word; (b) AR applied to images: sequential visual token generation in a raster-scan order, from left to right, top to bottom; (c) VAR for images: multi-scale token maps are autoregressively generated from coarse to fine scales (lower to higher resolutions), with parallel token generation within each scale. VAR requires a multi-scale VQVAE to work.
图 2:标准自回归建模(AR)与本文视觉自回归建模(VAR)的对比。(a)AR 用于语言:自左向右、逐词生成文本词元;(b)AR 用于图像:按光栅扫描顺序、自左向右、自上而下逐个生成视觉词元;(c)VAR 用于图像:按由粗到细(由低到高分辨率)自回归生成多尺度词元图,每一尺度内并行生成词元。VAR 需要多尺度 VQVAE 配合工作。
1 Introduction
1 引言
The advent of GPT series [65, 66, 15, 62, 1] and more autoregressive (AR) large language models (LLMs) [22, 4, 38, 82, 83, 90, 78, 5, 79] has heralded a new epoch in the field of artificial intelligence. These models exhibit promising intelligence in generality and versatility that, despite issues like hallucinations [39], are still considered to take a solid step toward the general artificial intelligence (AGI). At the core of these models is a self-supervised learning strategy – predicting the next token in a sequence, a simple yet profound approach. Studies into the success of these large AR models have highlighted their scalability and generalizabilty: the former, as exemplified by scaling laws [43, 35], allows us to predict large model’s performance from smaller ones and thus guides better resource allocation, while the latter, as evidenced by zero-shot and few-shot learning [66, 15], underscores the unsupervised-trained models’ adaptability to diverse, unseen tasks. These properties reveal AR models’ potential in learning from vast unlabeled data, encapsulating the essence of “AGI”.
GPT 系列 [65, 66, 15, 62, 1] 以及更多自回归(AR)大语言模型(LLM) [22, 4, 38, 82, 83, 90, 78, 5, 79] 的出现,标志着人工智能进入新阶段。这些模型在通用性与多任务能力上展现出令人瞩目的智能;尽管仍有幻觉等问题 [39],仍被视为迈向通用人工智能(AGI)的坚实一步。其核心是一种自监督学习策略——在序列中预测下一个词元,简单却深刻。对这些大型 AR 模型成功的研究,突出了它们的可扩展性与泛化性:前者以缩放律 [43, 35] 为代表,使我们能用小模型表现预测大模型,从而更好分配资源;后者以零样本与少样本学习 [66, 15] 为证,强调无监督训练模型对多样、未见任务的适应力。这些性质揭示了 AR 模型从海量无标注数据中学习的潜力,也正触及「AGI」的要旨。
In parallel, the field of computer vision has been striving to develop large autoregressive or world models [58, 57, 6], aiming to emulate their impressive scalability and generalizability. Trailblazing efforts like VQGAN and DALL-E [30, 67] along with their successors [68, 92, 50, 99] have showcased the potential of AR models in image generation. These models utilize a visual tokenizer to discretize continuous images into grids of 2D tokens, which are then flattened to a 1D sequence for AR learning (Fig. 2 b), mirroring the process of sequential language modeling (Fig. 2 a). However, the scaling laws of these models remain underexplored, and more frustratingly, their performance significantly lags behind diffusion models [63, 3, 51], as shown in Fig. 3. In contrast to the remarkable achievements of LLMs, the power of autoregressive models in computer vision appears to be somewhat locked.
与此同时,计算机视觉领域也在努力发展大型自回归或世界模型 [58, 57, 6],以期复现其可扩展性与泛化性。VQGAN 与 DALL-E [30, 67] 及其后续工作 [68, 92, 50, 99] 展示了 AR 模型在图像生成上的潜力。它们用视觉分词器把连续图像离散成二维词元网格,再展平为一维序列做 AR 学习(图 2 b),类比语言建模中的顺序过程(图 2 a)。然而,这些模型的缩放律仍缺乏深入探讨;更令人沮丧的是,其性能明显落后于扩散模型 [63, 3, 51],如图 3 所示。相较 LLM 的巨大成就,自回归模型在计算机视觉中的潜力似乎仍被锁住。
图 3:不同模型族在 ImageNet 256256 生成基准上的缩放行为。验证集 FID 作为参考下界(1.78)。2B 参数的 VAR 达到 FID 1.73,超过 3B 或 7B 参数的 L-DiT。
Autoregressive modeling requires defining the order of data. Our work reconsiders how to “order” an image: Humans typically perceive or create images in a hierachical manner, first capturing the global structure and then local details. This multi-scale, coarse-to-fine nature suggests an “order” for images. Also inspired by the widespread multi-scale designs [54, 52, 81, 44], we define autoregressive learning for images as “next-scale prediction” in Fig. 2 (c), diverging from the conventional “next-token prediction” in Fig. 2 (b). Our approach begins by encoding an image into multi-scale token maps. The autoregressive process is then started from the 11 token map, and progressively expands in resolution: at each step, the transformer predicts the next higher-resolution token map conditioned on all previous ones. We refer to this methodology as Visual AutoRegressive (VAR) modeling.
自回归建模需要定义数据的顺序。我们重新思考如何给图像「排序」:人通常以层次方式感知或创作图像——先把握全局结构,再补局部细节。这种多尺度、由粗到细的特点提示了图像的一种「顺序」。亦受广泛多尺度设计 [54, 52, 81, 44] 启发,我们在图 2(c)中把图像自回归学习定义为「下一尺度预测」,而非图 2(b)中的常规「下一词元预测」。做法是先把图像编码成多尺度词元图;自回归从 11 词元图起步,分辨率逐步升高:每一步 Transformer 在全部已有词元图的条件下,预测下一张更高分辨率的词元图。我们称这一方法为视觉自回归(VAR)建模。
VAR directly leverages GPT-2-like transformer architecture [66] for visual autoregressive learning. On the ImageNet 256256 benchmark, VAR significantly improves its AR baseline, achieving a Fréchet inception distance (FID) of 1.73 and an inception score (IS) of 350.2, with inference speed 20 faster (see Sec. 7 for details). Notably, VAR surpasses the Diffusion Transformer (DiT) – the foundation of leading diffusion systems like Stable Diffusion 3.0 and SORA [29, 14] – in FID/IS, data efficiency, inference speed, and scalability. VAR models also exhibit scaling laws akin to those witnessed in LLMs. Lastly, we showcase VAR’s zero-shot generalization capabilities in tasks like image in-painting, out-painting, and editing. In summary, our contributions to the community include:
VAR 直接采用类 GPT-2 的 Transformer 架构 [66] 做视觉自回归学习。在 ImageNet 256256 基准上,VAR 相对其 AR 基线大幅提升,达到 FID 1.73、IS 350.2,推理速度约快 20 倍(详见第 7 节)。尤其是,VAR 在 FID/IS、数据效率、推理速度与可扩展性上超过 Diffusion Transformer(DiT)——后者是 Stable Diffusion 3.0 与 SORA [29, 14] 等领先扩散系统的基础。VAR 模型也呈现与 LLM 类似的缩放律。最后,我们展示了 VAR 在图像修补、外扩与编辑等任务上的零样本泛化。总结本文对社区的贡献如下:
- A new visual generative framework using a multi-scale autoregressive paradigm with next-scale prediction, offering new insights in autoregressive algorithm design for computer vision.
- An empirical validation of VAR models’ Scaling Laws and zero-shot generalization potential, which initially emulates the appealing properties of large language models (LLMs).
- A breakthrough in visual autoregressive model performance, making GPT-style autoregressive methods surpass strong diffusion models in image synthesis for the first time[^1].
- A comprehensive open-source code suite, including both VQ tokenizer and autoregressive model training pipelines, to help propel the advancement of visual autoregressive learning.
- 一套采用下一尺度预测的多尺度自回归视觉生成框架,为计算机视觉中的自回归算法设计提供新视角。
- 对 VAR 模型缩放律与零样本泛化潜力的经验验证,初步复现大语言模型(LLM)的诱人性质。
- 视觉自回归模型性能上的突破,使 GPT 风格自回归方法首次在图像合成上超过强扩散模型[^1]。
- 一套完整开源代码,涵盖 VQ 分词器与自回归模型训练管线,助力推进视觉自回归学习。
2 Related Work
2 相关工作
2.1 Properties of large autoregressive language models
2.1 大型自回归语言模型的性质
Scaling laws are found and studied in autoregressive language models [43, 35], which describe a power-law relationship between the scale of model (or dataset, computation, etc.) and the cross-entropy loss value on the test set. Scaling laws allow us to directly predict the performance of a larger model from smaller ones [1], thus guiding better resource allocation. More pleasingly, they show that the performance of LLMs can scale well with the growth of model, data, and computation and never saturate, which is considered a key factor in the success of [15, 82, 83, 98, 90, 38]. The success brought by scaling laws has inspired the vision community to explore more similar methods for multimodality understanding and generation [53, 2, 88, 27, 96, 77, 21, 23, 41, 31, 32, 80, 87].
缩放律 在自回归语言模型中被发现并研究 [43, 35],描述模型(或数据、算力等)规模与测试集交叉熵损失之间的幂律关系。缩放律使我们能由小模型直接预测更大模型的表现 [1],从而更好分配资源。更令人振奋的是,它们表明 LLM 的性能可随模型、数据与算力增长而良好扩展且不易饱和,这被视为 [15, 82, 83, 98, 90, 38] 成功的关键因素。缩放律带来的成功也激励视觉社区探索更多类似方法,用于多模态理解与生成 [53, 2, 88, 27, 96, 77, 21, 23, 41, 31, 32, 80, 87]。
Zero-shot generalization. Zero-shot generalization [72] refers to the ability of a model, particularly a Large Language Model, to perform tasks that it has not been explicitly trained on. Within the realm of the computer vision, there is a burgeoning interest in the zero-shot and in-context learning abilities of foundation models, CLIP [64], SAM [48], Dinov2 [61]. Innovations like Painter [89] and LVM [6] extend visual prompters [40, 11] to achieve in-context learning in vision.
零样本泛化。 零样本泛化 [72] 指模型——尤其是大语言模型——完成其未显式训练过的任务的能力。在计算机视觉领域,基础模型的零样本与上下文学习能力正受到广泛关注,如 CLIP [64]、SAM [48]、Dinov2 [61]。Painter [89] 与 LVM [6] 等创新把视觉提示器 [40, 11] 扩展到视觉中的上下文学习。
2.2 Visual generation
2.2 视觉生成
Raster-scan autoregressive models for visual generation necessitate the encoding of 2D images into 1D token sequences. Early endeavors [20, 84] have shown the ability to generate RGB (or grouped) pixels in the standard row-by-row, raster-scan manner. [69] extends [84] by using multiple independent trainable networks to do super-resolution repeatedly. VQGAN [30] advances [20, 84] by doing autoregressive learning in the latent space of VQVAE [85]. It employs GPT-2 decoder-only transformer to generate tokens in the raster-scan order, like how ViT [28] serializes 2D images into 1D patches. VQVAE-2 [68] and RQ-Transformer [50] also follow this raster-scan manner but use extra scales or stacked codes. Parti [93], based on the architecture of ViT-VQGAN [92], scales the transformer to 20B parameters and works well in text-to-image synthesis.
光栅扫描自回归模型 做视觉生成时,需要把二维图像编码为一维词元序列。早期工作 [20, 84] 已展示按标准逐行光栅扫描生成 RGB(或分组)像素的能力。[69] 在 [84] 基础上用多个独立可训网络反复做超分。VQGAN [30] 在 VQVAE [85] 潜空间做自回归学习,进一步推进 [20, 84]:它用 GPT-2 式仅解码器 Transformer,按光栅扫描顺序生成词元,类似 ViT [28] 把二维图像串成一维 patch。VQVAE-2 [68] 与 RQ-Transformer [50] 同样沿用光栅扫描,但引入额外尺度或堆叠码。Parti [93] 基于 ViT-VQGAN [92] 架构,把 Transformer 扩到 20B 参数,在文生图合成上表现良好。
Masked-prediction model. MaskGIT [17] employs a VQ autoencoder and a masked prediction transformer similar to BERT [25, 10, 34] to generate VQ tokens through a greedy algorithm. MagViT [94] adapts this approach to videos, and MagViT-2 [95] enhances [17, 94] by introducing an improved VQVAE for both images and videos. MUSE [16] further scales MaskGIT to 3B parameters.
掩码预测模型。 MaskGIT [17] 采用 VQ 自编码器与类似 BERT [25, 10, 34] 的掩码预测 Transformer,用贪心算法生成 VQ 词元。MagViT [94] 将该思路扩展到视频;MagViT-2 [95] 通过改进的 VQVAE 增强 [17, 94],同时覆盖图像与视频。MUSE [16] 进一步把 MaskGIT 扩到 3B 参数。
Diffusion models ’ progress has centered around improved learning or sampling [76, 75, 55, 56, 7], guidance [37, 60], latent learning [70], and architectures [36, 63, 71, 91]. DiT and U-ViT [63, 8] replaces or integrates the U-Net with transformer, and inspires recent image [19, 18] or video synthesis systems [12, 33] including Stable Diffusion 3.0 [29], SORA [14], and Vidu [9].
扩散模型 的进展围绕更好的学习或采样 [76, 75, 55, 56, 7]、引导 [37, 60]、潜空间学习 [70] 与架构 [36, 63, 71, 91]。DiT 与 U-ViT [63, 8] 用 Transformer 替换或融合 U-Net,并启发了近期图像 [19, 18] 与视频合成系统 [12, 33],包括 Stable Diffusion 3.0 [29]、SORA [14] 与 Vidu [9]。
3 Method
3 方法
3.1 Preliminary: autoregressive modeling via next-token prediction
3.1 预备:基于下一词元预测的自回归建模
Formulation. Consider a sequence of discrete tokens , where is an integer from a vocabulary of size . The next-token autoregressive posits the probability of observing the current token depends only on its prefix . This unidirectional token dependency assumption allows for the factorization of the sequence ’s likelihood:
形式化。 考虑离散词元序列 ,其中 是大小为 的词表中的整数。下一词元自回归假定观测当前词元 的概率只依赖于其前缀 。这一单向词元依赖假设允许把序列 的似然分解为:
Training an autoregressive model involves optimizing over a dataset. This is known as the “next-token prediction”, and the trained can generate new sequences.
训练自回归模型 即在数据集上优化 。这就是「下一词元预测」;训好的 可生成新序列。
Tokenization. Images are inherently 2D continuous signals. To apply autoregressive modeling to images via next-token prediction, we must: 1) tokenize an image into several discrete tokens, and 2) define a 1D order of tokens for unidirectional modeling. For 1), a quantized autoencoder such as [30] is often used to convert the image feature map to discrete tokens :
分词。 图像本质上是二维连续信号。要通过下一词元预测对图像做自回归建模,必须: 1)把图像分词成若干离散词元; 2)为单向建模定义词元的一维顺序。 对 1),常用如 [30] 一类量化自编码器,把图像特征图 转为离散词元 :
where denotes the raw image, a encoder, and a quantizer. The quantizer typically includes a learnable codebook containing vectors. The quantization process will map each feature vector to the code index of its nearest code in the Euclidean sense:
其中 表示原始图像, 为编码器, 为量化器。量化器通常包含可学习码本 ,含 个向量。量化过程 把每个特征向量 映射到欧氏意义下最近码的索引 :
where means taking the -th vector in codebook . To train the quantized autoencoder, is looked up by every to get , the approximation of original . Then a new image is reconstructed using the decoder given , and a compound loss is minimized:
其中 表示取码本 中第 个向量。训练量化自编码器时,用每个 查表得到 ,作为原始 的近似。再用解码器 在 上重建新图像 ,并最小化复合损失 :
where is a perceptual loss such as LPIPS [97], a discriminative loss like StyleGAN’s discriminator loss [46], and , are loss weights. Once the autoencoder is fully trained, it will be used to tokenize images for subsequent training of a unidirectional autoregressive model.
其中 为感知损失如 LPIPS [97], 为判别损失如 StyleGAN 的判别器损失 [46],、 为损失权重。量化自编码器 训好后,用于后续单向自回归模型训练时的图像分词。
The image tokens in are arranged in a 2D grid. Unlike natural language sentences with an inherent left-to-right ordering, the order of image tokens must be explicitly defined for unidirectional autoregressive learning. Previous AR methods [30, 92, 50] flatten the 2D grid of into a 1D sequence using some strategy such as row-major raster scan, spiral, or z-curve order. Once flattened, they can extract a set of sequences from the dataset, and then train an autoregressive model to maximize the likelihood in (1) via next-token prediction.
中的图像词元排成二维网格。自然语言句子有固有的从左到右顺序,而图像词元的顺序必须为单向自回归学习显式定义。先前 AR 方法 [30, 92, 50] 用行优先光栅扫描、螺旋或 z 曲线等策略,把 的二维网格展平为一维序列 。展平后即可从数据集抽取一组序列 ,再通过下一词元预测训练自回归模型以最大化式 (1) 的似然。
Discussion on the weakness of vanilla autoregressive models. The above approach of tokenizing and flattening enable next-token autoregressive learning on images, but introduces several issues:
关于朴素自回归模型弱点的讨论。 上述分词与展平使图像上的下一词元自回归学习成为可能,但也引入若干问题:
- Mathematical premise violation. In quantized autoencoders (VQVAEs), the encoder typically produces an image feature map with inter-dependent feature vectors for all . So after quantization and flattening, the token sequence retains bidirectional correlations. This contradicts the unidirectional dependency assumption of autoregressive models, which dictates that each token should only depend on its prefix .
- Inability to perform some zero-shot generalization. Similar to issue 1), The unidirectional nature of image autoregressive modeling restricts their generalizability in tasks requiring bidirectional reasoning. E.g., it cannot predict the top part of an image given the bottom part.
- Structural degradation. The flattening disrupts the spatial locality inherent in image feature maps. For example, the token and its 4 immediate neighbors , are closely correlated due to their proximity. This spatial relationship is compromised in the linear sequence , where unidirectional constraints diminish these correlations.
- Inefficiency. Generating an image token sequence with a conventional self-attention transformer incurs autoregressive steps and computational cost.
- 数学前提被破坏。 在量化自编码器(VQVAE)中,编码器通常产生特征图 ,其中各特征向量 彼此依赖。量化并展平后,词元序列 仍保留双向相关。这与自回归模型的单向依赖假设相矛盾——后者要求每个词元 只依赖其前缀 。
- 难以做某些零样本泛化。 与问题 1) 类似,图像自回归建模的单向性限制了需要双向推理的任务上的泛化。例如,给定图像下半部分时,无法预测上半部分。
- 结构退化。 展平破坏了图像特征图固有的空间局部性。例如,词元 与其四个近邻 、 因邻近而高度相关。在线性序列 中,这种空间关系被削弱;单向约束进一步削弱这些相关性。
- 效率低。 用常规自注意力 Transformer 生成图像词元序列 ,需要 次自回归步与 计算量。
Issues 2) and 3) are evident (see examples above). Regarding issue 1), we present empirical evidence in Appendix A. The proof of issue 3) is detailed in Appendix B. These theoretical and practical limitations call for a rethinking of autoregressive models in the context of image generation.
问题 2) 与 3) 显而易见(见上文示例)。关于问题 1),我们在附录 A 给出经验证据。问题 3) 的证明详见附录 B。这些理论与实践局限,要求我们在图像生成语境下重新思考自回归模型。
Figure 4: VAR involves two separated training stages. Stage 1: a multi-scale VQ autoencoder encodes an image into token maps and is trained by a compound loss (5). For details on “Multi-scale quantization” and “Embedding”, check Algorithm 1 and 2. Stage 2: a VAR transformer is trained via next-scale prediction (6): it takes as input to predict . The attention mask is used in training to ensure each can only attend to . Standard cross-entropy loss is used.
图 4:VAR 分两个独立训练阶段。阶段 1:多尺度 VQ 自编码器把图像编码为 张词元图 ,用复合损失 (5) 训练。「多尺度量化」与「嵌入」细节见算法 1 与 2。 阶段 2:VAR Transformer 通过下一尺度预测 (6) 训练:输入 ,预测 。训练时使用注意力掩码,确保每个 只能关注 。损失为标准交叉熵。
3.2 Visual autoregressive modeling via next-scale prediction
3.2 基于下一尺度预测的视觉自回归建模
Reformulation. We reconceptualize the autoregressive modeling on images by shifting from “next-token prediction” to “next-scale prediction” strategy. Here, the autoregressive unit is an entire token map, rather than a single token. We start by quantizing a feature map into multi-scale token maps , each at a increasingly higher resolution , culminating in matches the original feature map’s resolution . The autoregressive likelihood is formulated as:
改写。 我们把图像上的自回归建模从「下一词元预测」改写为「下一尺度预测」策略。此处自回归单元是整张词元图,而非单个词元。先把特征图 量化为 张多尺度词元图 ,分辨率 逐步升高,最终 与原始特征图分辨率 一致。自回归似然写为:
where each autoregressive unit is the token map at scale containing tokens, and the sequence serves as the the “prefix” for . During the -th autoregressive step, all distributions over the tokens in will be generated in parallel, conditioned on ’s prefix and associated -th position embedding map. This “next-scale prediction” methodology is what we define as visual autoregressive modeling (VAR), depicted on the right side of Fig. 4. Note that in the training of VAR, a block-wise causal attention mask is used to ensure that each can only attend to its prefix . During inference, kv-caching can be used and no mask is needed.
其中每个自回归单元 是尺度 上含 个词元的词元图,序列 作为 的「前缀」。在第 个自回归步, 中全部 个词元的分布在其前缀与第 张位置嵌入图条件下并行生成。这一「下一尺度预测」方法即我们定义的视觉自回归建模(VAR),见图 4 右侧。注意训练 VAR 时使用分块因果注意力掩码,确保每个 只能关注其前缀 。推理时可使用 kv-caching,无需掩码。
Discussion. VAR addresses the previously mentioned three issues as follows:
讨论。 VAR 对前述三个问题的回应如下:
- The mathematical premise is satisfied if we constrain each to depend only on its prefix, that is, the process of getting is solely related to . This constraint is acceptable as it aligns with the natural, coarse-to-fine progression characteristics like human visual perception and artistic drawing (as we discussed in Sec. 1). Further details are provided in the Tokenization below.
- The spatial locality is preserved as (i) there is no flattening operation in VAR, and (ii) tokens in each are fully correlated. The multi-scale design additionally reinforces the spatial structure.
- The complexity for generating an image with latent is significantly reduced to , see Appendix for proof. This efficiency gain arises from the parallel token generation in each .
- 若约束每个 只依赖其前缀——即得到 的过程仅与 有关——则数学前提得以满足。该约束可接受,因为它符合人类视觉感知与艺术绘制这类自然的由粗到细进程(见第 1 节讨论)。更多细节见下文分词。
- 空间局部性得以保留,因为 (i) VAR 不做展平,(ii) 每张 内词元完全相关。多尺度设计还进一步强化空间结构。
- 生成 潜变量图像的复杂度显著降为 ,证明见附录。效率提升来自每张 内的并行词元生成。
Tokenization. We develope a new multi-scale quantization autoencoder to encode an image to multi-scale discrete token maps necessary for VAR learning (6). We employ the same architecture as VQGAN [30] but with a modified multi-scale quantization layer. The encoding and decoding procedures with residual design on or are detailed in algorithms 1 and 2. We empirically find this residual-style design, akin to [50], can perform better than independent interpolation. Algorithm 1 shows that each would depend only on its prefix . Note that a shared codebook is utilized across all scales, ensuring that each ’s tokens belong to the same vocabulary . To address the information loss in upscaling to , we use extra convolution layers . No convolution is used after downsampling to .
分词。 我们设计了新的多尺度量化自编码器,把图像编码为 VAR 学习 (6) 所需的 张多尺度离散词元图 。架构与 VQGAN [30] 相同,但改用多尺度量化层。在 或 上带残差的编码与解码流程见算法 1 与 2。经验上,这种类似 [50] 的残差式设计优于独立插值。算法 1 表明每个 只依赖其前缀 。注意所有尺度共用码本 ,保证每个 的词元属于同一词表 。为弥补把 上采样到 时的信息损失,我们使用 个额外卷积层 。把 下采样到 之后不再使用卷积。
Inputs: raw image ;
1 Hyperparameters: steps , resolutions ;
2 , ;
3 for do
4 ;
5 ;
6 ;
7 ;
8 ;
9 Return: multi-scale tokens ;
Algorithm 1 Multi-scale VQVAE Encoding
输入:原始图像 ;
1 超参数:步数 ,分辨率 ;
2 ,;
3 for do
4 ;
5 ;
6 ;
7 ;
8 ;
9 返回:多尺度词元 ;
算法 1 多尺度 VQVAE 编码
Inputs: multi-scale token maps ;
1 Hyperparameters: steps , resolutions ;
2 ;
3 for do
4 ;
5 ;
6 ;
7 ;
8 ;
9 Return: reconstructed image ;
Algorithm 2 Multi-scale VQVAE Reconstruction
输入:多尺度词元图 ;
1 超参数:步数 ,分辨率 ;
2 ;
3 for do
4 ;
5 ;
6 ;
7 ;
8 ;
9 返回:重建图像 ;
算法 2 多尺度 VQVAE 重建
4 Implementation details
4 实现细节
VAR tokenizer. As aforementioned, we use the vanilla VQVAE architecture [30] and a multi-scale quantization scheme with extra convolutions (0.03M extra parameters). We use a shared codebook for all scales with . Following the baseline [30], our tokenizer is also trained on OpenImages [49] with the compound loss (5) and a spatial downsample ratio of .
VAR 分词器。 如前所述,我们采用原版 VQVAE 架构 [30] 与带 个额外卷积(约 0.03M 额外参数)的多尺度量化方案。所有尺度共用码本,。与基线 [30] 一致,分词器也在 OpenImages [49] 上用复合损失 (5) 训练,空间下采样比为 。
VAR transformer. Our main focus is on VAR algorithm so we keep a simple model architecture design. We adopt the architecture of standard decoder-only transformers akin to GPT-2 and VQGAN [66, 30] with adaptive normalization (AdaLN), which has widespread adoption and proven effectiveness in many visual generative models [46, 47, 45, 74, 73, 42, 63, 19]. For class-conditional synthesis, we use the class embedding as the start token [s] and also the condition of AdaLN. We found normalizing and to unit vectors before attention can stablize the training. We do not use advanced techniques in large language models, such as rotary position embedding (RoPE), SwiGLU MLP, or RMS Norm [82, 83]. Our model shape follows a simple rule like [43] that the width , head counts , and drop rate are linearly scaled with the depth as follows:
VAR Transformer。 本文重点在 VAR 算法,故保持简单模型架构。我们采用类似 GPT-2 与 VQGAN [66, 30] 的标准仅解码器 Transformer,并加入自适应归一化(AdaLN);该设计在许多视觉生成模型中被广泛采用并证明有效 [46, 47, 45, 74, 73, 42, 63, 19]。对类别条件合成,用类别嵌入作为起始词元 [s],同时作为 AdaLN 的条件。我们发现在注意力前把 与 归一化为单位向量可稳定训练。我们未使用大语言模型中的先进技术,如旋转位置嵌入(RoPE)、SwiGLU MLP 或 RMS Norm [82, 83]。模型形状遵循类似 [43] 的简单规则:宽度 、头数 与丢弃率 随深度 线性缩放:
Consequently, the main parameter count of a VAR transformer with depth is given by[^2]:
因此,深度为 的 VAR Transformer 的主要参数量 为[^2]:
All models are trained with the similar settings: a base learning rate of per 256 batch size, an AdamW optimizer with , , , a batch size from 768 to 1024 and training epochs from 200 to 350 (depends on model size). The evaluations in Sec. 5 suggest that such a simple model design are capable of scaling and generalizing well.
所有模型采用相近设置训练:按每 256 batch size 计基础学习率 ,AdamW 优化器 、、,batch size 768 到 1024,训练轮数 200 到 350(视模型大小而定)。第 5 节评估表明,如此简单的模型设计已能良好扩展与泛化。
5 Empirical Results
5 实验结果
This section first compares VAR with other image generative model families in Sec. 5.1. Evaluations on the scalability and generalizability of VAR models are presented in Sec. 5.2 and Appendix 6. For implementation details and ablation study, please see Appendix 4 and Appendix 7.
本节先在第 5.1 节把 VAR 与其他图像生成模型族比较。可扩展性与泛化性评估见第 5.2 节与附录 6。实现细节与消融见附录 4 与附录 7。
| Type | Model | FID | IS | Pre | Rec | #Para | #Step | Time |
|---|---|---|---|---|---|---|---|---|
| GAN | BigGAN [13] | 6.95 | 224.5 | 0.89 | 0.38 | 112M | 1 | |
| GAN | GigaGAN [42] | 3.45 | 225.5 | 0.84 | 0.61 | 569M | 1 | |
| GAN | StyleGan-XL [74] | 2.30 | 265.1 | 0.78 | 0.53 | 166M | 1 | 0.3 [74] |
| Diff. | ADM [26] | 10.94 | 101.0 | 0.69 | 0.63 | 554M | 250 | 168 [74] |
| Diff. | CDM [36] | 4.88 | 158.7 | 8100 | ||||
| Diff. | LDM-4-G [70] | 3.60 | 247.7 | 400M | 250 | |||
| Diff. | DiT-L/2 [63] | 5.02 | 167.2 | 0.75 | 0.57 | 458M | 250 | 31 |
| Diff. | DiT-XL/2 [63] | 2.27 | 278.2 | 0.83 | 0.57 | 675M | 250 | 45 |
| Diff. | L-DiT-3B [3] | 2.10 | 304.4 | 0.82 | 0.60 | 3.0B | 250 | 45 |
| Diff. | L-DiT-7B [3] | 2.28 | 316.2 | 0.83 | 0.58 | 7.0B | 250 | 45 |
| Mask. | MaskGIT [17] | 6.18 | 182.1 | 0.80 | 0.51 | 227M | 8 | 0.5 [17] |
| Mask. | RCG (cond.) [51] | 3.49 | 215.5 | 502M | 20 | 1.9 [51] | ||
| AR | VQVAE-2*†* [68] | 31.11 | 45 | 0.36 | 0.57 | 13.5B | 5120 | |
| AR | VQGAN*†* [30] | 18.65 | 80.4 | 0.78 | 0.26 | 227M | 256 | 19 [17] |
| AR | VQGAN [30] | 15.78 | 74.3 | 1.4B | 256 | 24 | ||
| AR | VQGAN-re [30] | 5.20 | 280.3 | 1.4B | 256 | 24 | ||
| AR | ViTVQ [92] | 4.17 | 175.1 | 1.7B | 1024 | 24 | ||
| AR | ViTVQ-re [92] | 3.04 | 227.4 | 1.7B | 1024 | 24 | ||
| AR | RQTran. [50] | 7.55 | 134.0 | 3.8B | 68 | 21 | ||
| AR | RQTran.-re [50] | 3.80 | 323.7 | 3.8B | 68 | 21 | ||
| VAR | VAR- | 3.30 | 274.4 | 0.84 | 0.51 | 310M | 10 | 0.4 |
| VAR | VAR- | 2.57 | 302.6 | 0.83 | 0.56 | 600M | 10 | 0.5 |
| VAR | VAR- | 2.09 | 312.9 | 0.82 | 0.59 | 1.0B | 10 | 0.6 |
| VAR | VAR- | 1.92 | 323.1 | 0.82 | 0.59 | 2.0B | 10 | 1 |
| VAR | VAR--re | 1.73 | 350.2 | 0.82 | 0.60 | 2.0B | 10 | 1 |
| (validation data) | 1.78 | 236.9 | 0.75 | 0.67 |
Table 1: Generative model family comparison on class-conditional ImageNet 256256. “” or “” indicate lower or higher values are better. Metrics include Fréchet inception distance (FID), inception score (IS), precision (Pre) and recall (rec). “#Step”: the number of model runs needed to generate an image. Wall-clock inference time relative to VAR is reported. Models with the suffix “-re” used rejection sampling. : taken from MaskGIT [17].
| 类型 | 模型 | FID | IS | Pre | Rec | #Para | #Step | 时间 |
|---|---|---|---|---|---|---|---|---|
| GAN | BigGAN [13] | 6.95 | 224.5 | 0.89 | 0.38 | 112M | 1 | |
| GAN | GigaGAN [42] | 3.45 | 225.5 | 0.84 | 0.61 | 569M | 1 | |
| GAN | StyleGan-XL [74] | 2.30 | 265.1 | 0.78 | 0.53 | 166M | 1 | 0.3 [74] |
| Diff. | ADM [26] | 10.94 | 101.0 | 0.69 | 0.63 | 554M | 250 | 168 [74] |
| Diff. | CDM [36] | 4.88 | 158.7 | 8100 | ||||
| Diff. | LDM-4-G [70] | 3.60 | 247.7 | 400M | 250 | |||
| Diff. | DiT-L/2 [63] | 5.02 | 167.2 | 0.75 | 0.57 | 458M | 250 | 31 |
| Diff. | DiT-XL/2 [63] | 2.27 | 278.2 | 0.83 | 0.57 | 675M | 250 | 45 |
| Diff. | L-DiT-3B [3] | 2.10 | 304.4 | 0.82 | 0.60 | 3.0B | 250 | 45 |
| Diff. | L-DiT-7B [3] | 2.28 | 316.2 | 0.83 | 0.58 | 7.0B | 250 | 45 |
| Mask. | MaskGIT [17] | 6.18 | 182.1 | 0.80 | 0.51 | 227M | 8 | 0.5 [17] |
| Mask. | RCG (cond.) [51] | 3.49 | 215.5 | 502M | 20 | 1.9 [51] | ||
| AR | VQVAE-2*†* [68] | 31.11 | 45 | 0.36 | 0.57 | 13.5B | 5120 | |
| AR | VQGAN*†* [30] | 18.65 | 80.4 | 0.78 | 0.26 | 227M | 256 | 19 [17] |
| AR | VQGAN [30] | 15.78 | 74.3 | 1.4B | 256 | 24 | ||
| AR | VQGAN-re [30] | 5.20 | 280.3 | 1.4B | 256 | 24 | ||
| AR | ViTVQ [92] | 4.17 | 175.1 | 1.7B | 1024 | 24 | ||
| AR | ViTVQ-re [92] | 3.04 | 227.4 | 1.7B | 1024 | 24 | ||
| AR | RQTran. [50] | 7.55 | 134.0 | 3.8B | 68 | 21 | ||
| AR | RQTran.-re [50] | 3.80 | 323.7 | 3.8B | 68 | 21 | ||
| VAR | VAR- | 3.30 | 274.4 | 0.84 | 0.51 | 310M | 10 | 0.4 |
| VAR | VAR- | 2.57 | 302.6 | 0.83 | 0.56 | 600M | 10 | 0.5 |
| VAR | VAR- | 2.09 | 312.9 | 0.82 | 0.59 | 1.0B | 10 | 0.6 |
| VAR | VAR- | 1.92 | 323.1 | 0.82 | 0.59 | 2.0B | 10 | 1 |
| VAR | VAR--re | 1.73 | 350.2 | 0.82 | 0.60 | 2.0B | 10 | 1 |
| (验证数据) | 1.78 | 236.9 | 0.75 | 0.67 |
表 1:ImageNet 256256 条件生成。「」或「」表示越低或越高越好。指标包括 Fréchet inception distance(FID)、inception score(IS)、精确率(Pre)与召回率(rec)。「#Step」:生成一张图像所需的模型运行次数。墙钟推理时间相对 VAR 报告。后缀「-re」表示使用拒绝采样。:引自 MaskGIT [17]。
5.1 State-of-the-art image generation
5.1 领先的图像生成
Setup. We test VAR models with depths 16, 20, 24, and 30 on ImageNet 256256 and 512512 conditional generation benchmarks and compare them with the state-of-the-art image generation model families. Among all VQVAE-based AR or VAR models, VQGAN [30] and ours use the same architecture (CNN) and training data (OpenImages [49]) for VQVAE, while ViT-VQGAN [92] uses a ViT autoencoder, and both it and RQTransformer [50] trains the VQVAE directly on ImageNet. The results are summaried in Tab. 1 and Tab. 2.
设置。 我们在 ImageNet 256256 与 512512 条件生成基准上测试深度 16、20、24、30 的 VAR 模型,并与领先图像生成模型族比较。在所有基于 VQVAE 的 AR 或 VAR 模型中,VQGAN [30] 与我们的 VQVAE 使用相同架构(CNN)与训练数据(OpenImages [49]),而 ViT-VQGAN [92] 使用 ViT 自编码器,它与 RQTransformer [50] 都直接在 ImageNet 上训练 VQVAE。结果汇总于表 1 与表 2。
Overall comparison. In comparison with existing generative approaches including generative adversarial networks (GAN), diffusion models (Diff.), BERT-style masked-prediction models (Mask.), and GPT-style autoregressive models (AR), our visual autoregressive (VAR) establishes a new model class. As shown in Tab. 1, VAR not only achieves the best FID/IS but also demonstrates remarkable speed in image generation. VAR also maintains decent precision and recall, confirming its semantic consistency. These advantages hold true on the 512512 synthesis benchmark, as detailed in Tab. 2. Notably, VAR significantly advances traditional AR capabilities. To our knowledge, this is the first time of autoregressive models outperforming Diffusion transformers, a milestone made possible by VAR’s resolution of AR limitations discussed in Section 3.
总体比较。 相对现有生成路径——包括生成对抗网络(GAN)、扩散模型(Diff.)、BERT 风格掩码预测模型(Mask.)与 GPT 风格自回归模型(AR)——我们的视觉自回归(VAR)确立了一类新模型。如表 1 所示,VAR 不仅取得最佳 FID/IS,在图像生成速度上也十分突出,并保持不错的精确率与召回率,说明语义一致性良好。这些优势在 512512 合成基准上同样成立,见表 2。尤其是,VAR 显著推进了传统 AR 能力。据我们所知,这是自回归模型首次超过扩散 Transformer,这一里程碑得益于 VAR 化解了第 3 节讨论的 AR 局限。
| Type | Model | FID | IS | Time |
|---|---|---|---|---|
| GAN | BigGAN [13] | 8.43 | 177.9 | |
| Diff. | ADM [26] | 23.24 | 101.0 | |
| Diff. | DiT-XL/2 [63] | 3.04 | 240.8 | 81 |
| Mask. | MaskGIT [17] | 7.32 | 156.0 | 0.5*†* |
| AR | VQGAN [30] | 26.52 | 66.8 | 25*†* |
| VAR | VAR--s | 2.63 | 303.2 | 1 |
Table 2: ImageNet 512512 conditional generation. : quoted from MaskGIT [17]. “-s”: a single shared AdaLN layer is used due to resource limitation.
| 类型 | 模型 | FID | IS | 时间 |
|---|---|---|---|---|
| GAN | BigGAN [13] | 8.43 | 177.9 | |
| Diff. | ADM [26] | 23.24 | 101.0 | |
| Diff. | DiT-XL/2 [63] | 3.04 | 240.8 | 81 |
| Mask. | MaskGIT [17] | 7.32 | 156.0 | 0.5*†* |
| AR | VQGAN [30] | 26.52 | 66.8 | 25*†* |
| VAR | VAR--s | 2.63 | 303.2 | 1 |
表 2:ImageNet 512512 条件生成。 :引自 MaskGIT [17]。「-s」:因资源限制使用单个共享 AdaLN 层。
Efficiency comparison. Conventional autoregressive (AR) models [30, 68, 92, 50] suffer a lot from the high computational cost, as the number of image tokens is quadratic to the image resolution. A full autoregressive generation of tokens requires decoding iterations and total computations. In contrast, VAR only requires iterations and total computations. The wall-clock time reported in Tab. 1 also provides empirical evidence that VAR is around 20 times faster than VQGAN and ViT-VQGAN even with more model parameters, reaching the speed of efficient GAN models which only require 1 step to generate an image.
效率比较。 传统自回归(AR)模型 [30, 68, 92, 50] 计算代价很高,因为图像词元数与分辨率成平方关系。完整自回归生成 个词元需要 次解码迭代与 总计算量。相比之下,VAR 只需 次迭代与 总计算量。表 1 报告的墙钟时间也提供经验证据:即使参数更多,VAR 仍比 VQGAN 与 ViT-VQGAN 大约快 20 倍,接近只需 1 步生成图像的高效 GAN 模型速度。
Compared with popular diffusion transformer. The VAR model surpasses the recently popular diffusion models Diffusion Transformer (DiT), which serves as the precursor to the latest Stable-Diffusion 3 [29] and SORA [14], in multiple dimensions: 1) In image generation diversity and quality (FID and IS), VAR with 2B parameters consistently performs better than DiT-XL/2 [63], L-DiT-3B, and L-DiT-7B [3]. VAR also maintains comparable precision and recall. 2) For inference speed, the DiT-XL/2 requires 45 the wall-clock time compared to VAR, while 3B and 7B models [3] would cost much more. 3) VAR is considered more data-efficient, as it requires only 350 training epochs compared to DiT-XL/2’s 1400. 4) For scalability, Fig. 3 and Tab. 1 show that DiT only obtains marginal or even negative gains beyond 675M parameters. In contrast, the FID and IS of VAR are consistently improved, aligning with the scaling law study in Sec. 5.2. These results establish VAR as potentially a more efficient and scalable model for image generation than models like DiT.
与流行扩散 Transformer 的比较。 VAR 在多个维度超过近期流行的扩散模型 Diffusion Transformer(DiT)——后者是最新 Stable-Diffusion 3 [29] 与 SORA [14] 的前身:1)在图像生成多样性与质量(FID 与 IS)上,2B 参数的 VAR 持续优于 DiT-XL/2 [63]、L-DiT-3B 与 L-DiT-7B [3],精确率与召回率也保持可比。2)推理速度上,DiT-XL/2 的墙钟时间约为 VAR 的 45 倍,而 3B 与 7B 模型 [3] 代价更高。3)VAR 更数据高效:只需 350 个训练 epoch,而 DiT-XL/2 为 1400。4)可扩展性上,图 3 与表 1 显示 DiT 在超过 675M 参数后增益微弱甚至为负;相比之下,VAR 的 FID 与 IS 持续改进,与第 5.2 节缩放律研究一致。这些结果说明 VAR 有望成为比 DiT 一类模型更高效、更可扩展的图像生成模型。
Figure 5: Scaling laws with VAR transformer size , with power-law fits (dashed) and equations (in legend). Small, near-zero exponents suggest a smooth decline in both test loss and token error rate when scaling up VAR transformer. Axes are all on a logarithmic scale. The Pearson correlation coefficients near signify a strong linear relationship between vs. or vs. .
图 5:随 VAR Transformer 规模 的缩放律,含幂律拟合(虚线)与方程(图例)。很小、接近零的指数 表明放大 VAR Transformer 时,测试损失 与词元错误率 均平滑下降。各轴均为对数尺度。Pearson 相关系数接近 ,表明 与 或 与 之间存在强线性关系。
5.2 Power-law scaling laws
5.2 幂律缩放律
Background. Prior research [43, 35, 38, 1] have established that scaling up autoregressive (AR) large language models (LLMs) leads to a predictable decrease in test loss . This trend correlates with parameter counts , training tokens , and optimal training compute , following a power-law:
背景。 先前研究 [43, 35, 38, 1] 表明,放大自回归(AR)大语言模型(LLM)会带来可预测的测试损失 下降。该趋势与参数量 、训练词元数 以及最优训练算力 相关,遵循幂律:
where can be any of , , or . The exponent reflects the smoothness of power-law, and denotes the reducible loss normalized by irreducible loss [35][^3]. A logarithmic transformation to and will reveal a linear relation between and :
其中 可以是 、 或 。指数 反映幂律平滑程度; 表示相对不可约损失 [35] 归一化后的可约损失[^3]。对 与 取对数后, 与 呈线性关系:
An appealing phenomenon is that both [43] and [35] never observed deviation from these linear relationships at the higher end of , although flattening is inevitable as the loss approaches zero.
一个有趣的现象是,[43] 与 [35] 在 的高端从未观察到偏离这些线性关系,尽管损失趋近零时变平不可避免。
These observed scaling laws [43, 35, 38, 1] not only validate the scalability of LLMs but also serve as a predictive tool for AR modeling, which facilitates the estimation of performance for larger AR models based on their smaller counterparts, thereby saving resource usage by large model performance forecasting. Given these appealing properties of scaling laws brought by LLMs, their replication in computer vision is therefore of significant interest.
这些观测到的缩放律 [43, 35, 38, 1] 不仅验证了 LLM 的可扩展性,也为 AR 建模提供预测工具:可用较小 AR 模型估计更大模型的表现,从而通过性能预报节省资源。鉴于 LLM 带来的这些诱人性质,在计算机视觉中复现它们因此具有重要意义。
Setup of scaling VAR models. Following the protocols from [43, 35, 38, 1], we examine whether our VAR model complies with similar scaling laws. We trained models across 12 different sizes, from 18M to 2B parameters, on the ImageNet training set [24] containing 1.28M images (or 870B image tokens under our VQVAE) per epoch. For models of different sizes, training spanned 200 to 350 epochs, with a maximum number of tokens reaching 305 billion. Below we focus on the scaling laws with model parameters and optimal training compute given sufficient token count .
缩放 VAR 模型的设置。 遵循 [43, 35, 38, 1] 的协议,我们检验 VAR 是否服从类似缩放律。我们在含 128 万张图像的 ImageNet 训练集 [24] 上训练了 12 种不同规模模型(18M 到 2B 参数;按我们的 VQVAE,每 epoch 约 870B 图像词元)。不同规模训练 200 到 350 个 epoch,最大词元数达 3050 亿。下文聚焦在词元数 充足时,相对模型参数 与最优训练算力 的缩放律。
Scaling laws with model parameters . We first investigate the test loss trend as the VAR model size increases. The number of parameters for a VAR transformer with depth is specified in (8). We varied from to , yielding 12 models with 18.5M to 2.0B parameters. We assessed the final test cross-entropy loss and token prediction error rates on the ImageNet validation set of 50,000 images [24]. We computed and for both the last scale (at the last next-scale autoregressive step), as well as the global average. Results are plotted in Fig. 5, where we
相对模型参数 的缩放律。 我们首先考察 VAR 模型变大时测试损失的趋势。深度 的 VAR Transformer 参数量 由式 (8) 给出。我们令 从 到 ,得到 18.5M 到 2.0B 参数的 12 个模型。在含 5 万张图像的 ImageNet 验证集 [24] 上评估最终测试交叉熵损失 与词元预测错误率 。我们分别计算最后一尺度(最后一次下一尺度自回归步)以及全局平均的 与 。结果见图 5,我们
图 6:相对最优训练算力 的缩放律。线颜色表示不同模型规模。红色虚线为幂律拟合,方程见图例。坐标轴为对数尺度。Pearson 系数接近 ,表明 与 或 与 之间存在强线性关系。
observed a clear power-law scaling trend for as a function of , as consistent with [43, 35, 38, 1]. The power-law scaling laws can be expressed as:
观测到 相对 清晰的幂律缩放趋势,与 [43, 35, 38, 1] 一致。幂律缩放律可写为:
Although the scaling laws are mainly studied on the test loss, we also empirically observed similar power-law trends for the token error rate :
尽管缩放律主要研究测试损失,我们也经验上观测到词元错误率 的类似幂律趋势:
These results verify the strong scalability of VAR, by which scaling up VAR transformers can continuously improve the model’s test performance.
这些结果验证了 VAR 的强可扩展性:放大 VAR Transformer 可持续改进模型测试表现。
Scaling laws with optimal training compute . We then examine the scaling behavior of VAR transformers when increasing training compute . For each of the 12 models, we traced the test loss and token error rate as a function of during training quoted in PFlops ( floating-point operations per second). The results are plotted in Fig. 6. Here, we draw the Pareto frontier of and to highlight the optimal training compute required to reach a certain value of loss or error.
相对最优训练算力 的缩放律。 我们接着考察增大训练算力 时 VAR Transformer 的缩放行为。对 12 个模型中的每一个,我们在训练过程中追踪测试损失 与词元错误率 相对 的函数,算力以 PFlops(每秒 次浮点运算)计。结果见图 6。这里我们画出 与 的 Pareto 前沿,以突出达到某一损失或错误水平所需的最优训练算力 。
The fitted power-law scaling laws for and as a function of are:
拟合得到的 与 相对 的幂律缩放律为:
These relations (14, 16) hold across 6 orders of magnitude in , and our findings are consistent with those in [43, 35]: when trained with sufficient data, larger VAR transformers are more compute-efficient because they can reach the same level of performance with less computation.
这些关系(14, 16)在 跨越 6 个数量级时成立,我们的发现与 [43, 35] 一致:在数据充足时训练,更大的 VAR Transformer 更算力高效,因为它们可用更少计算达到同等表现。
5.3 Visualization of scaling effect
5.3 缩放效应可视化
To better understand how VAR models are learning when scaled up, we compare some generated samples from VAR models of 4 different sizes (depth 6, 16, 26, 30) and 3 different training stages (20%, 60%, 100% of total training tokens) in Fig. 7. To keep the content consistent, a same random seed and teacher-forced initial tokens are used. The observed improvements in visual fidelity and soundness are consistent with the scaling laws, as larger transformers are thought able to learn more complex and fine-grained image distributions.
为更好理解放大时 VAR 模型在学什么,我们在图 7 比较了 4 种规模(深度 6、16、26、30)与 3 个训练阶段(总训练词元的 20%、60%、100%)的 VAR 模型生成的部分 样本。为保持内容一致,使用相同随机种子与教师强制的初始词元。观测到的视觉保真度与合理性提升与缩放律一致:更大 Transformer 被认为能学习更复杂、更细粒度的图像分布。
Figure 7: Scaling model size and training compute improves visual fidelity and soundness. Zoom in for a better view. Samples are drawn from VAR models of 4 different sizes and 3 different training stages. 9 class labels (from left to right, top to bottom) are: flamingo 130, arctic wolf 270, macaw 88, Siamese cat 284, oscilloscope 688, husky 250, mollymawk 146, volcano 980, and catamaran 484.
图 7:放大模型规模 与训练算力 可提升视觉保真度与合理性。建议放大查看。样本来自 4 种规模、3 个训练阶段的 VAR 模型。9 个类别标签(从左到右、从上到下)为:flamingo 130、arctic wolf 270、macaw 88、Siamese cat 284、oscilloscope 688、husky 250、mollymawk 146、volcano 980、catamaran 484。
图 8:下游任务上的零样本评估,含修补、外扩与类别条件编辑。结果表明 VAR 无需特殊设计与微调即可泛化到新下游任务。建议放大查看。
6 Zero-shot task generalization
6 零样本任务泛化
Image in-painting and out-painting. VAR-30 is tested. For in- and out-painting, we teacher-force ground truth tokens outside the mask and let the model only generate tokens within the mask. No class label information is injected into the model. The results are visualized in Fig. 8. Without modifications to the network architecture or tuning parameters, VAR has achieved decent results on these downstream tasks, substantiating the generalization ability of VAR.
图像修补与外扩。 测试 VAR-30。对修补与外扩,我们在掩码外教师强制真实词元,仅让模型生成掩码内词元。不向模型注入类别标签信息。结果见图 8。无需改网络架构或调参,VAR 在这些下游任务上取得不错结果,印证了其泛化能力。
Class-conditional image editing. Following MaskGIT [17] we also tested VAR on the class-conditional image editing task. Similar to the case of in-painting, the model is forced to generate tokens only in the bounding box conditional on some class label. Fig. 8 shows the model can produce plausible content that fuses well into the surrounding contexts, again verifying the generality of VAR.
类别条件图像编辑。 遵循 MaskGIT [17],我们也在类别条件图像编辑任务上测试 VAR。与修补类似,模型在给定类别标签条件下,仅在边界框内生成词元。图 8 显示模型能产生与周围上下文融合良好的合理内容,再次验证 VAR 的通用性。
| Description | Para. | Model | AdaLN | Top- | CFG | Cost | FID | ||
|---|---|---|---|---|---|---|---|---|---|
| 1 | AR [30] | 227M | AR | ✗ | ✗ | ✗ | 1 | 18.65 | 0.00 |
| 2 | AR to VAR | 207M | VAR-16 | ✗ | ✗ | ✗ | 0.013 | 5.22 | 13.43 |
| 3 | AdaLN | 310M | VAR-16 | ✓ | ✗ | ✗ | 0.016 | 4.95 | 13.70 |
| 4 | Top- | 310M | VAR-16 | ✓ | 600 | ✗ | 0.016 | 4.64 | 14.01 |
| 5 | CFG | 310M | VAR-16 | ✓ | 600 | 2.0 | 0.022 | 3.60 | 15.05 |
| 5 | Attn. Norm. | 310M | VAR-16 | ✓ | 600 | 2.0 | 0.022 | 3.30 | 15.35 |
| 6 | Scale up | 2.0B | VAR-30 | ✓ | 600 | 2.0 | 0.052 | 1.73 | 16.85 |
Table 3: Ablation study of VAR. The first two rows compare GPT-2-style transformers trained under AR or VAR algorithm without any bells and whistles. Subsequent lines show the influence of VAR enhancements. “AdaLN”: adaptive layernorm. “CFG”: classifier-free guidance. “Attn. Norm.”: normalizing and to unit vectors before attention. “Cost”: inference cost relative to the baseline. “”: FID reduction to the baseline.
| 说明 | 参数 | 模型 | AdaLN | Top- | CFG | 代价 | FID | ||
|---|---|---|---|---|---|---|---|---|---|
| 1 | AR [30] | 227M | AR | ✗ | ✗ | ✗ | 1 | 18.65 | 0.00 |
| 2 | AR 到 VAR | 207M | VAR-16 | ✗ | ✗ | ✗ | 0.013 | 5.22 | 13.43 |
| 3 | AdaLN | 310M | VAR-16 | ✓ | ✗ | ✗ | 0.016 | 4.95 | 13.70 |
| 4 | Top- | 310M | VAR-16 | ✓ | 600 | ✗ | 0.016 | 4.64 | 14.01 |
| 5 | CFG | 310M | VAR-16 | ✓ | 600 | 2.0 | 0.022 | 3.60 | 15.05 |
| 5 | Attn. Norm. | 310M | VAR-16 | ✓ | 600 | 2.0 | 0.022 | 3.30 | 15.35 |
| 6 | 放大 | 2.0B | VAR-30 | ✓ | 600 | 2.0 | 0.052 | 1.73 | 16.85 |
表 3:VAR 消融研究。前两行比较在无额外技巧时,按 AR 或 VAR 算法训练的 GPT-2 风格 Transformer。后续行展示 VAR 增强的影响。「AdaLN」:自适应层归一化。「CFG」:无分类器引导。「Attn. Norm.」:注意力前将 与 归一化为单位向量。「Cost」:相对基线的推理代价。「」:相对基线的 FID 降幅。
7 Ablation Study
7 消融研究
In this study, we aim to verify the effectiveness and efficiency of our proposed VAR framework. Results are reported in Tab. 3.
本实验旨在验证所提 VAR 框架的有效性与效率。结果见表 3。
Effectiveness and efficiency of VAR. Starting from the vanilla AR transformer baseline implemented by [17], we replace its methodology with our VAR and keep other settings unchanged to get row 2. VAR achieves a way more better FID (18.65 vs. 5.22) with only 0.013 inference wall-clock cost than the AR model, which demonstrates a leap in visual AR model’s performance and efficiency.
VAR 的有效性与效率。 从 [17] 实现的朴素 AR Transformer 基线出发,我们将其方法替换为 VAR,其余设置不变,得到第 2 行。VAR 以仅 0.013 的推理墙钟代价,取得远优于 AR 的 FID(18.65 对 5.22),显示视觉 AR 模型在性能与效率上的跃升。
Component-wise ablation. We further test some key components in VAR. By replacing the standard Layer Normalization (LN) with Adaptive Layer Normalization (AdaLN), VAR starts yielding better FID than baseline. By using the top- sampling similar to the baseline, VAR’s FID is further improved. By using the classifier-free guidance (CFG) with ratio and normalizing and to unit vectors before attention, we reach the FID of 3.30, which is 15.35 lower to the baseline, and its inference speed is still 45 times faster. We finally scale up VAR size to 2.0B and achieve an FID of 1.73. This is 16.85 better than the baseline FID.
分量消融。 我们进一步测试 VAR 中的关键组件。用自适应层归一化(AdaLN)替换标准层归一化(LN)后,VAR 的 FID 开始优于基线。采用与基线类似的 top- 采样后,FID 进一步改进。使用比率为 的无分类器引导(CFG),并在注意力前将 与 归一化为单位向量,我们达到 FID 3.30,比基线低 15.35,推理速度仍快约 45 倍。最终把 VAR 放大到 2.0B,达到 FID 1.73,比基线 FID 好 16.85。
8 Limitations and Future Work
8 局限与未来工作
In this work, we mainly focus on the design of learning paradigm and keep the VQVAE architecture and training unchanged from the baseline [30] to better justify VAR framework’s effectiveness. We expect advancing VQVAE tokenizer [99, 59, 95] as another promising way to enhance autoregressive generative models, which is orthogonal to our work. We believe iterating VAR by advanced tokenizer or sampling techniques in these latest work can further improve VAR’s performance or speed.
本文主要聚焦学习范式设计,VQVAE 架构与训练保持与基线 [30] 一致,以便更好论证 VAR 框架的有效性。我们预期推进 VQVAE 分词器 [99, 59, 95] 是增强自回归生成模型的另一条有希望路径,且与本文正交。我们相信用这些最新工作中的先进分词器或采样技术迭代 VAR,可进一步提升其性能或速度。
Text-prompt generation is an ongoing direction of our research. Given that our model is fundamentally similar to modern LLMs, it can easily be integrated with them to perform text-to-image generation through either an encoder-decoder or in-context manner. This is currently in our high priority for exploration.
文本提示生成 是我们正在进行的研究方向。鉴于我们的模型与现代 LLM 本质上相近,可轻松与之集成,通过编码器–解码器或上下文方式做文生图。这是当前探索的高优先级。
Video generation is not implemented in this work, but it can be naturally extended. By considering multi-scale video features as 3D pyramids, we can formulate a similar “3D next-scale prediction” to generate videos via VAR. Compared to diffusion-based generators like SORA [14], our method has inherent advantages in temporal consistency or integration with LLMs, thus can potentially handle longer temporal dependencies. This makes VAR competitive in the video generation field, because traditional AR models can be too inefficient for video generation due to their extremely high computational complexity and slow inference speed: it is becoming prohibitively expensive to generate high-resolution videos with traditional AR models, while VAR is capable to solve this. We therefore foresee a promising future for exploiting VAR models in the realm of video generation.
视频生成 未在本文实现,但可自然扩展。把多尺度视频特征视为三维金字塔,即可类似地形式化「三维下一尺度预测」,用 VAR 生成视频。相较 SORA [14] 一类基于扩散的生成器,我们的方法在时间一致性或与 LLM 集成上有固有优势,因而有潜力处理更长时序依赖。这使 VAR 在视频生成领域具有竞争力:传统 AR 模型因计算复杂度极高、推理极慢,对视频生成往往过于低效——用传统 AR 生成高分辨率视频正变得代价高昂,而 VAR 有能力解决这一点。因此我们预见,在视频生成领域发掘 VAR 模型前景可观。
9 Conclusion
9 结论
We introduced a new visual generative framework named Visual AutoRegressive modeling (VAR) that 1) theoretically addresses some issues inherent in standard image autoregressive (AR) models, and 2) makes language-model-based AR models first surpass strong diffusion models in terms of image quality, diversity, data efficiency, and inference speed. Upon scaling VAR to 2 billion parameters, we observed a clear power-law relationship between test performance and model parameters or training compute, with Pearson coefficients nearing , indicating a robust framework for performance prediction. These scaling laws and the possibility for zero-shot task generalization, as hallmarks of LLMs, have now been initially verified in our VAR transformer models. We hope our findings and open sources can facilitate a more seamless integration of the substantial successes from the natural language processing domain into computer vision, ultimately contributing to the advancement of powerful multi-modal intelligence.
我们提出名为视觉自回归建模(VAR)的新视觉生成框架:1)从理论上化解标准图像自回归(AR)模型固有的若干问题;2)使基于语言模型的 AR 模型首次在图像质量、多样性、数据效率与推理速度上超过强扩散模型。把 VAR 放大到 20 亿参数后,我们观测到测试表现与模型参数或训练算力之间清晰的幂律关系,Pearson 系数接近 ,表明有稳健的性能预测框架。作为 LLM 标志的缩放律与零样本任务泛化可能,现已在我们的 VAR Transformer 模型中得到初步验证。希望我们的发现与开源能促进自然语言处理领域大量成功更顺畅地融入计算机视觉,最终推动强大的多模态智能。
图 9:词元依赖示意。可视化 VQGAN 编码器最后一层自注意力的归一化注意力分数热图。使用 ImageNet 验证集中随机 4 张 256256 图像。
Appendix A Token dependency in VQVAE
附录 A VQVAE 中的词元依赖
To examine the token dependency in VQVAE [30], we check the attention scores in the self-attention layer before the vector quantization module. We randomly sample 4 256256 images from the ImageNet validation set for this analysis. Note the self-attention layer in [30] only has 1 head so for each image we just plot one attention map. The heat map in Fig. 9 shows the attention scores of each token to all other tokens, which indicate a strong, bidirectional dependency among all tokens. This is not surprising since the VQVAE model, trained to reconstruct images, leverages self-attention layers without any attention mask. Some work [86] has used causal attention in self-attention layers of a video VAE, but we did not find any image VAE work uses causal self-attention.
为考察 VQVAE [30] 中的词元依赖,我们检查向量量化模块前自注意力层的注意力分数。为此从 ImageNet 验证集随机采样 4 张 256256 图像。注意 [30] 中自注意力层只有 1 个头,故每张图像只画一张注意力图。图 9 热图显示每个词元对所有其他词元的注意力分数,表明全部词元之间存在强烈的双向依赖。这并不意外:VQVAE 为重建图像而训练,使用无注意力掩码的自注意力层。有工作 [86] 在视频 VAE 的自注意力层使用因果注意力,但我们未发现图像 VAE 工作使用因果自注意力。
Appendix B Time complexity of AR and VAR generation
附录 B AR 与 VAR 生成的时间复杂度
We prove the time complexity of AR and VAR generation.
我们证明 AR 与 VAR 生成的时间复杂度。
Lemma B.1.
For a standard self-attention transformer, the time complexity of AR generation is , where and are the height and width of the VQ code map, respectively.
引理 B.1。
对标准自注意力 Transformer,AR 生成的时间复杂度为 ,其中 , 分别为 VQ 码图的高与宽。
Proof.
The total number of tokens is . For the -th () autoregressive iteration, the attention scores between each token and all other tokens need to be computed, which requires time. So the total time complexity would be:
证明。
词元总数为 。对第 次()自回归迭代,需计算每个词元与所有其他词元之间的注意力分数,耗时 。因此总时间复杂度为:
Which is equivalent to basic computation. ∎
等价于 次基本运算。∎
For VAR, it needs us to define the resolution sequense for autoregressive generation, where are the height and width of the VQ code map at the -th autoregressive step, and reaches the final resolution. Suppose for all and , for simplicity. We set the resolutions as where is a constant such that .
对 VAR,需要为自回归生成定义分辨率序列 ,其中 为第 个自回归步 VQ 码图的高与宽,且 、 达到最终分辨率。为简化,设对所有 有 ,且 。我们设分辨率为 ,其中常数 满足 。
Lemma B.2.
For a standard self-attention transformer and given hyperparameter , the time complexity of VAR generation is , where and are the height and width of the last (largest) VQ code map, respectively.
引理 B.2。
对标准自注意力 Transformer 及给定超参数 ,VAR 生成的时间复杂度为 ,其中 , 为最后(最大)VQ 码图的高与宽。
Proof.
Consider the -th () autoregressive generation. The total number of tokens of current all token maps is:
证明。
考虑第 次()自回归生成。当前全部词元图 的词元总数为:
So the time complexity of the -th autoregressive generation would be:
因此第 次自回归生成的时间复杂度为:
By summing up all autoregressive generations, we have:
对所有自回归生成求和,有:
This completes the proof. ∎
证毕。∎
图 10:ImageNet 256256 基准上的模型比较。更多 VAR 生成的 512512 样本见提交的补充材料压缩包。
图 11:VAR 在 ImageNet 上训练后生成的部分 256256 样本。更多 VAR 生成的 512512 样本见提交的补充材料压缩包。
References
参考文献
[1] J. Achiam, S. Adler, S. Agarwal, L. Ahmad, I. Akkaya, F. L. Aleman, D. Almeida, J. Altenschmidt, S. Altman, S. Anadkat, et al. Gpt-4 technical report. arXiv preprint arXiv:2303.08774 , 2023.
[2] J.-B. Alayrac, J. Donahue, P. Luc, A. Miech, I. Barr, Y. Hasson, K. Lenc, A. Mensch, K. Millican, M. Reynolds, et al. Flamingo: a visual language model for few-shot learning. Advances in neural information processing systems , 35:23716–23736, 2022.
[3] Alpha-VLLM. Large-dit-imagenet. https://github.com/Alpha-VLLM/LLaMA2-Accessory/tree/f7fe19834b23e38f333403b91bb0330afe19f79e/Large-DiT-ImageNet , 2024.
[4] R. Anil, A. M. Dai, O. Firat, M. Johnson, D. Lepikhin, A. Passos, S. Shakeri, E. Taropa, P. Bailey, Z. Chen, et al. Palm 2 technical report. arXiv preprint arXiv:2305.10403 , 2023.
[5] J. Bai, S. Bai, Y. Chu, Z. Cui, K. Dang, X. Deng, Y. Fan, W. Ge, Y. Han, F. Huang, et al. Qwen technical report. arXiv preprint arXiv:2309.16609 , 2023.
[6] Y. Bai, X. Geng, K. Mangalam, A. Bar, A. Yuille, T. Darrell, J. Malik, and A. A. Efros. Sequential modeling enables scalable learning for large vision models. arXiv preprint arXiv:2312.00785 , 2023.
[7] F. Bao, C. Li, J. Zhu, and B. Zhang. Analytic-dpm: an analytic estimate of the optimal reverse variance in diffusion probabilistic models. arXiv preprint arXiv:2201.06503 , 2022.
[8] F. Bao, S. Nie, K. Xue, Y. Cao, C. Li, H. Su, and J. Zhu. All are worth words: A vit backbone for diffusion models. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition , pages 22669–22679, 2023.
[9] F. Bao, C. Xiang, G. Yue, G. He, H. Zhu, K. Zheng, M. Zhao, S. Liu, Y. Wang, and J. Zhu. Vidu: a highly consistent, dynamic and skilled text-to-video generator with diffusion models. arXiv preprint arXiv:2405.04233 , 2024.
[10] H. Bao, L. Dong, S. Piao, and F. Wei. Beit: Bert pre-training of image transformers. arXiv preprint arXiv:2106.08254 , 2021.
[11] A. Bar, Y. Gandelsman, T. Darrell, A. Globerson, and A. Efros. Visual prompting via image inpainting. Advances in Neural Information Processing Systems , 35:25005–25017, 2022.
[12] O. Bar-Tal, H. Chefer, O. Tov, C. Herrmann, R. Paiss, S. Zada, A. Ephrat, J. Hur, Y. Li, T. Michaeli, et al. Lumiere: A space-time diffusion model for video generation. arXiv preprint arXiv:2401.12945 , 2024.
[13] A. Brock, J. Donahue, and K. Simonyan. Large scale gan training for high fidelity natural image synthesis. arXiv preprint arXiv:1809.11096 , 2018.
[14] T. Brooks, B. Peebles, C. Holmes, W. DePue, Y. Guo, L. Jing, D. Schnurr, J. Taylor, T. Luhman, E. Luhman, C. Ng, R. Wang, and A. Ramesh. Video generation models as world simulators. OpenAI , 2024.
[15] T. Brown, B. Mann, N. Ryder, M. Subbiah, J. D. Kaplan, P. Dhariwal, A. Neelakantan, P. Shyam, G. Sastry, A. Askell, et al. Language models are few-shot learners. Advances in neural information processing systems , 33:1877–1901, 2020.
[16] H. Chang, H. Zhang, J. Barber, A. Maschinot, J. Lezama, L. Jiang, M.-H. Yang, K. Murphy, W. T. Freeman, M. Rubinstein, et al. Muse: Text-to-image generation via masked generative transformers. arXiv preprint arXiv:2301.00704 , 2023.
[17] H. Chang, H. Zhang, L. Jiang, C. Liu, and W. T. Freeman. Maskgit: Masked generative image transformer. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition , pages 11315–11325, 2022.
[18] J. Chen, C. Ge, E. Xie, Y. Wu, L. Yao, X. Ren, Z. Wang, P. Luo, H. Lu, and Z. Li. Pixart- \ \backslash sigma: Weak-to-strong training of diffusion transformer for 4k text-to-image generation. arXiv preprint arXiv:2403.04692 , 2024.
[19] J. Chen, J. Yu, C. Ge, L. Yao, E. Xie, Y. Wu, Z. Wang, J. Kwok, P. Luo, H. Lu, et al. Pixart: Fast training of diffusion transformer for photorealistic text-to-image synthesis. arXiv preprint arXiv:2310.00426 , 2023.
[20] M. Chen, A. Radford, R. Child, J. Wu, H. Jun, D. Luan, and I. Sutskever. Generative pretraining from pixels. In International conference on machine learning , pages 1691–1703. PMLR, 2020.
[21] Z. Chen, J. Wu, W. Wang, W. Su, G. Chen, S. Xing, Z. Muyan, Q. Zhang, X. Zhu, L. Lu, et al. Internvl: Scaling up vision foundation models and aligning for generic visual-linguistic tasks. arXiv preprint arXiv:2312.14238 , 2023.
[22] A. Chowdhery, S. Narang, J. Devlin, M. Bosma, G. Mishra, A. Roberts, P. Barham, H. W. Chung, C. Sutton, S. Gehrmann, et al. Palm: Scaling language modeling with pathways. Journal of Machine Learning Research , 24(240):1–113, 2023.
[23] X. Dai, J. Hou, C.-Y. Ma, S. Tsai, J. Wang, R. Wang, P. Zhang, S. Vandenhende, X. Wang, A. Dubey, et al. Emu: Enhancing image generation models using photogenic needles in a haystack. arXiv preprint arXiv:2309.15807 , 2023.
[24] J. Deng, W. Dong, R. Socher, L.-J. Li, K. Li, and L. Fei-Fei. Imagenet: A large-scale hierarchical image database. In 2009 IEEE conference on computer vision and pattern recognition , pages 248–255. Ieee, 2009.
[25] J. Devlin, M.-W. Chang, K. Lee, and K. Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805 , 2018.
[26] P. Dhariwal and A. Nichol. Diffusion models beat gans on image synthesis. Advances in neural information processing systems , 34:8780–8794, 2021.
[27] R. Dong, C. Han, Y. Peng, Z. Qi, Z. Ge, J. Yang, L. Zhao, J. Sun, H. Zhou, H. Wei, et al. Dreamllm: Synergistic multimodal comprehension and creation. arXiv preprint arXiv:2309.11499 , 2023.
[28] A. Dosovitskiy, L. Beyer, A. Kolesnikov, D. Weissenborn, X. Zhai, T. Unterthiner, M. Dehghani, M. Minderer, G. Heigold, S. Gelly, et al. An image is worth 16x16 words: Transformers for image recognition at scale. arXiv preprint arXiv:2010.11929 , 2020.
[29] P. Esser, S. Kulal, A. Blattmann, R. Entezari, J. Müller, H. Saini, Y. Levi, D. Lorenz, A. Sauer, F. Boesel, D. Podell, T. Dockhorn, Z. English, K. Lacey, A. Goodwin, Y. Marek, and R. Rombach. Scaling rectified flow transformers for high-resolution image synthesis, 2024.
[30] P. Esser, R. Rombach, and B. Ommer. Taming transformers for high-resolution image synthesis. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition , pages 12873–12883, 2021.
[31] Y. Ge, S. Zhao, Z. Zeng, Y. Ge, C. Li, X. Wang, and Y. Shan. Making llama see and draw with seed tokenizer. arXiv preprint arXiv:2310.01218 , 2023.
[32] Y. Ge, S. Zhao, J. Zhu, Y. Ge, K. Yi, L. Song, C. Li, X. Ding, and Y. Shan. Seed-x: Multimodal models with unified multi-granularity comprehension and generation. arXiv preprint arXiv:2404.14396 , 2024.
[33] A. Gupta, L. Yu, K. Sohn, X. Gu, M. Hahn, L. Fei-Fei, I. Essa, L. Jiang, and J. Lezama. Photorealistic video generation with diffusion models. arXiv preprint arXiv:2312.06662 , 2023.
[34] K. He, X. Chen, S. Xie, Y. Li, P. Dollár, and R. Girshick. Masked autoencoders are scalable vision learners. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition , pages 16000–16009, 2022.
[35] T. Henighan, J. Kaplan, M. Katz, M. Chen, C. Hesse, J. Jackson, H. Jun, T. B. Brown, P. Dhariwal, S. Gray, et al. Scaling laws for autoregressive generative modeling. arXiv preprint arXiv:2010.14701 , 2020.
[36] J. Ho, C. Saharia, W. Chan, D. J. Fleet, M. Norouzi, and T. Salimans. Cascaded diffusion models for high fidelity image generation. The Journal of Machine Learning Research , 23(1):2249–2281, 2022.
[37] J. Ho and T. Salimans. Classifier-free diffusion guidance. arXiv preprint arXiv:2207.12598 , 2022.
[38] J. Hoffmann, S. Borgeaud, A. Mensch, E. Buchatskaya, T. Cai, E. Rutherford, D. d. L. Casas, L. A. Hendricks, J. Welbl, A. Clark, et al. Training compute-optimal large language models. arXiv preprint arXiv:2203.15556 , 2022.
[39] L. Huang, W. Yu, W. Ma, W. Zhong, Z. Feng, H. Wang, Q. Chen, W. Peng, X. Feng, B. Qin, et al. A survey on hallucination in large language models: Principles, taxonomy, challenges, and open questions. arXiv preprint arXiv:2311.05232 , 2023.
[40] M. Jia, L. Tang, B.-C. Chen, C. Cardie, S. Belongie, B. Hariharan, and S.-N. Lim. Visual prompt tuning. In European Conference on Computer Vision , pages 709–727. Springer, 2022.
[41] Y. Jin, K. Xu, L. Chen, C. Liao, J. Tan, B. Chen, C. Lei, A. Liu, C. Song, X. Lei, et al. Unified language-vision pretraining with dynamic discrete visual tokenization. arXiv preprint arXiv:2309.04669 , 2023.
[42] M. Kang, J.-Y. Zhu, R. Zhang, J. Park, E. Shechtman, S. Paris, and T. Park. Scaling up gans for text-to-image synthesis. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition , pages 10124–10134, 2023.
[43] J. Kaplan, S. McCandlish, T. Henighan, T. B. Brown, B. Chess, R. Child, S. Gray, A. Radford, J. Wu, and D. Amodei. Scaling laws for neural language models. arXiv preprint arXiv:2001.08361 , 2020.
[44] T. Karras, T. Aila, S. Laine, and J. Lehtinen. Progressive growing of gans for improved quality, stability, and variation. arXiv preprint arXiv:1710.10196 , 2017.
[45] T. Karras, M. Aittala, S. Laine, E. Härkönen, J. Hellsten, J. Lehtinen, and T. Aila. Alias-free generative adversarial networks. Advances in Neural Information Processing Systems , 34:852–863, 2021.
[46] T. Karras, S. Laine, and T. Aila. A style-based generator architecture for generative adversarial networks. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition , pages 4401–4410, 2019.
[47] T. Karras, S. Laine, M. Aittala, J. Hellsten, J. Lehtinen, and T. Aila. Analyzing and improving the image quality of stylegan. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition , pages 8110–8119, 2020.
[48] A. Kirillov, E. Mintun, N. Ravi, H. Mao, C. Rolland, L. Gustafson, T. Xiao, S. Whitehead, A. C. Berg, W.-Y. Lo, et al. Segment anything. arXiv preprint arXiv:2304.02643 , 2023.
[49] A. Kuznetsova, H. Rom, N. Alldrin, J. Uijlings, I. Krasin, J. Pont-Tuset, S. Kamali, S. Popov, M. Malloci, A. Kolesnikov, et al. The open images dataset v4: Unified image classification, object detection, and visual relationship detection at scale. International Journal of Computer Vision , 128(7):1956–1981, 2020.
[50] D. Lee, C. Kim, S. Kim, M. Cho, and W.-S. Han. Autoregressive image generation using residual quantization. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition , pages 11523–11532, 2022.
[51] T. Li, D. Katabi, and K. He. Self-conditioned image generation via generating representations. arXiv preprint arXiv:2312.03701 , 2023.
[52] T.-Y. Lin, P. Dollár, R. Girshick, K. He, B. Hariharan, and S. Belongie. Feature pyramid networks for object detection. In Proceedings of the IEEE conference on computer vision and pattern recognition , pages 2117–2125, 2017.
[53] H. Liu, C. Li, Q. Wu, and Y. J. Lee. Visual instruction tuning. Advances in neural information processing systems , 36, 2024.
[54] D. G. Lowe. Object recognition from local scale-invariant features. In Proceedings of the seventh IEEE international conference on computer vision , volume 2, pages 1150–1157. Ieee, 1999.
[55] C. Lu, Y. Zhou, F. Bao, J. Chen, C. Li, and J. Zhu. Dpm-solver: A fast ode solver for diffusion probabilistic model sampling in around 10 steps. Advances in Neural Information Processing Systems , 35:5775–5787, 2022.
[56] C. Lu, Y. Zhou, F. Bao, J. Chen, C. Li, and J. Zhu. Dpm-solver++: Fast solver for guided sampling of diffusion probabilistic models. arXiv preprint arXiv:2211.01095 , 2022.
[57] J. Lu, C. Clark, S. Lee, Z. Zhang, S. Khosla, R. Marten, D. Hoiem, and A. Kembhavi. Unified-io 2: Scaling autoregressive multimodal models with vision, language, audio, and action. arXiv preprint arXiv:2312.17172 , 2023.
[58] J. Lu, C. Clark, R. Zellers, R. Mottaghi, and A. Kembhavi. Unified-io: A unified model for vision, language, and multi-modal tasks. arXiv preprint arXiv:2206.08916 , 2022.
[59] F. Mentzer, D. Minnen, E. Agustsson, and M. Tschannen. Finite scalar quantization: Vq-vae made simple. arXiv preprint arXiv:2309.15505 , 2023.
[60] A. Nichol, P. Dhariwal, A. Ramesh, P. Shyam, P. Mishkin, B. McGrew, I. Sutskever, and M. Chen. Glide: Towards photorealistic image generation and editing with text-guided diffusion models. arXiv preprint arXiv:2112.10741 , 2021.
[61] M. Oquab, T. Darcet, T. Moutakanni, H. Vo, M. Szafraniec, V. Khalidov, P. Fernandez, D. Haziza, F. Massa, A. El-Nouby, et al. Dinov2: Learning robust visual features without supervision. arXiv preprint arXiv:2304.07193 , 2023.
[62] L. Ouyang, J. Wu, X. Jiang, D. Almeida, C. Wainwright, P. Mishkin, C. Zhang, S. Agarwal, K. Slama, A. Ray, et al. Training language models to follow instructions with human feedback. Advances in Neural Information Processing Systems , 35:27730–27744, 2022.
[63] W. Peebles and S. Xie. Scalable diffusion models with transformers. In Proceedings of the IEEE/CVF International Conference on Computer Vision , pages 4195–4205, 2023.
[64] A. Radford, J. W. Kim, C. Hallacy, A. Ramesh, G. Goh, S. Agarwal, G. Sastry, A. Askell, P. Mishkin, J. Clark, et al. Learning transferable visual models from natural language supervision. In International conference on machine learning , pages 8748–8763. PMLR, 2021.
[65] A. Radford, K. Narasimhan, T. Salimans, I. Sutskever, et al. Improving language understanding by generative pre-training. article , 2018.
[66] A. Radford, J. Wu, R. Child, D. Luan, D. Amodei, I. Sutskever, et al. Language models are unsupervised multitask learners. OpenAI blog , 1(8):9, 2019.
[67] A. Ramesh, M. Pavlov, G. Goh, S. Gray, C. Voss, A. Radford, M. Chen, and I. Sutskever. Zero-shot text-to-image generation. In International Conference on Machine Learning , pages 8821–8831. PMLR, 2021.
[68] A. Razavi, A. Van den Oord, and O. Vinyals. Generating diverse high-fidelity images with vq-vae-2. Advances in neural information processing systems , 32, 2019.
[69] S. Reed, A. Oord, N. Kalchbrenner, S. G. Colmenarejo, Z. Wang, Y. Chen, D. Belov, and N. Freitas. Parallel multiscale autoregressive density estimation. In International conference on machine learning , pages 2912–2921. PMLR, 2017.
[70] R. Rombach, A. Blattmann, D. Lorenz, P. Esser, and B. Ommer. High-resolution image synthesis with latent diffusion models. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition , pages 10684–10695, 2022.
[71] C. Saharia, W. Chan, S. Saxena, L. Li, J. Whang, E. L. Denton, K. Ghasemipour, R. Gontijo Lopes, B. Karagol Ayan, T. Salimans, et al. Photorealistic text-to-image diffusion models with deep language understanding. Advances in Neural Information Processing Systems , 35:36479–36494, 2022.
[72] V. Sanh, A. Webson, C. Raffel, S. H. Bach, L. Sutawika, Z. Alyafeai, A. Chaffin, A. Stiegler, T. L. Scao, A. Raja, et al. Multitask prompted training enables zero-shot task generalization. arXiv preprint arXiv:2110.08207 , 2021.
[73] A. Sauer, T. Karras, S. Laine, A. Geiger, and T. Aila. Stylegan-t: Unlocking the power of gans for fast large-scale text-to-image synthesis. arXiv preprint arXiv:2301.09515 , 2023.
[74] A. Sauer, K. Schwarz, and A. Geiger. Stylegan-xl: Scaling stylegan to large diverse datasets. In ACM SIGGRAPH 2022 conference proceedings , pages 1–10, 2022.
[75] J. Song, C. Meng, and S. Ermon. Denoising diffusion implicit models. arXiv preprint arXiv:2010.02502 , 2020.
[76] Y. Song and S. Ermon. Generative modeling by estimating gradients of the data distribution. Advances in neural information processing systems , 32, 2019.
[77] Q. Sun, Q. Yu, Y. Cui, F. Zhang, X. Zhang, Y. Wang, H. Gao, J. Liu, T. Huang, and X. Wang. Generative pretraining in multimodality. arXiv preprint arXiv:2307.05222 , 2023.
[78] Y. Sun, S. Wang, S. Feng, S. Ding, C. Pang, J. Shang, J. Liu, X. Chen, Y. Zhao, Y. Lu, et al. Ernie 3.0: Large-scale knowledge enhanced pre-training for language understanding and generation. arXiv preprint arXiv:2107.02137 , 2021.
[79] G. Team, R. Anil, S. Borgeaud, Y. Wu, J.-B. Alayrac, J. Yu, R. Soricut, J. Schalkwyk, A. M. Dai, A. Hauth, et al. Gemini: a family of highly capable multimodal models. arXiv preprint arXiv:2312.11805 , 2023.
[80] C. Tian, X. Zhu, Y. Xiong, W. Wang, Z. Chen, W. Wang, Y. Chen, L. Lu, T. Lu, J. Zhou, et al. Mm-interleaved: Interleaved image-text generative modeling via multi-modal feature synchronizer. arXiv preprint arXiv:2401.10208 , 2024.
[81] K. Tian, Y. Jiang, Q. Diao, C. Lin, L. Wang, and Z. Yuan. Designing bert for convolutional networks: Sparse and hierarchical masked modeling. arXiv preprint arXiv:2301.03580 , 2023.
[82] H. Touvron, T. Lavril, G. Izacard, X. Martinet, M.-A. Lachaux, T. Lacroix, B. Rozière, N. Goyal, E. Hambro, F. Azhar, et al. Llama: Open and efficient foundation language models. arXiv preprint arXiv:2302.13971 , 2023.
[83] H. Touvron, L. Martin, K. Stone, P. Albert, A. Almahairi, Y. Babaei, N. Bashlykov, S. Batra, P. Bhargava, S. Bhosale, et al. Llama 2: Open foundation and fine-tuned chat models. arXiv preprint arXiv:2307.09288 , 2023.
[84] A. Van den Oord, N. Kalchbrenner, L. Espeholt, O. Vinyals, A. Graves, et al. Conditional image generation with pixelcnn decoders. Advances in neural information processing systems , 29, 2016.
[85] A. Van Den Oord, O. Vinyals, et al. Neural discrete representation learning. Advances in neural information processing systems , 30, 2017.
[86] R. Villegas, M. Babaeizadeh, P.-J. Kindermans, H. Moraldo, H. Zhang, M. T. Saffar, S. Castro, J. Kunze, and D. Erhan. Phenaki: Variable length video generation from open domain textual descriptions. In International Conference on Learning Representations , 2022.
[87] H. Wang, H. Tang, L. Jiang, S. Shi, M. F. Naeem, H. Li, B. Schiele, and L. Wang. Git: Towards generalist vision transformer through universal language interface. arXiv preprint arXiv:2403.09394 , 2024.
[88] W. Wang, Z. Chen, X. Chen, J. Wu, X. Zhu, G. Zeng, P. Luo, T. Lu, J. Zhou, Y. Qiao, et al. Visionllm: Large language model is also an open-ended decoder for vision-centric tasks. Advances in Neural Information Processing Systems , 36, 2024.
[89] X. Wang, W. Wang, Y. Cao, C. Shen, and T. Huang. Images speak in images: A generalist painter for in-context visual learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition , pages 6830–6839, 2023.
[90] B. Workshop, T. L. Scao, A. Fan, C. Akiki, E. Pavlick, S. Ilić, D. Hesslow, R. Castagné, A. S. Luccioni, F. Yvon, et al. Bloom: A 176b-parameter open-access multilingual language model. arXiv preprint arXiv:2211.05100 , 2022.
[91] Z. Xue, G. Song, Q. Guo, B. Liu, Z. Zong, Y. Liu, and P. Luo. Raphael: Text-to-image generation via large mixture of diffusion paths. arXiv preprint arXiv:2305.18295 , 2023.
[92] J. Yu, X. Li, J. Y. Koh, H. Zhang, R. Pang, J. Qin, A. Ku, Y. Xu, J. Baldridge, and Y. Wu. Vector-quantized image modeling with improved vqgan. arXiv preprint arXiv:2110.04627 , 2021.
[93] J. Yu, Y. Xu, J. Y. Koh, T. Luong, G. Baid, Z. Wang, V. Vasudevan, A. Ku, Y. Yang, B. K. Ayan, et al. Scaling autoregressive models for content-rich text-to-image generation. arXiv preprint arXiv:2206.10789 , 2(3):5, 2022.
[94] L. Yu, Y. Cheng, K. Sohn, J. Lezama, H. Zhang, H. Chang, A. G. Hauptmann, M.-H. Yang, Y. Hao, I. Essa, et al. Magvit: Masked generative video transformer. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition , pages 10459–10469, 2023.
[95] L. Yu, J. Lezama, N. B. Gundavarapu, L. Versari, K. Sohn, D. Minnen, Y. Cheng, A. Gupta, X. Gu, A. G. Hauptmann, et al. Language model beats diffusion–tokenizer is key to visual generation. arXiv preprint arXiv:2310.05737 , 2023.
[96] L. Yu, B. Shi, R. Pasunuru, B. Muller, O. Golovneva, T. Wang, A. Babu, B. Tang, B. Karrer, S. Sheynin, et al. Scaling autoregressive multi-modal models: Pretraining and instruction tuning. arXiv preprint arXiv:2309.02591 , 2(3), 2023.
[97] R. Zhang, P. Isola, A. A. Efros, E. Shechtman, and O. Wang. The unreasonable effectiveness of deep features as a perceptual metric. In Proceedings of the IEEE conference on computer vision and pattern recognition , pages 586–595, 2018.
[98] S. Zhang, S. Roller, N. Goyal, M. Artetxe, M. Chen, S. Chen, C. Dewan, M. Diab, X. Li, X. V. Lin, et al. Opt: Open pre-trained transformer language models. arXiv preprint arXiv:2205.01068 , 2022.
[99] C. Zheng, T.-L. Vuong, J. Cai, and D. Phung. Movq: Modulating quantized vectors for high-fidelity image generation. Advances in Neural Information Processing Systems , 35:23412–23425, 2022.










