Abstract
Vision Transformers (ViT) and Visual Prompt Tuning (VPT) achieve state-of-the-art performance with improved efficiency in various computer vision tasks. This suggests a promising paradigm shift of adapting pre-trained ViT models to Federated Learning (FL) settings. However, the challenge of data heterogeneity among FL clients presents a significant hurdle in effectively deploying ViT models. Existing Generalized FL (GFL) and Personalized FL (PFL) methods have limitations in balancing performance across both global and local data distributions. In this paper, we present a novel algorithm, SGPT, that integrates GFL and PFL approaches by employing a unique combination of both shared and group-specific prompts. This design enables SGPT to capture both common and group-specific features. A key feature of SGPT is its prompt selection module, which facilitates the training of a single global model capable of automatically adapting to diverse local client data distributions without the need for local fine-tuning. To effectively train the prompts, we utilize block coordinate descent (BCD), learning from common feature information (shared prompts), and then more specialized knowledge (group prompts) iteratively. Theoretically, we justify that learning the proposed prompts can reduce the gap between global and local performance. Empirically, we conduct experiments on both label and feature heterogeneity settings in comparison with state-of-the-art baselines, along with extensive ablation studies, to substantiate the superior performance of SGPT.
Introduction
Federated Learning (FL) aims to train models across decentralized clients without sharing their private data. However, real-world data is rarely "Independent and Identically Distributed" (IID). This data heterogeneity creates a fundamental conflict between two paradigms: Generalized FL (GFL), which seeks a single robust global model, and Personalized FL (PFL), which tailors models to individual client silos. GFL often fails on "outlier" local data, while PFL can lead to overfitting and poor generalization outside of a specific client's data distribution.
While Vision Transformers (ViTs) offer powerful representational capabilities, their massive parameter counts make them difficult to tune in resource-constrained FL environments. Existing methods struggle to find the "sweet spot" where a model is both globally robust and locally sharp. SGPT addresses this by bridging the gap between these two paradigms.
Methodology: Shared and Group Prompt Tuning (SGPT)
The proposed SGPT framework leverages Visual Prompt Tuning (VPT) to bridge the gap between generalization and personalization. Instead of updating the millions of parameters in a ViT backbone, SGPT keeps the backbone frozen and only trains a small set of learnable vectors, or "prompts."
Key Components
- Shared Prompts ($P_S$): These are inserted into the early layers of the ViT to capture low-level, universal features common across all clients, ensuring global generalization.
- Group Prompts ($P_G$): These are inserted into deeper layers to capture specialized, high-level features relevant to specific data distributions.
- Prompt Selection Module: Acting as a "router," this module uses a similarity-based clustering approach to match an input image to the most relevant group prompt on-the-fly. It learns "keys" (centroids) that represent different data distributions.
- Optimization via Block Coordinate Descent (BCD): To stabilize training under heterogeneity, a two-stage optimization is used. Shared prompts are trained first to capture common knowledge, followed by iterative optimization of group prompts and selection keys.
- Momentum Updating: Momentum-based aggregation on the server side prevents clustering collapse and maintains stability across diverse client updates.
Experimental Evaluation
SGPT was evaluated across several challenging scenarios involving both label and feature heterogeneity:
- Label Heterogeneity: CIFAR-100 (pathological split) and a "Five-dataset" combination (SVHN, CIFAR-10, not-MNIST, Fashion-MNIST, and MNIST).
- Feature Heterogeneity: Office-Caltech10 and DomainNet, featuring significant domain shifts (e.g., Clipart vs. Real photos).
Key Results
SGPT demonstrates a superior trade-off between global and local performance. In CIFAR-100 tests, it achieved a Global Accuracy of approximately 84.6% while maintaining a high "Worst Local Accuracy" of 73.8%, significantly outperforming baselines like FedVPT and pFedPG.
As data heterogeneity increased, SGPT’s performance remained more robust than competitors. On DomainNet, it outperformed the next best baseline by nearly 9% in average accuracy, highlighting its effectiveness in handling diverse visual styles and domain shifts.
Discussion and Insights
Analysis of the architecture revealed that the placement of prompts is critical. Features in early ViT layers are relatively uniform across classes, justifying the use of shared prompts there, while later layers exhibit high specialization, making them ideal for group prompts.
Unlike many PFL methods that require local fine-tuning before inference, SGPT’s selection module allows the global model to adapt to inputs automatically. Furthermore, by only tuning prompts, SGPT reduces trainable parameters to just 0.1M, compared to the 11M-86M required for full-model fine-tuning, making it highly efficient for federated settings.
Limitations
The current architecture relies on heuristic search for optimal prompt insertion layers and a fixed number of groups ($G$). Future work may explore automated architecture search and dynamic group allocation to further enhance adaptability. Additionally, the reliance on high-quality pre-trained backbones (e.g., ImageNet-21K) remains a dependency for specialized niche domains where pre-trained features might not carry over as effectively.
Conclusion
SGPT introduces a novel approach to heterogeneous federated learning by combining shared and group-specific prompts. By balancing universal feature extraction with automated local adaptation, it achieves state-of-the-art performance with high parameter efficiency, effectively bridging the gap between generalization and personalization.
Summary updated