Manuscript Offprint

arXiv:2610.34461

Task Relevance-Driven Prompt Expansion for Federated Continual Learning

Jiahua Dong, Wenqi Liang, Yang Cong, Yichen Li, Hongyuan Yu, Henghui Ding, Yulun Zhang, Salman Khan, Fahad Shahbaz Khan

Jiahua Dong, Wenqi Liang, Yang Cong, Yichen Li, Hongyuan Yu, Henghui Ding, Yulun Zhang, Salman Khan and Fahad Shahbaz Khan

Abstract—Federated continual learning (FCL) has attracted considerable interest by enabling local clients to continually acquire knowledge from new tasks. However, most FCL methods assume that the global server has prior knowledge of the arrival times and number of categories for new tasks, which is unrealistic in the real world. Furthermore, they neglect the importance of positive inter-task semantic relationships when learning new tasks and are significantly affected by irrelevant relationships from old tasks, thereby exacerbating catastrophic forgetting. To resolve the above challenges, we develop a novel Task Relevance-driven Prompt Expansion (TRPE) model. Specifically, to eliminate the reliance on prior knowledge of new tasks, we propose an out-of-distribution detector to identify the arrival of new tasks within local clients, along with a radius-adaptive DBSCAN to infer the quantity of categories in new tasks on the proxy server. Moreover, to explore positive inter-task relationships, we calculate the affinity between the original gradient for learning new task and its gradient orthogonal to the feature space of old tasks to evaluate semantic relevance between old and new tasks from a global perspective. Then, we use this global task relevance to determine the key-prompt pair for new tasks and identify highly related old tasks. After concatenating their prompts for training, we can leverage such positive inter-task relations to improve the continual learning of newly arriving tasks. To balance the learning of new tasks and the forgetting of old ones, a soft orthogonality constraint is applied to the local key and prompt gradients. Experiments spanning diverse datasets and backbones confirm the efficacy of our TRPE model.

Index Terms—Federated Continual Learning, Task Relevance Measure, Prior Knowledge, Catastrophic Forgetting.

1 INTRODUCTION

FEDERATED learning (FL) [23], [25], [60], [73] is a widely adopted collaborative training paradigm that enables multiple distributed local clients to develop a global model while protecting the privacy of their local data [55], [75]. Unlike traditional approaches that require centralizing data, FL allows each client to train the model locally on their own data and communicate only the necessary model updates with a global server [23], [25], [58]. In recent decades, federated learning has achieved significant success in addressing growing concerns over data privacy and security [6], [25], [38], making it particularly valuable in information-sensitive applications such as finance [32], healthcare [9], and mobile technology [31]. While successful, most FL approaches [6],

Jiahua Dong, Salman Khan and Fahad Shahbaz Khan are with the Mohamed bin Zayed University of Artificial Intelligence, Abu Dhabi, UAE. Email: dongjiahua1995@gmail.com, salman.khan@mbzuai.ac.ae, fahad.khan@mbzuai.ac.ae.

• Wenqi Liang is with the University of Trento, Trento, Italy. Email: liangwenqi0123@gmail.com.

• Yang Cong is with the South China University of Technology, Guangzhou, China. Email: congyang81@gmail.com.

• Yichen Li is with the School of Computer Science and Technology, Huazhong University of Science and Technology. Email: ycli0204@hust.edu.cn.

• Hongyuan Yu is with the Xiaomi, Beijing, China. Email: yuhyuan1995@gmail.com.

• Henghui Ding is with the Institute of Big Data, Fudan University, Shanghai, China. Email: henghui.ding@gmail.com.

• Yulun Zhang is with the Shanghai Jiao Tong University, Shanghai, China. Email: yulun100@gmail.com.

Manuscript received April 19, 2005; revised August 26, 2015.

This work was supported in part by the National Nature Science Foundation of China under Grant 62225310, and 62127807.

Jiahua Dong and Wenqi Liang contributed equally to this work.

The corresponding author is Dr. Jiahua Dong.

