TL;DR
This paper introduces DC-AR, a novel masked autoregressive (AR) framework for text-to-image generation that significantly boosts efficiency and quality. It achieves this by introducing DC-HT, a hybrid tokenizer that compresses images by 32x while maintaining high fidelity, and a novel generation process that first creates structural elements with discrete tokens and then refines them with residual tokens.
What Problem Does This Paper Address?
The field of text-to-image generation has seen remarkable progress, largely dominated by diffusion models. However, autoregressive (AR) models, while offering advantages like better connections to vision-language models and potential for image editing, have historically lagged behind diffusion models in terms of both generation quality and computational efficiency. A key bottleneck for AR models has been the image tokenization process. Traditional tokenizers use spatial compression ratios of 8x or 16x, leading to a large number of tokens that increase computational cost. While some methods have explored higher compression ratios (e.g., 32x), applying them to discrete tokenizers for AR models has resulted in poor reconstruction quality or a loss of resolution generalization. Furthermore, existing 1D tokenizers, while achieving high compression, break spatial correspondence, making them unable to generalize across resolutions and increasing training costs.
Methods
The core of DC-AR lies in its Deep Compression Hybrid Tokenizer (DC-HT). This tokenizer is a 2D hybrid approach that aims for a 32x spatial compression ratio. It combines the strengths of both discrete and continuous tokenization. The novelty here is not just the hybrid approach but also the three-stage adaptation training strategy specifically designed to overcome the quality degradation often seen with high-compression discrete tokenizers. This strategy involves:
- Continuous Warm-up: Initializes the encoder with weights suitable for reconstruction using only the continuous path.
- Discrete Learning: Focuses on training the tokenizer to learn a stable latent space and reconstruct images effectively using only the discrete path.
- Alternate Fine-tuning: Freezes the encoder and quantizer, and fine-tunes the decoder to handle both continuous and discrete tokens, ensuring they are similar from the decoder's perspective.
Building on DC-HT, the DC-AR generation framework employs a hybrid masked autoregressive approach.
- Training: It uses a cross-entropy loss for predicting discrete tokens and a diffusion loss for predicting residual tokens. Textual guidance is incorporated via cross-attention layers.
- Inference: The framework first generates all discrete tokens using a progressive unmasking schedule (similar to MaskGIT). Then, the transformer's hidden states condition a lightweight diffusion MLP head to predict residual tokens. These discrete and residual tokens are combined to form the final continuous tokens, which are then decoded into an image. This two-stage process prioritizes structural coherence with discrete tokens and fine-grained detail with residual tokens.
Datasets
- Tokenizer Training: ImageNet (256x256 resolution)
- Tokenizer Evaluation: ImageNet validation set (256x256 and 512x512 resolutions)
- Text-to-Image Generation Evaluation:
- MJHQ-30K
- JourneyDB
- Internal MidJourney-style synthetic dataset
Key Insights and Ideas
- Hybrid Tokenization is Key for High Compression in AR: Simply pushing for higher compression with discrete tokens in AR models leads to significant quality loss. A hybrid approach, where discrete tokens handle structure and residual tokens handle refinement, is crucial for achieving both high compression and good quality.
- A Tailored Training Strategy is Essential for Hybrid Tokenizers: The proposed three-stage adaptation strategy is critical for making the high-compression hybrid tokenizer effective, outperforming simpler alternate training methods.
- 2D Tokenizers Offer Resolution Generalization: Unlike 1D tokenizers that break spatial correspondence, 2D tokenizers retain resolution generalizability. This allows for efficient "pre-training then fine-tuning" strategies for higher resolutions, significantly reducing training costs.
- Discrete Tokens for Structure, Residual for Refinement: The inference pipeline's design, where discrete tokens are predicted first for structural coherence and then residual tokens for fine details, is a clever way to leverage the strengths of AR models (fast inference with discrete tokens) and diffusion models (fine-grained refinement).
Key Results
- Image Tokenization: DC-HT achieves competitive reconstruction performance (rFID of 1.60 on ImageNet 256x256) compared to 1D tokenizers at the same 32x compression ratio. Crucially, it generalizes to 512x512 resolution without requiring separate training, unlike 1D tokenizers.
- Text-to-Image Generation Quality:
- Achieves state-of-the-art gFID of 5.49 on MJHQ-30K.
- Achieves an overall GenEval score of 0.69, matching top models.
- Efficiency:
- Latency: 2.0-3.5x lower latency compared to leading diffusion and AR models.
- Throughput: 1.5-7.9x higher throughput compared to leading diffusion and AR models.
- Requires only 12 sampling steps for optimal quality, significantly fewer than many AR models.
- Training Efficiency: The resolution-generalizable tokenizer enables a "pre-training then fine-tuning" strategy that reduces training costs for 512x512 models by over 1.9x.
Limitations and Future Work
- Hybrid Overhead: While the hybrid design offers significant advantages, it incurs a small additional overhead (around 10%) compared to a purely discrete-only baseline.
- Future Work: The paper implicitly suggests that further exploration of hybrid tokenization and generation strategies could lead to even greater efficiency and quality gains in autoregressive models. The resolution generalization capability of 2D tokenizers also opens doors for more flexible and efficient training pipelines for high-resolution generation.
Summary updated