Dual Diffusion for Unified Image Generation and Understanding

Zijie Li, Henry Li, Yichun Shi, Amir Barati Farimani, Yuval Kluger, Linjie Yang, Peng Wang

Introduction

In the contemporary landscape of artificial intelligence, a significant "bimodal divide" persists. High-fidelity image generation is typically the domain of Diffusion Models (e.g., Stable Diffusion), while complex visual understanding and linguistic reasoning are handled by Autoregressive (AR) Models (e.g., LLaVA or GPT-4o). While some recent efforts have attempted to bridge this gap by treating pixels as discrete "visual tokens" within AR frameworks, diffusion models have historically struggled to perform the "reverse" task: understanding and reasoning about visual data.

The Dual Diffusion Transformer (D-DiT) addresses this fundamental challenge. It represents the first end-to-end framework that utilizes diffusion processes for both image generation and visual understanding natively, without relying on "glued-on" components or standard autoregressive text generation.

The D-DiT Architecture

D-DiT is built upon the Multimodal Diffusion Transformer (MM-DiT) architecture, specifically the variant used in Stable Diffusion 3. The core innovation lies in its ability to output diffusion targets for both modalities simultaneously through two distinct branches:

  1. The Image Branch: This branch employs Continuous Diffusion via a "Flow Matching" objective. It treats image data as continuous vectors, learning to reverse a noise-corruption process to generate high-fidelity visuals.
  2. The Text Branch: Unlike standard LLMs that predict the next token, this branch uses Discrete Masked Diffusion. The model learns to predict specific text tokens that have been randomly masked within a sequence, effectively treating text generation as a denoising task.
The D-DiT architecture supports unified modeling through an overview (a), image-conditioned text generation (b), and text-conditioned image generation (c).

The model utilizes a bidirectional attention mechanism, allowing image and text tokens to interact across every layer of the transformer. This unified training approach ensures that the model learns a deeply integrated representation of both modalities.

Reasoning via Multimodal Infilling

A key insight of the D-DiT framework is that visual understanding tasks—such as Image Captioning and Visual Question Answering (VQA)—can be framed as "Image-to-text In-filling."

In this paradigm, the model is provided with an image and a set of unmasked prompt tokens (the question). The diffusion process is then tasked with "filling in" the masked tokens to produce the answer or caption. Because the bidirectional attention is equivariant to token order, D-DiT is naturally robust at infilling information from any position in the sequence, a significant advantage over the left-to-right constraints of traditional AR models.

D-DiT frames understanding tasks like captioning and VQA as a diffusion-based infilling process using mask tokens.

Training and Evaluation

The researchers trained D-DiT in three strategic stages using approximately 40 million image-text pairs, including datasets like Datacomp-1b, ShareGPT4V, and LLaVA-v1.5-mix. This multi-stage approach taught the model initial alignment, high-quality descriptive refinement, and complex instruction following.

Key Results

D-DiT demonstrates that diffusion is a universal learner capable of high-tier performance in both directions:

  • Superior Generation: On the GenEval benchmark, D-DiT achieved a score of 0.65, outperforming its base model (SD3 at 0.62). Notably, training on understanding tasks actually improved the model's generative capabilities, specifically in color accuracy and attribute alignment.
  • Competitive Understanding: D-DiT reached a score of 1124.7 on the MME benchmark and 60.1% on VQAv2. While it currently trails the largest AR-based models, it represents a massive leap forward for diffusion-based understanding.
  • Efficiency: By initializing with Stable Diffusion 3 weights, the model achieved meaningful text output in under 25 billion tokens—a fraction of the data required to train a standard LLM from scratch.

Conclusion and Future Directions

D-DiT proves that the bimodal divide is not an inherent limitation of diffusion models. By unifying continuous and discrete diffusion, the model achieves a "fine-grained" understanding of the world, capable of explaining why a traffic cone with googly eyes is humorous or describing complex interior furnishings. Future work aims to close the "LLM gap" in linguistic reasoning and explore truly end-to-end models where the text encoder is also trained via diffusion.

Summary updated

BibTeX
@inproceedings{li2025dual,
  author = {Zijie Li and Henry Li and Yichun Shi and Amir Barati Farimani and Yuval Kluger and Linjie Yang and Peng Wang},
  title = {{Dual Diffusion for Unified Image Generation and Understanding}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2025},
  doi = {10.1109/cvpr52734.2025.00265},
}
Figure