RQ-Transformer (Residual-Quantized VAE + Transformer)
Residual-quantized VAE plus autoregressive transformer that generates 256x256 images from stacked 8x8x4 codes.
Diffusion and generative · 2,112 operations Structure only
Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.
At a glance
- Parameters
- 1.5B
- Operations
- 2,112
- Framework
- PyTorch
- Recurrent
- No
- Published
- CVPR 2022
- Cited by
- 293 (as of 27 October 2026)
- Authors
- Doyup Lee, Chiheon Kim, Saehoon Kim and others
- Checked
- Structure only: shapes and data types are hypotheses, not measurements.
Files
The file opened in a new tab. Use your browser's Save command there to keep it.
The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.
Details
- Stable ID
- m19690
- Graph hash
- e916f0673ba1bb6fa077f97dbf6cd96ecd3c4a9b18be8f29fabab3793359ba9d
- Skeleton hash
- bffd9d610f0eb6ec2b5cf0c612ef8dbeca96ab9c41a7e10be86ae8c8eadb0fed
- Architecture hash
- e9a4f548f83450d66c2c56cc8b348438cae423dbbf69b8d54207303488da454c
- Diagram SHA-256
- 09ec0e58a1ce543ec1980f28dfb59ce32d40cb0aec0b0334030b8eabb205c15f
- TorchLens version
- 2.36.0
- Renderer
- graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
What it is
This model runs both stages: the 8x8x4 ImageNet RQ-VAE feeding the ImageNet RQ-Transformer configuration that the README lists at 1.4B parameters. For a 256x256 image it returns, for each of the 8x8x4 code positions, scores over a codebook of 16384 entries.
RQ-Transformer is an autoregressive image generator built as a two-stage framework: a Residual-Quantized VAE (RQ-VAE) that turns an image into discrete codes, and an RQ-Transformer that predicts those codes. The paper starts from a trade-off: an autoregressive model needs a short code sequence to keep its computational cost down, but the authors argue that earlier vector quantization could not shorten the sequence and still produce high-fidelity images.
With a fixed codebook size, RQ-VAE approximates the image's feature map and represents the image as a stacked map of discrete codes. RQ-Transformer then predicts the quantized feature vector at the next position by predicting the next stack of codes. Because of this, a 256x256 image fits on an 8x8 feature map, which is the 8x8x4 code shape in the released ImageNet configurations.
The paper reports that the framework outperforms the existing autoregressive models on benchmarks of unconditional and conditional image generation, with significantly faster sampling than previous autoregressive models. After the paper, the authors also trained a 3.9B-parameter RQ-Transformer for text-to-image generation on about 30 million text-image pairs. The code is under Apache 2.0, while the pretrained weights are licensed CC-BY-NC-SA 4.0.
Key idea. This work built a two-stage image generator in which RQ-VAE encodes an image as stacked discrete codes and RQ-Transformer predicts the next stack of codes.
- rq-transformer
- rq-vae
- residual quantization
- residual-quantized vae
- autoregressive image generation
- image generation
- vector quantization
- imagenet
- text-to-image
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
Cite the paper
@misc{lee2022autoregressiveimagegenerationusing,
title={Autoregressive Image Generation using Residual Quantization},
author={Doyup Lee and Chiheon Kim and Saehoon Kim and Minsu Cho and Wook-Shin Han},
year={2022},
eprint={2203.01941},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2203.01941},
}