Autoregressive Image Generation without Vector Quantization

Tianhong Li, Yonglong Tian, He Li, Mingyang Deng, Kaiming He

TL;DR

This paper challenges the long-standing assumption that autoregressive (AR) image generation requires discrete, vector-quantized tokens. By replacing categorical cross-entropy with a novel "Diffusion Loss" to model continuous-valued tokens, the authors achieve state-of-the-art image synthesis (1.55 FID on ImageNet) while maintaining the high-speed advantages of sequence modeling.

The Discretization Bottleneck

In the world of generative AI, there has historically been a Great Divide: Autoregressive models (like GPT) dominate text by predicting the next discrete token, while Diffusion models (like Stable Diffusion) dominate images by denoising continuous signals.

To make continuous images work with AR models, researchers typically "discretize" them using Vector Quantization (VQ). This involves training a VQ-VAE to turn image patches into a finite vocabulary of "visual words." However, VQ introduces a significant bottleneck—it is notoriously difficult to train, highly sensitive to hyperparameters, and often results in a loss of fine image quality compared to continuous representations.

The authors ask a fundamental question: Is discretization actually necessary for autoregressive modeling? They argue that the core of AR is simply predicting the next value based on previous ones. Whether that value is a discrete category or a continuous point shouldn't matter, provided you have the right mathematical framework to model the probability distribution.

Methodology: Continuous AR via Diffusion Loss

The authors introduce a framework that allows AR models to operate directly in continuous-valued latent spaces, bypassing the need for a discrete tokenizer.

1. Diffusion Loss

Instead of using a standard classifier head to predict a discrete category index via cross-entropy, the AR model outputs a continuous conditioning vector $z$ for each token. This $z$ is then fed into a "micro" denoising network—a small Multi-Layer Perceptron (MLP).

Diffusion Loss Framework

This MLP learns to represent the probability distribution of the continuous token given the context $z$ through a localized diffusion process. At inference time, the model predicts the context $z$, and the tiny MLP runs a few steps of reverse diffusion to sample the actual continuous values for the image patches.

2. Masked Autoregressive (MAR) Models

The authors also generalize the AR concept to improve efficiency and global context. While standard AR models predict tokens strictly one-by-one in a "raster" (left-to-right, top-to-bottom) order, the proposed MAR framework predicts multiple tokens simultaneously in a randomized order.

Autoregressive Variants

3. Bidirectional Attention

Unlike the "causal" masking used in standard Large Language Models (where a token can only attend to preceding tokens), MAR utilizes bidirectional attention. Because the generation order is randomized and masked, tokens can communicate more effectively during the encoding phase, significantly improving the global coherence and generation quality of the final image.

Key Insights

  • VQ is a Choice, Not a Requirement: The categorical distribution used in GPT is just one way to model "what comes next." Diffusion is simply a more powerful tool for modeling that same probability in a continuous space.
  • Local vs. Global Diffusion: Most diffusion models (like DiT) use a massive Transformer to denoise the entire image at once. In this paper, the Transformer handles the relationship between tokens (the AR sequence modeling), while a tiny MLP handles the local distribution of each individual token. This division of labor makes the model remarkably fast.
  • Flexibility with Tokenizers: Because the model doesn't rely on a fixed vocabulary, it can work with various types of continuous tokenizers, even those not originally intended for autoregressive tasks.

Results and Performance

The models were primarily trained and evaluated on ImageNet 256×256 and 512×512, utilizing pre-trained VAE tokenizers from the Latent Diffusion Model (LDM) codebase (treating their outputs as continuous vectors).

  • State-of-the-Art Quality: The largest model variant (MAR-H) achieved an impressive FID of 1.55 on ImageNet 256×256. This outperforms previous AR models and is highly competitive with strong diffusion models like DiT-XL/2.
  • Impressive Speed: The MAR model can generate an image in less than 0.3 seconds, significantly faster than many iterative global diffusion models while maintaining higher accuracy.
  • Scaling Laws: The authors observed clear scaling benefits. As they increased the model size from MAR-B to MAR-H, performance consistently improved, suggesting this continuous AR approach benefits from the same scaling properties as LLMs.

Limitations and Future Work

Despite the strong results, the system shares limitations common to generative models, such as occasionally producing visual artifacts (e.g., distorted textures or illogical structures in highly complex scenes). Furthermore, while the quantization step is eliminated, the system still relies on a pre-trained VAE to compress pixels into continuous latents. Scaling pure pixel-space AR to high resolutions remains computationally expensive due to the massive sequence lengths required.

Ultimately, this work successfully demonstrates that the "discretization trap" can be avoided. By bridging sequence modeling and diffusion, it opens the door for autoregressive generation to be applied more naturally across other continuous-valued domains like video and audio.

Summary updated

BibTeX
@inproceedings{li2024autoregressive,
  author = {Tianhong Li and Yonglong Tian and He Li and Mingyang Deng and Kaiming He},
  title = {{Autoregressive Image Generation without Vector Quantization}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=VNBIF0gmkb},
}
Figure