Image Understanding Makes for A Good Tokenizer for Image Generation

Luting Wang, Yang Zhao, Zijian Zhang, Jiashi Feng, Si Liu, Bingyi Kang · DOI

Abstract

Traditional image generation models rely on tokenizers trained to reconstruct raw pixels, often resulting in discrete representations that lack semantic coherence. This paper introduces a paradigm shift by demonstrating that tokenizers trained to reconstruct high-level features from Image Understanding (IU) models—such as CLIP, DINO, or MAE—significantly outperform pixel-based counterparts. By distilling semantic knowledge into the generator's discrete vocabulary, the authors achieve a state-of-the-art 4.10 FID on ImageNet-1k, establishing that superior image understanding is a direct catalyst for superior image creation.

Introduction

In the landscape of Autoregressive (AR) image generation, images are processed similarly to text: they are decomposed into a sequence of discrete tokens. Historically, the standard tool for this task has been the VQGAN tokenizer, which is optimized for pixel-perfect reconstruction. However, pixel-level fidelity does not necessarily translate to generative efficiency. A generator's proposal network often struggles when tokens represent low-level pixel patterns rather than high-level concepts.

This research addresses the "reciprocal question" in computer vision: while it is well-established that generative models can assist in understanding tasks, can pretrained understanding models reciprocally improve generative performance? The authors argue that by aligning the tokenizer's vocabulary with semantic features, the generative task becomes significantly more manageable for the underlying transformer architecture.

Methodology: VQ-KD

The core framework proposed is VQ-KD (Vector Quantization via Knowledge Distillation). Unlike the standard VQGAN approach that minimizes pixel reconstruction error, VQ-KD trains a tokenizer to reconstruct the feature maps of a pretrained "Teacher" model—specifically, an Image Understanding (IU) encoder.

The methodology consists of two distinct stages:

  1. Tokenizer Training: An encoder maps an input image to a feature map, which is then quantized into discrete codes from a learned codebook. A decoder is then tasked with reconstructing the teacher's features (derived from models like CLIP, DINO, or MAE) rather than the original raw pixels.
  2. Generative Modeling: A proposal network (either Autoregressive or Non-Autoregressive) is trained to predict these semantically rich token sequences.

The study systematically evaluates four IU teachers: ViT (supervised), CLIP (text-supervised), DINO (self-supervised/contrastive), and MAE (masked autoencoder), to determine which provides the most effective generative prior.

Key Insights and Semantic Analysis

The shift from pixels to semantics yields several critical advantages in how the model represents visual data:

Semantic Organization

Visualization using t-SNE reveals that VQ-KD codebooks are highly organized compared to the semantically ambiguous codebooks of VQGAN. In VQ-KD, tokens representing similar concepts—such as different breeds of dogs or types of vehicles—naturally cluster together. This organization suggests that the discrete "vocabulary" of the model is grounded in conceptual meaning.

Reduced Modeling Complexity

Because tokens carry semantic weight, the proposal network finds it easier to model the sequence. This is evidenced by lower Perplexity (PPL) scores. In essence, it is computationally and logically simpler for a model to predict the "next concept" in a sequence than to predict the "next patch of pixels."

Efficiency and Codebook Usage

A common failure mode in VQGAN is "codebook collapse," where the model utilizes only a small fraction of its available tokens. VQ-KD naturally achieves 100% codebook usage, ensuring that the representation is maximally efficient and that the model's capacity is fully utilized.

Robustness

Tokenizers grounded in IU capabilities exhibit greater resilience to data augmentation. While VQGAN performance degrades significantly under aggressive cropping or noise, VQ-KD-ViT remains stable, indicating that the semantic tokens are more invariant to low-level visual distortions.

Experimental Results

The researchers evaluated their approach on ImageNet-1k (for class-conditional generation) and MS-COCO (for text-to-image tasks). The quantitative improvements were substantial:

  • ImageNet-1k: VQ-KD-CLIP achieved a Fréchet Inception Distance (FID) of 4.10 at 256x256 resolution. This significantly outperforms the standard VQGAN (15.78) and even specialized architectures like ViT-VQGAN (5.30).
  • MS-COCO: In text-to-image tasks, VQ-KD-CLIP reached an FID of 11.17, nearly doubling the performance efficiency of VQGAN (24.11).
  • Scaling: The results indicate that tokenizers with strong IU capabilities allow smaller proposal networks to match or exceed the performance of much larger, more computationally expensive models trained on pixel-based tokens.

Conclusion and Future Directions

While VQ-KD represents a significant leap in generative quality, it introduces a trade-off between Semantics and Texture. Because the objective focuses on high-level features, the model can occasionally lose fine-grained visual details or sharp edges that pixel-reconstruction models are designed to preserve. This makes VQ-KD highly effective for image synthesis but potentially less ideal for pixel-perfect image editing.

Future research will likely explore hybrid objectives that combine the semantic strengths of IU-based distillation with the reconstructive precision of pixel-based losses. Additionally, the authors suggest that the direct transformation of IU encoders into tokenizers via simple clustering is a promising, low-cost avenue for further exploration in the field of image generation.

Summary updated

BibTeX
@inproceedings{wang2024image,
  author = {Luting Wang and Yang Zhao and Zijian Zhang and Jiashi Feng and Si Liu and Bingyi Kang},
  title = {{Image Understanding Makes for A Good Tokenizer for Image Generation}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=RMmgu49lwn},
}
Figure