Learning to Prompt Your Domain for Federated Vision-Language Models

Guoyizhe Wei, Feng Wang, Anshul Shah, Rama ChellappaTMLR 2025

Abstract

The prompt tuning paradigm, with its great advantages of low parameter count and stable training, has recently inspired numerous applications of CLIP-like vision-language models in federated learning. However, in this work, we posit that under significant domain gaps across federated participants, prompt-based CLIP may easily collapse to non-optimal solutions due to the neglect of domain-aware knowledge. We present a novel prompt tuning method, termed ADAPT, to address this issue by learning both intra- and inter-domain prompts. Specifically, we assign each federated participant a domain-specific prompt and use the image's visual features as a condition to guide the generation of language features, with the underlying idea that the prompted CLIP should detect the input image's domain correspondence before making the prediction of its category. Extensive experiments demonstrate ADAPT's significant efficiency and effectiveness in federated learning. For example, by learning and sharing only 2.1M parameters, ADAPT attains a 69.8% average accuracy over the six domains of DomainNet, which improves the original CLIP accuracy by 16.2%.

Introduction

Federated Learning (FL) allows multiple participants to train a shared model without exchanging private data. However, a major hurdle in FL is data heterogeneity, specifically "domain gaps" where participants possess datasets with vastly different styles, such as real-world photos, sketches, or clipart. While Contrastive Language-Image Pretraining (CLIP) is a powerful foundation, standard prompt tuning—learning small prefix tokens instead of retraining the whole model—often fails in FL. When domain gaps are large, prompt-based CLIP tends to collapse into non-optimal solutions because it ignores domain-specific knowledge. A "one-size-fits-all" prompt cannot capture the nuances of both a charcoal sketch and a high-resolution photograph simultaneously.

Methodology: The ADAPT Framework

To address these challenges, we propose ADAPT (FederAted Domain-Aware Prompt Tuning), which introduces three key technical innovations:

  1. Domain-Aware Prompts: Instead of a single global prompt, ADAPT assigns domain-specific textual and visual prompts to each participant. Visual prompts are learnable tokens appended to image patches, while textual prompts represent style-specific descriptions.
  2. Vision-Language Coupling (via AdaLN): To ensure the model understands the specific domain of an input, we utilize Adaptive Layer Normalization (AdaLN). This module uses features extracted from the image to condition the generation of language features. The model effectively detects the image's domain before predicting its category.
  3. Momentum Update for External Prompts: To prevent the sudden change of parameters from destabilizing the local model when downloading prompts from other clients, ADAPT uses an Exponential Moving Average (EMA) to smoothly integrate received prompts.
The ADAPT framework architecture, featuring domain-aware prompts and vision-language coupling via AdaLN.

Crucially, the heavy CLIP encoders (e.g., ViT-Base) remain frozen. Only the tiny prompt tokens and the lightweight AdaLN layers are trained, resulting in a highly efficient parameter footprint.

Experimental Results

We evaluated ADAPT on three primary domain-adaptation benchmarks: DomainNet (six domains), OfficeHome (four domains), and PACS (four domains).

ADAPT achieved an average accuracy of 69.8% on DomainNet, significantly outperforming zero-shot CLIP (53.6%) and basic federated prompt learning methods like PromptFL (63.2%). Notably, in the "Quickdraw" domain—which is notoriously difficult for standard models—ADAPT reached 44.5% accuracy, a substantial jump from the 13.5% achieved by zero-shot CLIP.

Performance comparison on DomainNet. ADAPT significantly outperforms zero-shot CLIP and other federated learning methods while maintaining low communication costs.

Efficiency and Privacy

ADAPT is remarkably communication-efficient, sharing only approximately 0.35M parameters per round. This sparsity also acts as a privacy shield; "Deep Leakage from Gradient" attacks, which attempt to reconstruct original images from model updates, fail against ADAPT because the sparse prompt gradients do not contain enough information to rebuild source data.

Discussion and Conclusion

Our findings suggest that domain detection is a prerequisite for high-accuracy classification in heterogeneous federated environments. By conditioning text prompts on visual clues, the model specializes its vocabulary for the detected domain. Furthermore, we found that momentum updates are mandatory for stable convergence when integrating prompts from diverse clients.

While ADAPT currently assumes known domain labels for clients, future work will explore unsupervised domain clustering for scenarios where data is a noisy mix of styles. Overall, ADAPT provides a robust, efficient, and privacy-preserving framework for deploying large vision-language models in real-world federated settings.

Summary updated

BibTeX
@article{wei2025learning,
  author = {Guoyizhe Wei and Feng Wang and Anshul Shah and Rama Chellappa},
  title = {{Learning to Prompt Your Domain for Federated Vision-Language Models}},
  journal = {Accepted by TMLR},
  year = {2025},
  url = {https://openreview.net/forum?id=OS7zPOZjr3},
}
Figure