[58] aim to learn a single task with a fixed dataset on local clients. They struggle to continually learn a sequence of new tasks over time and may experience catastrophic forgetting [44], [74] of old tasks when local clients do not have memory to store all training samples from previous tasks. To tackle this limitation, recent studies have focused on federated continual learning (FCL) [10], [13], [69]. As presented in Fig. 1, FCL allows local clients to learn new tasks consecutively while retaining knowledge from previous tasks, facilitating applications in areas such as healthcare and smart cities.

Generally, mainstream studies on FCL [12], [17], [34], [37] can be broadly classified into two categories: rehearsal-based and rehearsal-free methods. The former allocates a fixed rehearsal buffer to retain some samples from old tasks [10], [13], which can help mitigate catastrophic forgetting by retraining the global model using the training data from both old and new tasks. Unfortunately, this exemplar buffer may raise privacy concerns in many applications [54], further limiting its practical adoption. To address this issue, rehearsal-free FCL approaches apply a regularization term to the global model to preserve the semantic information of old tasks [34], [69] or utilize generative models to replay the training data of old tasks [2], [28]. Nevertheless, they require transmitting the entire model to learn new tasks continuously, resulting in high communication overhead. In light of this, some rehearsal-free FCL methods [37], [41] incorporate prompt learning [62], [65] with FL to enhance communication efficiency. They inject task-specific prompts into a pretrained vision transformer (ViT) [14], achieving state-of-the-art performance in tackling catastrophic forgetting and thereby driving recent advancements in FCL [17].

However, the aforementioned FCL methods [10], [13],

Figure

Fig. 1. Illustration of the Federated Continual Learning (FCL) problem.

[28], [34], [69] unreasonably assume that the global server knows both the arrival times and the total class number of new tasks in advance. This assumption violates privacy protection requirement of FCL [54]. Once this prior knowledge is unavailable, they cannot continue to learn new tasks. Moreover, existing FCL methods [17], [29], [54] overlook the importance of inherent semantic relationships between new and old tasks in addressing forgetting of previous tasks while facilitating the learning of newly arriving tasks. They cannot determine which types of inter-task relationships are effective for facilitating the learning of new tasks from a global perspective, and the improper use of irrelevant semantic relations may exacerbate catastrophic forgetting. To better comprehend these challenges, we introduce an intuitive example in this paper. The structural information of the bus learned from old tasks can provide positive guidance for learning the truck in new tasks, and their shared characteristics help mitigate forgetting related to the bus. Some irrelevant relations, such as correlations in modalities and appearances between the bus and truck, may hinder the learning of new tasks. To explore positive semantic relations between the bus and truck, the global server is assumed to know in advance when local clients receive novel tasks, which is not realistic in the real world.

Inspired by the example above, we summarize two key aspects to address the limitations of existing FCL methods:

• How to Address Dependence on Prior Knowledge: Owing to the heterogeneous data distributions across local clients, the global server cannot realistically obtain prior information about when new tasks emerge or how many classes each incoming task contains. The lack of this prior knowledge makes it difficult for existing FCL methods [10], [54] to learn new tasks continually. Thus, in this work, we aim to enable the global server to automatically detect newly arriving tasks and the quantity of classes in new tasks, so that we exploit intrinsic inter-task relations to facilitate the learning of new tasks while alleviating the forgetting of old tasks.

• How to Explore Positive Inter-Task Relationships: It is challenging to manually evaluate which old task has a closer relationship with the new task, especially when data distributions across local clients are heterogeneous in FCL [29], [34], [37], [69]. In light of this, we focus on developing a novel task relevance measure to accurately quantify the affinity between each old task and the new task from a global perspective. This task relevance measure is essential for exploring positive semantic relations between the new task and highly relevant old tasks, while disregarding irrelevant and noisy inter-task relationships to alleviate forgetting of previous tasks.

