[论文解读] Autoregressive Model Beats Diffusion: Llama for Scalable Image Generation
LlamaGen 表示,在经过恰当的分词、扩展和数据支持下,纯自回归的图像生成(下一token预测)可以达到最先进的性能,在 ImageNet 256×256 的类别条件设置中超越扩散模型,并在文本条件下也具备竞争力的结果。
We introduce LlamaGen, a new family of image generation models that apply original ``next-token prediction'' paradigm of large language models to visual generation domain. It is an affirmative answer to whether vanilla autoregressive models, e.g., Llama, without inductive biases on visual signals can achieve state-of-the-art image generation performance if scaling properly. We reexamine design spaces of image tokenizers, scalability properties of image generation models, and their training data quality. The outcome of this exploration consists of: (1) An image tokenizer with downsample ratio of 16, reconstruction quality of 0.94 rFID and codebook usage of 97% on ImageNet benchmark. (2) A series of class-conditional image generation models ranging from 111M to 3.1B parameters, achieving 2.18 FID on ImageNet 256x256 benchmarks, outperforming the popular diffusion models such as LDM, DiT. (3) A text-conditional image generation model with 775M parameters, from two-stage training on LAION-COCO and high aesthetics quality images, demonstrating competitive performance of visual quality and text alignment. (4) We verify the effectiveness of LLM serving frameworks in optimizing the inference speed of image generation models and achieve 326% - 414% speedup. We release all models and codes to facilitate open-source community of visual generation and multimodal foundation models.
研究动机与目标
- 重新评估在没有视觉特定归纳偏置的情况下,纯自回归模型是否能够在图像生成方面达到最先进水平。
- 设计并评估一个适用于 AR 模型的高效图像分词器,并衡量重构质量。
- 将自回归图像模型的规模从数千万参数扩展到数十亿参数,并与扩散基线进行比较。
- 探索数据质量和训练策略(两阶段文本条件训练)以提升视觉保真度和文本对齐。
- 展示使用 LLM-服务框架实现推理加速,以实现实际部署。
提出的方法
- 使用图像分词器(VQGAN 风格的编码器-量化器-解码器)将图像离散化为 tokens,下降采样比率 p(在 16 和 8 处进行评估)。
- 训练基于 Transformer 的自回归模型(Llama 家族)以有条件地预测下一个图像 tokens(类别或文本)。
- 在训练和推理阶段应用无分类器引导(CFG),以提升图像质量和文本对齐。
- 采用 FLAN-T5 XL 进行图像-文本编码以实现文本条件生成,并在 LAION-COCO 子集上进行两阶段训练,然后在高美学质量的内部数据上进行训练。
- 利用 vLLM 服务加速推理,相对于基线获得显著的速度提升。
- 在 ImageNet 256×256 上使用 FID、IS、Precision/Recall、PSNR、SSIM 和 codebook 使用情况进行评估;并与扩散及其他自回归/分词基线进行比较。
实验结果
研究问题
- RQ1在经过精心设计的图像分词器以及训练/扩展策略下,普通自回归图像生成器能否在标准基准上超过扩散模型?
- RQ2哪些分词、模型规模与数据策略最显著地影响自回归模型的图像重建质量和生成保真度?
- RQ3无分类器引导(classifier-free guidance)如何影响基于自回归的图像生成中的质量与多样性权衡?
- RQ4使用 LLM-服务框架(如 vLLM)进行自回归图像生成时,速度/吞吐量的提升是多少?
主要发现
- 使用下采样比率为 16 的离散图像分词器在 ImageNet 上实现重构质量 0.94 rFID 和 codebook 使用率 97%;比率 8 的表现与扩散模型中使用的连续 VAE 具有竞争力甚至更好。
- 类别条件的 LlamaGen 模型参数量从 111M 到 3.1B;最大模型在 ImageNet 256×256 上达到 2.18 FID,并优于 LDM 与 DiT 基线。
- 775M 参数的文本条件生成(在 50M LAION-COCO + 10M 高美学图像上训练)显示出有竞争力的视觉质量与文本对齐。
- vLLM 服务框架在 111M 至 1.4B 参数的模型上实现了 326% - 414% 的加速;基线已使用 KV-Cache。
- 模型规模的扩展在达到 XXL/3B 时持续改善 FID,但超过 3B 时回报递减,原因是 ImageNet 数据的限制。
- 具备良好设计的分词器和数据的 AR 模型,在 256×256 ImageNet 的标准基准上可以与扩散模型竞争甚至超越之。
阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。