TL;DR
This paper introduces a Coarse-to-Fine (CTF) token prediction framework that resolves a major bottleneck in autoregressive image generation: the complexity of using large VQ-VAE codebooks. By clustering visually similar tokens into a smaller set of "coarse" labels, the authors simplify the autoregressive generation task into a two-stage process that yields higher image quality, 3x faster training convergence, and faster inference speeds.
What Problem Does This Paper Address?
Autoregressive (AR) models generate images by treating them like text, predicting the "next token" in a sequence. To do this, continuous image pixels must first be converted into discrete tokens using vector quantization methods like VQ-VAE.
To minimize quantization errors and improve image details, recent state-of-the-art models have dramatically scaled up their codebook sizes—expanding from 1,024 entries to as many as 262,144. However, this massive vocabulary makes the next-token prediction task incredibly difficult for the AR transformer. In fact, even top-tier models struggle, achieving less than 7% token prediction accuracy on ImageNet. This creates a frustrating tension: large codebooks are necessary for high-quality image reconstruction, but they severely complicate the generative modeling process.
Methods
The authors propose a two-stage Coarse-to-Fine (CTF) prediction framework to get the best of both worlds:
- Token Clustering: Before training, the $K$ fine-grained codewords from a large codebook (e.g., 16,384) are grouped into $M$ distinct clusters (e.g., 512) using standard $k$-means clustering based on their Euclidean distance in the embedding space. Each cluster represents a "coarse label."
- Stage 1 (Autoregressive Coarse Prediction): A standard causal transformer sequentially predicts the coarse label (cluster index) for each token position. Because the vocabulary size is reduced 32-fold (from 16,384 to 512), this task is significantly easier for the model.
- Stage 2 (Parallel Fine Prediction): Conditioned on the complete sequence of coarse labels, an auxiliary full-attention transformer simultaneously predicts the fine-grained labels (the original codebook indices) for all tokens in a single parallel step.
Crucially, the Stage 1 and Stage 2 models are independent during training, meaning they can be trained in parallel.
Datasets
The framework was trained and evaluated on the standard ImageNet-1K benchmark for class-conditional image generation at $256 \times 256$ resolution. Performance was measured using standard metrics: Fréchet Inception Distance (FID), Inception Score (IS), precision, and recall.
Key Insights and Ideas
- Visual Token Redundancy: Unlike natural language, where swapping a single word can completely change a sentence's meaning, images possess high token redundancy. Substituting an image token with a visually similar one from the same cluster results in almost imperceptible visual differences. Current AR models waste parameters trying to distinguish between these nearly identical choices.
- Compounding Efficiency Gains: Intuitively, adding a second model (Stage 2) should slow down inference. However, because the Stage 1 AR model operates on a much smaller vocabulary, its final fully connected layer is significantly smaller. Since the AR model must run sequentially for every single token (e.g., 256 times), this reduction in vocabulary size creates compounding efficiency benefits that easily outweigh the single-step computational overhead of the Stage 2 model.
Key Results
- Higher Image Quality: The CTF framework consistently outperformed baseline models across various sizes (100M to 775M parameters). Applying CTF to the LlamaGen-B baseline dropped the FID score from 5.46 to 4.15 and boosted the Inception Score (IS) from 193.61 to 254.99.
- 3x Faster Training: The CTF model achieved an FID of 5.43 after just 100 epochs, matching the baseline model's performance at 300 epochs.
- Faster Sampling: Despite the two-stage inference process, the proposed method achieved faster generation speeds in most configurations. For instance, LlamaGen-L with CTF generated 8.71 images per second compared to the baseline's 7.50 images per second on an NVIDIA A100 GPU.
- Plug-and-Play Compatibility: The framework is agnostic to the underlying AR architecture and can be combined with other advanced techniques. Combining CTF with RandAR achieved a state-of-the-art FID of 2.39 and an IS of 301.11.
Limitations and Future Work
- Hyperparameter Sensitivity: The performance relies heavily on finding the optimal number of clusters. If the number of clusters is too low (e.g., 128), the Stage 2 model struggles to predict the correct fine label in a single step. If it is too high, the Stage 1 task becomes too difficult.
- Diversity vs. Quality Trade-off: Because the coarse prediction task is simplified, the model exhibits high confidence, which can reduce generation diversity. The authors note that careful tuning of temperature control (e.g., setting $\tau=1.1$) is required to maintain optimal diversity and FID scores.
- Future Directions: The authors suggest exploring the application of this framework to even larger vocabulary spaces (e.g., 262,144 tokens).
Summary updated