To tackle the above challenges, we develop a novel Task Relevance-driven Prompt Expansion (TRPE) model, which falls under the category of prompt-based rehearsal-free FCL [41]. Our model is a pioneering work to eliminate the reliance on prior knowledge of new tasks while exploring positive inter-task relationships to address the forgetting of previous tasks in the FCL field. Specifically, to address the dependence on prior knowledge of new tasks, we propose an out-of-distribution detector to identify when local clients encounter new tasks. Moreover, we design a radius-adaptive DBSCAN module on the proxy server to accurately infer the quantity of classes in each new task without prior knowledge. Additionally, to exploit positive inter-task relations, we utilize singular value decomposition to build feature spaces for old tasks and compute the affinity between the original gradient for learning a novel task and its gradient orthogonal to the feature space of old tasks. This enables us to measure the semantic relevance between new and old tasks from a global perspective. We then use the global task relevance to determine whether the global server expands a new key-prompt pair for the new task or reuses the key-prompt pair from the previous task most relevant to the new one. After concatenating the prompts of the new task with those of some highly relevant old tasks, we inject this concatenated prompt into a pretrained ViT [14] to leverage positive inter-task relations for learning new tasks. Finally, a soft orthogonality constraint is imposed on the key and prompt gradients, achieving a better balance between learning new tasks and mitigating forgetting of previously learned tasks.

The superiority of the proposed TRPE model is validated through extensive experimental studies across diverse benchmarks. The contributions of this work are listed as follows:

• We design a novel Task Relevance-driven Prompt Expansion (TRPE) model, a pioneering work that eliminates strong reliance on prior knowledge of new tasks and explores positive inter-task relationships to mitigate the catastrophic forgetting of old tasks in the FCL field.

• We develop an out-of-distribution detector and a radius-adaptive DBSCAN to address the dependence on prior knowledge. They can detect when new tasks emerge and how many classes each incoming task contains.

• We devise an effective task relevance measure to evaluate intrinsic semantic relations between new and old tasks from a global perspective, which explores positive inter-task relationships for the learning of new tasks.

• We conduct extensive experiments to validate that our model has state-of-the-art performance in addressing diverse class/domain-incremental settings of FCL.

This work extends the methodology proposed in our conference paper [11] from the centralized continual learning paradigm to the more challenging FCL setting, encompassing both class- and domain-incremental scenarios, in which task boundaries and the quantity of categories in each incremental task are unknown and must be inferred in a decentralized manner. While retaining the backbone architectures and the prompt-learning framework proposed by [11] for continual learning at local clients, we introduce several significant methodological improvements to address the challenges of FCL: 1) Unlike [11], which relies heavily on prior knowledge of newly emerging tasks, we design an out-of-distribution detector and a radius-adaptive DBSCAN module to identify newly arriving tasks and estimate the number of classes in each incoming task. 2) We develop an effective task relevance measure to assess the semantic affinity between new and old tasks from a global perspective within the proxy server, and use the resulting global task relevance to determine whether the global server should expand a new key-prompt pair for the new task or reuse the key-prompt pair of the previous task that is most semantically relevant to it. 3) We use the task relevance measure to identify previous semantically relevant tasks and incorporate the corresponding prompts to exploit positive inter-task semantic relationships, thereby facilitating continual learning of novel tasks in FCL. Such exploitation of positive inter-task relationships is largely overlooked by [11] and existing FCL methods. 4) Our TRPE model applies a soft orthogonality constraint to the key and prompt gradients during optimization, achieving a better balance between learning novel tasks and mitigating forgetting of old tasks.

