Continual Adaptation of Vision Transformers for Federated Learning

Shaunak Halbe, James Smith, Junjiao Tian, Zsolt Kira

Abstract

In this paper, we focus on the important yet understudied problem of Continual Federated Learning (CFL), where a server communicates with a set of clients to incrementally learn new concepts over time without sharing or storing any data. The complexity of this problem is compounded by challenges from both the Continual and Federated Learning perspectives. Specifically, models trained in a CFL setup suffer from catastrophic forgetting which is exacerbated by data heterogeneity across clients. Existing attempts at this problem tend to impose large overheads on clients and communication channels or require access to stored data which renders them unsuitable for real-world use due to privacy. In this paper, we attempt to tackle forgetting and heterogeneity while minimizing overhead costs and without requiring access to any stored data. We study this problem in the context of Vision Transformers and explore parameter-efficient approaches to adapt to dynamic distributions while minimizing forgetting. We achieve this by leveraging a prompting based approach (such that only prompts and classifier heads have to be communicated) and proposing a novel and lightweight generation and distillation scheme to consolidate client models at the server. We formulate this problem for image classification and establish strong baselines for comparison, conduct experiments on CIFAR-100 as well as challenging, large-scale datasets like ImageNet-R and DomainNet. Our approach outperforms both existing methods and our own baselines by as much as 7% while significantly reducing communication and client-level computation costs.

Introduction

The rapid deployment of edge devices like smartphones and autonomous vehicles has created a need for systems that can learn new visual concepts incrementally without compromising user privacy. This intersection of Continual Learning (CL) and Federated Learning (FL) is known as Continual Federated Learning (CFL). However, CFL presents a "double whammy" of technical hurdles: catastrophic forgetting, where models lose previously learned knowledge when exposed to new data, and data heterogeneity, where non-IID data across clients causes local models to diverge.

Existing solutions often fail in real-world scenarios because they require clients to store old data (violating privacy), use heavy generative models for "replay," or demand massive communication bandwidth. To address these issues, we introduce HePCo (Heterogeneous Prompt Consolidation), a framework that enables efficient, privacy-preserving decentralized learning.

Methodology: The HePCo Framework

HePCo shifts the computational burden from the client to the server and utilizes parameter-efficient tuning to minimize communication overhead.

Overview of the HePCo framework showing client-level learning and server-side aggregation via pseudo-latent knowledge distillation.

Prompting with Frozen Backbones

Instead of fine-tuning a full Vision Transformer (ViT), HePCo keeps the backbone weights frozen. Clients only learn a small set of "prompts"—learnable tokens—and a classifier head. This strategy ensures that only ~9.5% of total model parameters need to be communicated, drastically reducing bandwidth requirements.

The decomposed prompting mechanism where a query generates a weighted sum of prompts for better stability.

We further improve stability through Decomposed Prompting. Unlike standard hard-selection methods, our approach uses a weighted sum of prompts based on input queries, which provides smoother gradients and better convergence in heterogeneous federated environments.

Latent Generation and Knowledge Distillation

The core innovation of HePCo is its server-side consolidation strategy. To merge divergent client models without accessing raw data, the server trains a lightweight generator to produce pseudo-latents (embeddings) rather than actual images. This approach is computationally efficient and enhances privacy by avoiding pixel-level reconstruction.

The server then uses these pseudo-latents to perform Latent Space Knowledge Distillation. By minimizing the disagreement between the global model and client updates, the server distills collective knowledge into a single coherent model. To prevent the server itself from forgetting, it maintains a copy of the generator from previous tasks, mixing current and past pseudo-latents during distillation.

Experimental Evaluation

We evaluated HePCo on three major image classification benchmarks:

  • CIFAR-100: A standard baseline for continual learning.
  • ImageNet-R: A dataset of artistic renditions (e.g., sketches, paintings) of ImageNet classes, testing robustness to distribution shifts.
  • DomainNet: A large-scale dataset simulating significant domain gaps (e.g., clipart vs. real photos).

Key Results

HePCo consistently outperformed state-of-the-art methods like TARGET and CFed:

  • Accuracy: On ImageNet-R, HePCo improved average accuracy by up to 7% over the strongest baselines.
  • Communication Efficiency: HePCo reduced data transfer to 31.37 MB per exchange, compared to 330 MB for CFed and 714 MB for TARGET—a reduction of over 90%.
  • Zero Client Overhead: All generative replay and distillation tasks are handled by the server, making HePCo ideal for low-power edge devices.

Conclusion

HePCo demonstrates that efficient prompting and latent-space distillation can effectively solve the challenges of catastrophic forgetting and data heterogeneity in Federated Learning. By moving the "heavy lifting" to the server and communicating only parameter-efficient prompts, we achieve state-of-the-art performance with minimal resource consumption. Future work will explore the explainability of learned prompts and the extension of this framework to non-Transformer architectures.

Summary updated

Abstract

In this paper, we focus on the important yet understudied problem of Continual Federated Learning (CFL), where a server communicates with a set of clients to incrementally learn new concepts over time without sharing or storing any data. The complexity of this problem is compounded by challenges from both the Continual and Federated Learning perspectives. Specifically, models trained in a CFL setup suffer from catastrophic forgetting which is exacerbated by data heterogeneity across clients. Existing attempts at this problem tend to impose large overheads on clients and communication channels or require access to stored data which renders them unsuitable for real-world use due to privacy. In this paper, we attempt to tackle forgetting and heterogeneity while minimizing overhead costs and without requiring access to any stored data. We study this problem in the context of Vision Transformers and explore parameter-efficient approaches to adapt to dynamic distributions while minimizing forgetting. We achieve this by leveraging a prompting based approach (such that only prompts and classifier heads have to be communicated) and proposing a novel and lightweight generation and distillation scheme to consolidate client models at the server. We formulate this problem for image classification and establish strong baselines for comparison, conduct experiments on CIFAR-100 as well as challenging, large-scale datasets like ImageNet-R and DomainNet. Our approach outperforms both existing methods and our own baselines by as much as 7% while significantly reducing communication and client-level computation costs. Code available at https://github.com/shaunak27/hepco-fed.
BibTeX
@article{halbe2024continual,
  author = {Shaunak Halbe and James Smith and Junjiao Tian and Zsolt Kira},
  title = {{Continual Adaptation of Vision Transformers for Federated Learning}},
  journal = {Accepted by TMLR},
  year = {2024},
  url = {https://openreview.net/forum?id=vsZ5A3Zxyr},
}
Figure