Manuscript Offprint

arXiv:2610.11067

Diffusion Meta-Prompting and Steering for Generalizable Foundation Model Adaptation

Deepak Sridhar, Yi Li, Kartikeya Bhardwaj, Shuangjun Liu, Taotao Jing, Yuan Li, Shuai Zhang, Jiancheng Lyu, Dashan Gao, Nuno Vasconcelos

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Prompt learning is a popular method for adapting foundation models, but learned prompts are typically task-specific and fail to generalize to new classes, domains, or compositions of tasks. In this paper, we introduce a Diffusion Meta-Prompt (DMP) model, a framework that models the distribution of learned prompts using diffusion models. Given a repository of previously learned prompts, DMP is trained and sampled without access to the original task examples or task losses, and synthesizes new prompts conditioned on natural language task descriptions. To improve the sampling stability, we introduce a test-time steering strategy for DMP, which uses the best training-selected prompt in the repository as a latent anchor during diffusion sampling, without retraining the DMP or accessing test classes. DMP improves generalization across classification, retrieval and text-to-image generation tasks, supports concept composition and negative prompting without explicit training. It reduces storage and inference costs by over 90% compared to prompt retrieval methods. For composite classification, DMP achieves up to 2.0% average gain over prior meta-learning methods across 55 pairs of datasets with gains as high as 8.5% on specific pairs such as Eurosat and Flowers. DMP also enhances cross-task generalization with ~2-9% improvement for hierarchical classification task. We further provide a theoretical guarantee bounding the expected task loss of prompts sampled from a DMP. Code is available here: DMP

1 Introduction

Foundation models (Rombach et al., 2022; Radford et al., 2021) generalize to diverse tasks owing to their scale, and can be customized to downstream tasks with parameter-efficient methods (Hu et al., 2022; Zhang and Agrawala, 2023) such as prompt learning (PL) (Zhou et al., 2022b). In vision-language models, prompts are learned in the visual (Jia et al., 2022), textual (Zhou et al., 2022a), or both spaces (Roy and Etemad, 2024; Hao et al., 2025) to improve fine-grained (Helber et al., 2018) and taxonomic classification (Wu et al., 2024), class discrimination (Zhou et al., 2022b,a), and robustness to domain shift (Ge et al., 2022). In generative models, prompts customize synthesis to specific concepts, people, or objects (Gal et al., 2022; Ruiz et al., 2023), or control the strength of attributes such as age, emotion, or style (Sridhar and Vasconcelos, 2024).

Despite their power, learned prompts have key limitations (Figure 1, left). They are inherently task-specific, requiring task-specific data and losses: classification prompts generalize poorly beyond the few-shot base classes and must be returned for each label set, while generative prompts for attributes such as age or smiling must be learned separately per entity or concept. Since different applications could share the same prompts, practical systems rely on large repositories of prompts or adaptation weights, such as HuggingFace or Civitai (Civitai, 2023), where prompts must be stored, searched, and manually composed (Luo et al., 2024), limiting reuse.

∗^{*}Qualcomm AI Research is an initiative of Qualcomm Technologies, Inc. Preprint.

Figure

Figure 1: DMP versus existing approaches: DMP models provide a natural language interface for the adaptation of foundation models, while eliminating the complexities of large prompt repositories, offering better generalization and composition with a minimal runtime overhead due to the feasibility of using small DMP models and fast sampling.

Table 1: Conceptual differences between DMP and prior meta-learning methods.

MethodTask Data/Loss FreeSupports Multiple TasksLearns across TasksCore Idea
Bayesian Prompt Learning (BPL)✕✕✕Bayesian uncertainty modeling over task-specific prompts.
Prompt Learning via Meta-Regularization (ProMetaR)✕✓✓Meta-regularization to improve prompt generalization across tasks; requires training data.
Gradient-Regulated Meta-Prompt (GRAM)✕✓✕Meta-learned prompt init + gradient regulator for few-shot cross-domain generalization.
PRewrite (Prompt Rewriting w/ RL)✕✓✕LLM-based prompt rewriter trained with RL to improve downstream task performance.
DMP (Ours)✓✓✓Learns a prompt distribution; one-shot guided sampling, composition, negative prompts.

In this work, we propose a different perspective: instead of treating prompts as isolated optimization outcomes, they should be considered as samples from a structured distribution. Across tasks and domains, learned prompts exhibit regularities that admit smooth interpolation, and support meaningful composition and negation. Capturing this structure would enable the reuse of prior prompt learning effort and improve generalization to new tasks. Rather than learning one set of prompts at a time, there is a need for meta-prompting techniques capable of learning to generate prompts across many tasks and models. However, to be scalable, the learning should be feasible without revisiting the original task data or losses. Instead, one would like to rely on the large prompt repositories that are already available, whose prompts were themselves obtained by standard prompt optimization on their respective source tasks. This rules out classical meta-learning techniques (Finn et al., 2017; Nichol et al., 2018; Li et al., 2017; Andrychowicz et al., 2016), based on a double optimization loop, where a prompt generator is trained jointly with the prompted models across several tasks.

