Abstract
Image tokenizers play a critical role in shaping the performance of subsequent generative models. Since the introduction of VQ-GAN, discrete image tokenization has undergone remarkable advancements. Improvements in architecture, quantization techniques, and training recipes have significantly enhanced both image reconstruction and the downstream generation quality. In this paper, we present XQ-GAN, an image tokenization framework designed for both image reconstruction and generation tasks. Our framework integrates state-of-the-art quantization techniques, including vector quantization (VQ), residual quantization (RQ), multi-scale residual quantization (MSVQ), product quantization (PQ), lookup-free quantization (LFQ), and binary spherical quantization (BSQ), within a highly flexible and customizable training environment. On the standard ImageNet 256x256 benchmark, our released model achieves an rFID of 0.64, significantly surpassing MAGVIT-v2 (0.9 rFID) and VAR (0.9 rFID). Furthermore, we demonstrate that using XQ-GAN as a tokenizer improves gFID metrics alongside rFID. For instance, with the same VAR architecture, XQ-GAN+VAR achieves a gFID of 2.6, outperforming VAR's 3.3 gFID by a notable margin.
Introduction
In the world of generative AI, autoregressive (AR) models have shown immense promise for image synthesis. However, these models do not operate on raw pixels; they require an image tokenizer to convert continuous visual data into a discrete sequence of "tokens." The quality of these tokens represents a significant bottleneck. If the tokenizer loses too much detail, the final image appears blurry. If the tokens lack semantic meaning, the generative model struggles to predict subsequent tokens logically. Existing tokenizers are often specialized or "black boxes," making it difficult for researchers to experiment with different discretization strategies. XQ-GAN addresses this by providing a highly flexible, modular framework to explore the frontier of image tokenization.
Methods
XQ-GAN introduces a modular pipeline that allows researchers to customize components for specific needs. The framework supports two core pipelines: XQ-GAN-SC (Spatial Compression), which utilizes Vision Transformers (ViT) to reduce spatial resolution, and XQ-GAN-Vanilla (V), a traditional architecture compatible with classic VQ-GAN setups.
Hierarchical Quantization and Semantic Distillation
A key innovation is the support for a wide array of quantization methods, including Vector Quantization (VQ), Residual Quantization (RQ), and newer techniques like Lookup-Free Quantization (LFQ) and Binary Spherical Quantization (BSQ). These methods allow for precise control over bitrate and ensure 100% codebook utilization, preventing the common "dead codebook" problem.
Furthermore, XQ-GAN employs Semantic Distillation to align tokens with high-level features from pre-trained teacher models like DINOv2 or CLIP. By using a contrastive loss, the tokenizer learns to capture the underlying meaning of objects rather than just pixel-level details. This alignment significantly eases the task for downstream autoregressive models.
Results
The authors evaluated XQ-GAN across diverse domains, including ImageNet 256x256, LAION-400M, and the medical dataset IMed-361M.
State-of-the-Art Performance
On the ImageNet benchmark, XQ-GAN achieved a state-of-the-art reconstruction FID (rFID) of 0.64, outperforming MAGVIT-v2 and VAR (both at 0.9). More importantly, this improvement translates to better generation quality. When paired with the VAR architecture, XQ-GAN improved the generation FID (gFID) from 3.3 to 2.6.
The framework also demonstrates high efficiency. XQ-GAN can achieve superior results using significantly fewer tokens (e.g., 286 tokens vs. 680 in the original VAR model), reducing the computational burden on subsequent generative models.
Conclusion
XQ-GAN provides a unified and optimized framework for image tokenization. By integrating advanced quantization and semantic alignment, it sets new benchmarks for both reconstruction and generation. While training requires significant computational resources (e.g., 32 NVIDIA A100 GPUs), the release of pre-trained weights offers the community a powerful tool for building next-generation AR models. Future work will explore extending this framework to video tokenization and more compact latent spaces for edge deployment.
Summary updated