NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Diff-Prompt: Diffusion-Driven Prompt Generator with Mask Supervision

Weicai Yan, Wang Lin, Zirun Guo, Ye Wang, Fangming Feng, Xiaoda Yang, Zehan Wang, Tao Jin

Abstract

Adapting large-scale pre-trained multimodal models to downstream tasks often relies on prompt learning to avoid the high computational costs of full fine-tuning. However, traditional prompt-learning methods typically utilize static, global vectors that lack the spatial and semantic granularity necessary for complex tasks. This paper introduces Diff-Prompt, a novel three-stage framework that treats prompt generation as a generative task. By employing a Diffusion Transformer (DiT) supervised by object masks, Diff-Prompt generates dynamic, input-specific prompts that are grounded in the specific content of a scene. Experimental results on benchmarks like RefCOCO and Flickr30k demonstrate that Diff-Prompt significantly outperforms existing state-of-the-art prompt-tuning methods, providing substantial gains in referring expression comprehension and multimodal understanding.

Introduction

Pre-trained multimodal foundation models, such as CLIP and GLIP, have demonstrated remarkable capabilities in general visual-linguistic tasks. To adapt these models to specific downstream applications without destroying their original general knowledge, researchers often turn to "Prompt Learning." Methods like Visual Prompt Tuning (VPT) or Multi-modal Prompt Learning (MaPLe) keep the foundation model frozen and optimize a small set of prompt vectors.

Despite their efficiency, these methods suffer from a significant limitation: the learned prompts are often "static" or "global," meaning they do not change based on the specific nuances of the input image or text. For complex tasks like referring expression comprehension—where a model must locate a specific object based on a detailed description (e.g., "the small red cup behind the laptop")—generic prompts often fail to provide the necessary spatial or semantic guidance. Diff-Prompt addresses this by generating prompts that are as dynamic and detailed as the input itself.

Methodology

Diff-Prompt utilizes a generative approach to create prompts, structured into a three-stage framework designed to capture and inject spatial awareness into the foundation model.

1. Mask-VAE Training

To handle spatial information efficiently, the framework first trains a Variational Autoencoder (VAE) to compress binary object masks into a compact latent space. These masks represent the precise location and shape of objects, serving as a high-fidelity spatial reference that the prompt generator will eventually learn to reconstruct.

2. Diffusion-Driven Prompt Generator

The core of the system is an improved Diffusion Transformer (DiT). This generator is trained to "denoise" latent features into the mask representations learned in Stage 1. Crucially, this denoising process is conditioned on both the input image and the text caption. By supervising the diffusion process with masks, the generator learns to identify which parts of the image are relevant to the text, effectively creating a "saliency map" that guides the prompt generation.

3. Alignment and Reverse Prompting

Because the diffusion generator and the foundation model (e.g., GLIP) operate in different semantic spaces, modality-specific adapters are used to map diffusion features into prompts the foundation model can interpret. The authors introduce a "Reverse Prompting" strategy: the most refined features from the final stages of the diffusion process are fed into the earliest layers of the vision and language encoders. This ensures that the most information-dense multimodal features are available at the start of the foundation model's processing pipeline.

Experimental Results

Diff-Prompt was evaluated across several rigorous benchmarks, including RefCOCO, Flickr30k, and a suite of 11 diverse generalization datasets such as ImageNet and Caltech101.

Performance in Referring Expression Comprehension

On the RefCOCO testA set, Diff-Prompt achieved a maximum improvement of 8.87% in R@1 and 14.05% in R@5 compared to the base GLIP-T model. It consistently outperformed other prompt-tuning state-of-the-art (SOTA) methods like MaPLe and FedTPG, proving that generative prompts are superior to static ones for localization-heavy tasks.

Generalization and Robustness

In zero-shot evaluations on datasets the model was not specifically trained for, Diff-Prompt maintained or improved upon the performance of the base foundation model. This suggests that the generated prompts provide helpful auxiliary information without compromising the model's pre-trained general knowledge.

Discussion and Key Insights

  • Generative vs. Discriminative Prompts: By generating prompts rather than simply learning a fixed vector via backpropagation, Diff-Prompt captures the complex, non-linear relationships between images and captions more effectively.
  • Mask Supervision as a Proxy: Using masks to supervise the diffusion process is a powerful technique. It forces the prompt generator to focus on the spatial grounding of the text, which is the primary bottleneck in many multimodal tasks.
  • The Reverse Advantage: The success of the reverse prompting strategy highlights that the "fused" information produced at the end of a diffusion process is most beneficial when introduced early in the foundation model's architecture.

Limitations and Future Work

While highly effective, Diff-Prompt introduces more computational overhead than simpler methods. The iterative nature of diffusion models requires approximately 2.29 seconds for inference and significant GFLOPs per sampling step. Additionally, the current architecture is constrained to a 224x224 input resolution due to DiT limitations.

Future research will focus on optimizing the speed of prompt generation using "one-step" generative models, such as Consistency Models, and exploring higher-resolution architectures to capture even finer-grained details.

Summary updated

BibTeX
@inproceedings{yan2025diff,
  author = {Weicai Yan and Wang Lin and Zirun Guo and Ye Wang and Fangming Feng and Xiaoda Yang and Zehan Wang and Tao Jin},
  title = {{Diff-Prompt: Diffusion-Driven Prompt Generator with Mask Supervision}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=LfghnrSJNg},
}
Figure