Abstract
Recent image generation schemes typically capture image distribution in a pre-constructed latent space relying on a frozen image tokenizer. Though the performance of the tokenizer plays an essential role in successful generation, current evaluation metrics (e.g., rFID) fail to precisely assess the tokenizer and correlate its performance to the generation quality (e.g., gFID). In this paper, we comprehensively analyze the reason for the discrepancy between reconstruction and generation qualities in a discrete latent space. From this analysis, we propose a novel plug-and-play tokenizer training scheme, RobustTok, to facilitate latent space construction. Specifically, a latent perturbation approach is proposed to simulate sampling noises—the unexpected tokens sampled during the generative process. With latent perturbation, we further propose (1) a novel tokenizer evaluation metric, pFID, which successfully correlates tokenizer performance to generation quality, and (2) a training scheme that significantly enhances tokenizer robustness, boosting generation quality and convergence speed. Extensive benchmarking with 11 advanced discrete image tokenizers and 2 autoregressive generation models validates our approach. The tokenizer trained with our proposed latent perturbation achieves a notable 1.60 gFID with classifier-free guidance (CFG) on ImageNet 256x256.
Introduction: The Robustness Gap
Modern image generation often follows a two-stage recipe: first, an image tokenizer (like a VQGAN) compresses images into discrete visual "words" (tokens). Second, an autoregressive (AR) model learns to predict these tokens sequentially.
A critical problem identified in this work is the "robustness gap" caused by a training-inference mismatch. During training, the AR model uses "teacher forcing," where it always sees ground-truth tokens. However, during inference, the model must rely on its own previous predictions. If it samples a "neighboring" token instead of the exact correct one, that error propagates. Standard tokenizers are fragile; they are trained to reconstruct images from perfect tokens. When the AR model provides "noisy" tokens during inference, the tokenizer's decoder produces distorted results.
Methodology
Latent Perturbation (RobustTok)
To bridge this gap, we propose RobustTok, a training scheme that makes the tokenizer's decoder resilient to sampling errors. We simulate these errors during training by randomly replacing a proportion ($\alpha$) of tokens within a batch with their "top-$\delta$" nearest neighbors from the codebook.
As illustrated in Figure 1, this forces the decoder to learn to produce a coherent image even when the input tokens are slightly "off." We utilize an annealing schedule, starting with high perturbation and gradually reducing it to stabilize the training process. The architecture leverages a Vision Transformer (ViT) backbone and incorporates a pretrained DINOv2 model to ensure tokens retain structural coherence.
Perturbed FID (pFID)
We also introduce pFID, a new evaluation metric designed to measure a tokenizer's robustness before training a massive generative model. By injecting synthetic noise into the latent space and measuring the FID of the resulting reconstructions, pFID provides a much stronger correlation with final generation performance (gFID) than traditional reconstruction metrics (rFID).
Key Results and Insights
Robustness to Sampling Noise
The core advantage of RobustTok is its ability to maintain image fidelity even when the latent space is perturbed. Traditional tokenizers, even those with semantic guidance, degrade rapidly when faced with sampling noise.
As shown in Figure 2, while non-semantic and standard semantic tokenizers produce significant artifacts as perturbation increases, our Robust Tokenizer maintains high visual quality. This robust latent space is significantly easier for the AR generator to navigate, leading to faster convergence and superior final results.
Performance Benchmarks
RobustTok combined with the RAR generator achieved a state-of-the-art 1.60 gFID (with CFG) and 3.45 gFID (without CFG) on ImageNet 256x256. Beyond raw quality, the proposed pFID metric showed a much tighter correlation with final generation quality across various codebook sizes compared to traditional rFID, proving its utility as a reliable proxy for tokenizer effectiveness.
Conclusion
This research demonstrates that the discrepancy between reconstruction and generation quality is primarily due to the decoder's inability to handle the noisy latent patterns sampled during inference. By introducing RobustTok and the pFID metric, we provide a robust framework for building and evaluating the next generation of image tokenizers. Future work will explore applying similar perturbation logic to continuous latent spaces used in diffusion-based systems.
Summary updated