Skip to main content
QUICK REVIEW

[Paper Review] Autoregressive Model Beats Diffusion: Llama for Scalable Image Generation

Peize Sun, Yi Jiang|arXiv (Cornell University)|Jun 10, 2024
Advanced Image and Video Retrieval TechniquesComputer Science5 citations
TL;DR

LlamaGen shows vanilla autoregressive image generation (next-token prediction) can achieve state-of-the-art performance with proper tokenization, scaling, and data, outperforming diffusion models on ImageNet 256×256 in class-conditional settings and offering competitive text-conditional results.

ABSTRACT

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.

Motivation & Objective

  • Reassess whether vanilla autoregressive models can reach state-of-the-art in image generation without vision-specific inductive biases.
  • Design and evaluate an efficient image tokenizer suitable for AR models and measure reconstruction quality.
  • Scale autoregressive image models from tens of millions to billions of parameters and compare to diffusion baselines.
  • Explore data quality and training strategies (two-stage text-conditioned training) to improve visual fidelity and text alignment.
  • Demonstrate inference-speed gains using LLM-serving frameworks to enable practical deployment.

Proposed method

  • Use an image tokenizer (VQGAN-style encoder-quantizer-decoder) to discretize images into tokens with a downsample ratio p (evaluated at 16 and 8).
  • Train Transformer-based autoregressive models in the Llama family to predict next image tokens conditionally (class or text).
  • Apply classifier-free guidance (CFG) during training and inference to improve image quality and text alignment.
  • Adopt image-text encoding via FLAN-T5 XL for text-conditioned generation and perform two-stage training on LAION-COCO subset then high-aesthetic-quality internal data.
  • Leverage vLLM serving to accelerate inference, achieving substantial speedups over baseline.
  • Evaluate on ImageNet 256×256 using FID, IS, Precision/Recall, PSNR, SSIM and codebook usage; compare against diffusion and other autoregressive/tokenization baselines.

Experimental results

Research questions

  • RQ1Can a vanilla autoregressive image generator, with a carefully designed image tokenizer and training/scaling strategy, surpass diffusion models on standard benchmarks?
  • RQ2What tokenization, model scaling, and data strategies most strongly impact image reconstruction quality and generation fidelity in AR models?
  • RQ3How does classifier-free guidance affect quality/diversity trade-offs in AR-based image generation?
  • RQ4What are the speed/throughput gains when using LLM-serving frameworks (e.g., vLLM) for autoregressive image generation?

Key findings

  • A discrete image tokenizer with downsample ratio 16 achieves reconstruction quality 0.94 rFID and codebook usage of 97% on ImageNet; ratio 8 is competitive or better than continuous VAE used in diffusion models.
  • Class-conditional LlamaGen models range from 111M to 3.1B parameters; the largest model reaches 2.18 FID on ImageNet 256×256 and outperforms LDM and DiT baselines.
  • Text-conditional generation with 775M params (trained on 50M LAION-COCO + 10M high-aesthetic images) shows competitive visual quality and text alignment.
  • vLLM serving framework yields 326% - 414% speedup across models from 111M to 1.4B parameters; baseline already uses KV-Cache.
  • Scaling model size consistently improves FID up to XXL/3B, with diminishing returns beyond 3B given ImageNet data limits.
  • AR models with well-designed tokenizers and data can compete with or surpass diffusion models on standard benchmarks for 256×256 ImageNet.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.