References (77)

  • Conditional channel gated networks for task-aware continual learning
  • A data-free approach to mitigate catastrophic forgetting in federated class incremental learning for vision tasks
  • FedCPrompt: Contrastive prompt for rehearsal-free federated continual learning
  • Il2m: Class incremental learning with dual memory
  • Emerging properties in self-supervised vision transformers
  • Communication-efficient federated deep learning with layerwise asynchronous model update and temporally weighted aggregation
  • Emnist: Extending mnist to handwritten letters
  • Imagenet: A large-scale hierarchical image database
  • Federated learning for healthcare: A comprehensive review
  • No one left behind: Real-world federated class-incremental learning
  • Heterogeneous forgetting compensation for class-incremental learning
  • Learning from each other: Generalized federated incremental semantic segmentation
  • Federated class-incremental learning
  • An image is worth $16 \times 16$ words: Transformers for image recognition at scale
  • Dytox: Transformers for continual learning with dynamic token expansion
  • Self-supervised models are continual learners
  • HePCo: Data-free heterogeneous prompt consolidation for continual federated learning
  • Continual adaptation of vision transformers for federated learning
  • Overcoming catastrophic forgetting in neural networks
  • Technical report, 2009
  • Revamping federated learning security from a defender's perspective: A unified defense with homomorphic encrypted data space
  • Gradient-based learning applied to document recognition
  • Resolving the tug-of-war: A separation of communication and learning in federated learning
  • Prefix-tuning: Optimizing continuous prompts for generation
  • Fedbn: Federated learning on non-iid features via local batch normalization
  • Towards efficient replay in federated incremental learning
  • Personalized federated domain-incremental learning based on adaptive knowledge matching
  • Learning without forgetting
  • Federated learning in mobile edge networks: A comprehensive survey
  • Efficient and secure federated learning for financial applications
  • Gradient episodic memory for continual learning
  • Continual federated learning based on knowledge distillation
  • Representational continuity for unsupervised continual learning
  • Class-incremental learning: Survey and performance evaluation on image classification
  • Pip: Prototypes-injected prompt for federated class incremental learning
  • Communication-Efficient Learning of Deep Networks from Decentralized Data
  • Learning to remember: A synaptic plasticity driven framework for continual learning
  • Continual learning, fast and slow
  • Federated continual learning via prompt-based dual knowledge transfer
  • Better generative replay for continual federated learning
  • Prompt gradient projection for continual learning
  • icarl: Incremental classifier and representation learning
  • Imagenet-21k pretraining for the masses
  • Online structured laplace approximations for overcoming catastrophic forgetting
  • Adapting visual category models to new domains
  • Federated Optimization in Heterogeneous Networks
  • Dbscan revisited, revisited: Why and how you should (still) use dbscan
  • Continual learning with deep generative replay
  • Incremental learning of object detectors without catastrophic forgetting
  • Overcoming forgetting in federated learning on non-iid data (opens arXiv in a new tab)
  • Coda-prompt: Continual decomposed attention-based prompting for rehearsal-free continual learning
  • A closer look at rehearsal-free continual learning*
  • Feduv: Uniformity and variance for heterogeneous federated learning
  • Bring evanescent representations to life in lifelong class incremental learning
  • Text-enhanced data-free approach for federated class-incremental learning
  • Matching networks for one shot learning
  • Caltech-ucsd birds-200-2011
  • Federated learning with matched averaging
  • Towards personalized federated learning via heterogeneous model reassembly
  • Hierarchical decomposition of prompt-based continual learning: Rethinking obscured sub-optimality
  • A comprehensive survey of continual learning: Theory, method and application
  • S-prompts learning with pre-trained transformers: An occam's razor for domain incremental learning
  • Complementary prompting for rehearsal-free continual learning
  • Learning to prompt for continual learning
  • Memory replay gans: Learning to generate new categories without forgetting
  • Fashion-MNIST: a Novel Image Dataset for Benchmarking Machine Learning Algorithms
  • Federated continual learning with weighted inter-client transfer
  • Lifelong learning with dynamically expandable networks
  • Overcoming spatial-temporal catastrophic forgetting for federated class-incremental learning
  • Personalized federated continual learning via multi-granularity prompt
  • Bayesian nonparametric federated learning of neural networks
  • Continual learning through synaptic intelligence
  • An upload-efficient scheme for transferring knowledge from a server-side pretrained generator to clients in heterogeneous federated learning
  • Target: Federated class-continual learning via exemplar-free distillation
  • Rethinking gradient projection continual learning: Stability/plasticity feature space decoupling
  • Expandable subspace ensemble for pre-trained model-based class-incremental learning
  • Image BERT pre-training with online tokenizer