Harmonizing Generalization and Personalization in Federated Prompt Learning

Tianyu Cui, Hongxia Li, Jingya Wang, Ye Shi

Introduction

In Federated Learning (FL), a central server coordinates multiple clients to train a model without ever seeing their private data. A major hurdle in this process is data heterogeneity: every client has different data distributions (e.g., one user only has photos of dogs, while another only has cats).

To handle this, researchers use personalization, where each client adapts the model to their specific needs. However, in the context of Federated Prompt Learning (FPL)—where we tune small "prompts" for massive Vision-Language Models (VLMs) like CLIP—personalization often comes at a cost. If a client focuses too heavily on their local data, the model "overfits" and loses the incredible zero-shot generalization ability that makes VLMs so powerful in the first place.

This paper asks a critical question: How can we give clients a personalized experience without breaking the model's ability to recognize things it hasn't seen before? The proposed solution, FedPGP, solves this "tug-of-war" between personalization and generalization, achieving state-of-the-art performance across both seen and unseen categories.

Methodology: The FedPGP Framework

The authors introduce FedPGP (Federated Prompt Learning with CLIP Generalization and low-rank Personalization). Its architecture relies on three main pillars designed to balance local adaptation with global knowledge.

FedPGP Architecture
  1. Low-Rank Personalization: Instead of letting clients change the entire prompt (which is "full-rank" and prone to overfitting), FedPGP uses a low-rank adaptation term ($\Delta p_i = U_i V_i$). This restricts the personalization to a smaller mathematical space, forcing the model to retain the core "global" knowledge while still allowing for local tweaks.
  2. CLIP Knowledge Guidance: The framework uses the original, handcrafted CLIP prompts (like "a photo of a [label]") as a "North Star." It encourages the global prompt to stay aligned with these general-purpose representations.
  3. Prompt-wise Contrastive Loss: This is the core innovation. The loss function treats the global prompt and the handcrafted CLIP prompt as a positive pair (pulling them together to ensure generalization). Simultaneously, it treats the global prompt and the client's personalized prompt as a negative pair (pushing them apart). This forces the personalized term to capture only the unique local features that the global prompt misses, preventing the two from becoming redundant or conflicting.

Key Insights

  • The "Intrinsic Rank" Hypothesis: Borrowing from recent LLM research, the authors suggest that prompt adaptation has a low "intrinsic dimension." By using low-rank matrices, they successfully prevent the local model from "overwriting" the valuable general knowledge stored in the global prompt.
  • Strategic Dissimilarity: Unlike many contrastive learning approaches that only try to make things similar, FedPGP uses dissimilarity to its advantage. By pushing the personalized prompt away from the global one, it ensures that the personalization is actually adding new, client-specific value rather than just echoing the global model.
  • Zero-Shot Preservation: A major breakthrough is that FedPGP manages to outperform the zero-shot CLIP baseline on novel (unseen) classes while simultaneously excelling on local (seen) classes. Usually, tuning a model degrades its zero-shot capabilities; FedPGP breaks this trend.

Experimental Results

The authors evaluated FedPGP on a wide array of benchmarks, including Base-to-Novel Generalization (OxfordPets, Flowers102, DTD, Caltech101, Food101), Domain Generalization (DomainNet, Office-Caltech10), and Personalization (CIFAR-10/100).

  • Superior Balance: On base-to-novel tasks, FedPGP achieved remarkable balance. For instance, on the Flowers102 dataset, it reached a Harmonic Mean (HM) of 87.33%, significantly outperforming other FPL methods like FedMaPLe (85.56%) and CoOp (77.55%).
  • Domain Robustness: In "leave-one-domain-out" tests on the DomainNet dataset, FedPGP reached an average accuracy of 86.76%, proving it can handle drastic shifts in data style (e.g., moving from 'Real' photos to 'Quickdraw' sketches).
Domain Generalization Results
  • Personalization Gains: In extreme Non-IID settings (where clients have very different classes), FedPGP showed massive improvements. On the DTD dataset, it hit 91.52% accuracy, while the next best personalized method trailed at 77.14%.

Limitations and Future Work

While FedPGP shows impressive empirical results, the authors note that the theoretical foundations of why low-rank adaptation works so well specifically for prompts in a federated setting deserve deeper exploration.

Additionally, the current work focuses primarily on text-based prompts. Future research could investigate if these same "harmonizing" principles apply to visual prompts or multi-modal prompts where both the image and text encoders are tuned simultaneously. Finally, while communication costs remain low due to the small size of prompts, the added computational overhead of the contrastive loss on the client side is a factor for extremely resource-constrained edge devices.

Summary updated

BibTeX
@inproceedings{cui2024harmonizing,
  author = {Tianyu Cui and Hongxia Li and Jingya Wang and Ye Shi},
  title = {{Harmonizing Generalization and Personalization in Federated Prompt Learning}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=YYwERRXsJW},
}
Figure