[Paper Review] Your ViT is Secretly a Hybrid Discriminative-Generative Diffusion Model
This paper proposes GenViT and HybViT, novel models that unify diffusion generative modeling with Vision Transformers (ViT), using a single ViT backbone for both image generation and classification. By integrating ViT into the DDPM framework, the method achieves state-of-the-art performance in both tasks with stable, MCMC-free training and improved computational efficiency compared to prior hybrid models.
Diffusion Denoising Probability Models (DDPM) and Vision Transformer (ViT) have demonstrated significant progress in generative tasks and discriminative tasks, respectively, and thus far these models have largely been developed in their own domains. In this paper, we establish a direct connection between DDPM and ViT by integrating the ViT architecture into DDPM, and introduce a new generative model called Generative ViT (GenViT). The modeling flexibility of ViT enables us to further extend GenViT to hybrid discriminative-generative modeling, and introduce a Hybrid ViT (HybViT). Our work is among the first to explore a single ViT for image generation and classification jointly. We conduct a series of experiments to analyze the performance of proposed models and demonstrate their superiority over prior state-of-the-arts in both generative and discriminative tasks. Our code and pre-trained models can be found in https://github.com/sndnyang/Diffusion_ViT .
Motivation & Objective
- To explore whether a single Vision Transformer (ViT) can serve as a generative model, challenging the conventional use of UNet in DDPM.
- To bridge the gap between discriminative and generative modeling by enabling a single ViT to jointly perform image classification and generation.
- To overcome the instability and high computational cost of MCMC-based hybrid models like JEM and JEM++.
- To demonstrate that ViT-based diffusion models offer superior scalability, stability, and efficiency compared to CNN-based or GAN-based alternatives.
- To analyze the robustness, uncertainty calibration, and OOD detection performance of the proposed models in comparison to existing benchmarks.
Proposed method
- Integrates the Vision Transformer architecture directly into the DDPM framework, replacing the standard UNet backbone with a ViT for denoising in the diffusion process.
- Designs GenViT as a pure generative model by training the ViT to predict noise in the reverse diffusion process using a variational lower bound (VLB) objective.
- Develops HybViT as a hybrid model that jointly optimizes image reconstruction (via diffusion) and classification using a shared ViT feature space with two independent heads.
- Employs a shared set of ViT parameters for both generative and discriminative tasks, enabling parameter efficiency and statistical strength sharing.
- Uses a single objective function that combines reconstruction loss and cross-entropy loss, avoiding the need for expensive MCMC sampling during training.
- Applies patch-based image processing with learnable linear projections and multi-head self-attention to model long-range dependencies in the latent diffusion space.
Experimental results
Research questions
- RQ1Can a single Vision Transformer be effectively used as a backbone for diffusion-based image generation, replacing the standard UNet?
- RQ2How does joint training of generative and discriminative heads on a shared ViT backbone affect performance on both image generation and classification tasks?
- RQ3Does the proposed method outperform MCMC-based hybrid models like JEM and JEM++ in terms of training stability, convergence speed, and final performance?
- RQ4What is the impact of patch size and model dimension on the trade-off between generation quality and classification accuracy in the proposed models?
- RQ5How do GenViT and HybViT compare to state-of-the-art models in terms of likelihood, adversarial robustness, uncertainty calibration, and OOD detection?
Key findings
- HybViT achieves a test accuracy of 87.1% on STL10 with an Inception Score of 6.90 and FID of 125.5, outperforming prior hybrid models.
- GenViT with a model dimension of 768 achieves an Inception Score of 7.01 and FID of 126.6 on CIFAR-10, demonstrating strong generative performance.
- HybViT trains significantly faster than MCMC-based models: it completes training in 31.2 hours on CIFAR-10 with a single GPU, compared to 101.3 hours for JEM(K=20).
- The model with a patch size of 6 (HybViT-ps6) achieves the best balance between accuracy and generation quality, with 81.7% accuracy and 7.30 IS.
- HybViT shows superior uncertainty calibration and OOD detection performance compared to baseline models, indicating improved robustness.
- Despite strong results, generation quality for high-resolution images plateaus at patch size 6, suggesting limitations in linear projection layers rather than self-attention mechanisms.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.