To accomplish this goal we propose an approach, Diffusion Meta-Prompting (DMP), where a generative model is learned over prompt embeddings, using diffusion models. A DMP is trained on a repository of previously learned prompts, and learns to synthesize new prompts conditioned on natural language task descriptions. As illustrated on the right of Figure 1, at inference, prompts are simply sampled with the DMP model, enabling one-shot adaptation of foundation models to unseen classes, composite tasks, and novel concept combinations. Table 1 compares DMP against prior meta-learning approaches, showing its uniqueness in terms of not requiring access to the original task data or losses once a prompt repository is available, while learning joint prompt structure over tasks, and requiring a minimal amount of prompt storage. The combination of these properties makes DMP much more scalable in the number of tasks and capable of prompt interpolation and generalization.

Although the ability of diffusion models to synthesize prompts is not surprising, different diffusion trajectories can produce prompts with different downstream generalization behavior. To mitigate these effects, we introduce a simple test-time steering mechanism, which allows DMP to reuse the prompt repository at inference time without any additional training. For each dataset, we select the prompt seed with the highest training accuracy, and use this as an anchor during DDIM sampling. At each denoising step, the predicted clean prompt is interpolated with this anchor. This biases the sampling trajectory toward a known low-risk region of the learned prompt manifold while still allowing the diffusion model to synthesize new prompts conditioned on the task specification. Importantly, the anchor is selected once, using the source-task training performance already associated with the repository, and does not use target-task examples or novel test classes. This allows task generalization.

As shown in the rightmost panel of Figure 1, DMPs eliminate the complexities of dealing with prompt repositories, offering better generalization and compositionality with a minimal runtime overhead. For example, given a subject name (“Jennifer Aniston”) and attributes (“hair” and “age”), a DMP can generate a set of prompts to personalize a foundation diffusion model like Stable Diffusion XL (SDXL) to the generation of images with this combination of concepts.

We choose diffusion as the generative model for prompts since it offers better generalization than alternatives like autoregressive methods (Radford et al., 2019) (shown later in Table 19, Appendix A.6.1). This is demonstrated in two ways. First, we show that DMPs learn to produce a range of sophisticated prompt operations, such as concept composition, guided sampling, novel subject generation, editing and negative prompting without explicit training. Second, we show that DMPs can learn multiple tasks, by showing that a single model can be trained to produce prompts for both subject personalization and slider attributes. This replaces the combinatorial complexities of searching separate prompt repositories for the two (and potentially more) tasks into a single DMP model. DMPs are also shown applicable to a diversity of fundamentally different tasks, ranging from image synthesis to composite classification. For the latter, we show that learning the distribution of prompts across datasets and label sets generalizes to unseen classes better than prior meta-learning approaches and the standard approach of individual prompt learning per dataset. The fact that this happens even though the DMP model is trained on the individual prompts of the baseline approach shows that there is structure in prompt space, which DMPs learn for improved generalization.

Beyond prompt embeddings, the same principle can be applied to foundation-model representations themselves. We therefore evaluate DMP in a sparse multi-view retrieval setting, where a query view of an object must retrieve the remaining views of the same object from a gallery in which many views are missing. In this setting, DMP is trained on objects disjoint from the gallery and synthesizes embeddings for missing views. Retrieval is then performed with an aggregated gallery containing both observed and synthesized embeddings. We demonstrate that DMP can also model such structured distributions beyond learned prompts, and can improve retrieval for a different representation space and downstream objective without accessing the gallery objects during training (Table 7).

Overall, the paper makes the following key contributions

• We introduce Diffusion Meta-Prompting, a meta-learning framework that treats learned prompts as samples from a shared distribution, which is learned with diffusion models. Unlike prompt learning, retrieval, or refinement methods, DMP is trained once on a repository of previously learned prompts and synthesizes new task-specific prompts at inference without revisiting the original task data or task losses, and without additional prompt optimization.

• We introduce a test-time steering mechanism at inference without any additional training that produces prompts with better generalization (upto 2.0%) over standard sampling.

• We provide a theoretical guarantee bounding the expected task loss of prompts sampled from a DMP in terms of the empirical loss of the prompt repository and the denoising error of the diffusion model.

• Through extensive experiments, we show that DMP improves generalization in the most challenging regimes where prompt learning typically fails, including cross-task, and composite classification settings (up to 2.0% accuracy gains), while also reducing storage and inference costs by over 90% compared to prompt retrieval approaches.

• We also demonstrate that DMP is representation-agnostic by applying it to sparse multi-view retrieval experiment which improves retrieval by +3.44 mAP over direct DINov2 retrieval.

References (47)