Skip to main content
QUICK REVIEW

[Paper Review] Autoregressive Image Generation using Residual Quantization

Doyup Lee, Chiheon Kim|arXiv (Cornell University)|Mar 3, 2022
Advanced Vision and ImagingComputer Science8 citations
TL;DR

This paper proposes a two-stage framework, RQ-VAE and RQ-Transformer, for high-resolution autoregressive image generation using residual quantization. By applying coarse-to-fine residual quantization with a fixed codebook size, RQ-VAE reduces 256×256 images to an 8×8×4 code map, enabling RQ-Transformer to generate high-fidelity images with significantly lower computational cost and faster sampling than prior autoregressive models.

ABSTRACT

For autoregressive (AR) modeling of high-resolution images, vector quantization (VQ) represents an image as a sequence of discrete codes. A short sequence length is important for an AR model to reduce its computational costs to consider long-range interactions of codes. However, we postulate that previous VQ cannot shorten the code sequence and generate high-fidelity images together in terms of the rate-distortion trade-off. In this study, we propose the two-stage framework, which consists of Residual-Quantized VAE (RQ-VAE) and RQ-Transformer, to effectively generate high-resolution images. Given a fixed codebook size, RQ-VAE can precisely approximate a feature map of an image and represent the image as a stacked map of discrete codes. Then, RQ-Transformer learns to predict the quantized feature vector at the next position by predicting the next stack of codes. Thanks to the precise approximation of RQ-VAE, we can represent a 256$ imes$256 image as 8$ imes$8 resolution of the feature map, and RQ-Transformer can efficiently reduce the computational costs. Consequently, our framework outperforms the existing AR models on various benchmarks of unconditional and conditional image generation. Our approach also has a significantly faster sampling speed than previous AR models to generate high-quality images.

Motivation & Objective

  • To address the rate-distortion trade-off in autoregressive image generation, where reducing code sequence length is critical for computational efficiency but previous VQ methods fail to maintain image fidelity.
  • To enable high-resolution image generation with reduced computational cost by minimizing the sequence length of discrete codes through precise approximation of feature maps.
  • To improve training stability and performance of autoregressive models by resolving exposure bias using soft labeling and stochastic sampling techniques.
  • To achieve faster sampling speeds while maintaining or improving image quality compared to existing autoregressive models.

Proposed method

  • RQ-VAE uses residual quantization with a fixed-size codebook to iteratively refine feature map approximations in a coarse-to-fine manner, representing images as stacked discrete codes.
  • The model reduces spatial resolution to 8×8 for 256×256 images by applying 4 levels of residual quantization, preserving high-fidelity reconstruction without increasing codebook size.
  • RQ-Transformer processes the stacked codes as a sequence and autoregressively predicts the next code stack at each position, leveraging the reduced sequence length for efficiency.
  • Soft labeling and stochastic sampling are introduced during RQ-Transformer training to mitigate exposure bias and improve generalization.
  • The framework uses a raster-scan ordering to convert the 3D code map into a 1D sequence for autoregressive modeling.
  • Reconstruction fidelity is evaluated using rFID, and generation quality is measured via FID and Inception Score on benchmarks including ImageNet and LSUN.

Experimental results

Research questions

  • RQ1Can residual quantization with a fixed codebook size achieve better reconstruction quality and lower resolution than standard VQ-VAE for high-resolution image generation?
  • RQ2Does reducing the code sequence length via RQ-VAE enable faster and more efficient autoregressive modeling without sacrificing image quality?
  • RQ3To what extent do soft labeling and stochastic sampling improve the performance of RQ-Transformer by reducing exposure bias?
  • RQ4How does the proposed framework compare to prior autoregressive models in terms of FID, Inception Score, and sampling speed on unconditional and conditional image generation tasks?

Key findings

  • RQ-VAE with 8×8×4 code map and codebook size K=16,384 achieves significantly better reconstruction fidelity (rFID=10.2) than VQ-GAN with 16×16 maps, despite a 4× reduction in spatial resolution.
  • Increasing quantization depth D from 1 to 4 improves rFID by 3.1 points (from 13.3 to 10.2) with fixed K=16,384, demonstrating the effectiveness of residual quantization over increasing codebook size.
  • The RQ-Transformer achieves state-of-the-art FID scores of 10.2 on ImageNet 256×256 unconditional generation, outperforming previous autoregressive models.
  • The framework achieves a 2.5× faster sampling speed than previous autoregressive models while maintaining or improving image quality on LSUN, FFHQ, and CC-3M benchmarks.
  • Visualizations confirm that RQ-VAE performs coarse-to-fine reconstruction: deeper quantization levels add progressively finer image details, with lower-norm code embeddings used at higher depths.
  • Code usage distributions show significant overlap across depth levels, indicating efficient code reuse and effective utilization of the shared codebook.

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.