Safe-FCL: Continual Risk Awareness and Fine-Grained Safety Aggregation for Federated Continual Learning of LLMs
Organizations: East China Normal University · Shanghai Innovation Institute
Abstract
Federated fine-tuning enables large language models (LLMs) to learn collaboratively from distributed client data, but malicious client updates can compromise global model safety. As federated tasks evolve, changing malicious update patterns challenge the ability of existing defenses to maintain reliable risk detection over time. To address this challenge, we propose Safe-FCL, a framework integrating continual risk awareness with fine-grained safety aggregation for federated continual learning of LLMs. Specifically, the Continual Risk Awareness (CRA) mechanism learns emerging risk patterns across sequential tasks and constrains detector updates using a protective subspace derived from historical features, mitigating forgetting of previously learned malicious patterns while adapting to new risks. To translate risk awareness into aggregation-level safety control, the Fine-Grained Safety Aggregation (FGSA) mechanism combines client-level risk assessments from CRA with module-level deviations from historical update behavior to adaptively regulate aggregation contributions, suppressing potentially malicious updates while minimizing unnecessary restrictions on benign updates. Extensive experiments demonstrate that Safe-FCL outperforms current SOTA methods, improving global-model Rule and MD-Judge scores in federated continual learning by 0.41% and 0.64%, respectively, while increasing average risk recognition accuracy by 2.01%.
Figures & tables
| Symbol | Description |
|---|---|
| Detector risk score | |
| Historical protection basis | |
| Suspicious-update proportion | |
| Client safety score | |
| Client aggregation weight | |
| Effective LoRA update |
| Method | Task | Rule | MD-Judge | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Task 1 | Task 2 | Task 3 | Task 4 | Avg. | Task 1 | Task 2 | Task 3 | Task 4 | Avg. | ||
| FedAvg | T1 | 46.62 | – | – | – | 46.62 | 41.26 | – | – | – | 41.26 |
| T2 | 46.85 | 72.49 | – | – | 59.67 | 41.72 | 77.16 | – | – | 59.44 | |
| T3 | 36.60 | 66.67 | 33.33 | – | 45.53 | 33.57 | 65.73 | 29.37 | – | 42.89 | |
| T4 | 43.12 | 72.03 | 42.19 | 57.81 | 53.79 | 40.33 | 70.16 | 38.93 | 61.07 | 52.62 | |
| FLAME | T1 | 64.34 | – | – | – | 64.34 | 59.21 | – | – | – | 59.21 |
| Method | Task1 | Task2 | Task3 | Task4 | New ACC | OOD Task ACC | |||
|---|---|---|---|---|---|---|---|---|---|
| AA | AA | AF | AA | AF | AA | AF | |||
| Safe-FedLLM-Step | 91.17 | 92.59 | -2.33 | 81.28 | 6.17 | 87.04 | -0.50 | 86.09 | 90.33 |
| Safe-FedLLM-Client | 88.33 | 86.67 | 1.66 | 91.11 | -9.17 | 92.50 | 1.11 | 88.75 | 91.67 |
| Safe-FedLLM-Shadow | 75.30 | 89.35 | -6.43 | 85.50 | 7.85 | 92.25 | 1.07 | 91.44 | 77.17 |
| Safe-FCL w/o CRA | 92.60 | 98.00 | -4.10 | 93.13 | 7.15 | 92.39 | 8.04 | 97.40 | 96.30 |
| Safe-FCL (Ours) | 94.73 | 98.85 | -3.44 | 96.70 | 3.77 | 94.51 | 6.53 | 98.55 | 96.60 |
| Method | Task1 | Task2 | Task3 | Task4 | OOD | |||||
|---|---|---|---|---|---|---|---|---|---|---|
| Rule | MD-Judge | Rule | MD-Judge | Rule | MD-Judge | Rule | MD-Judge | Rule | MD-Judge | |
| Safe-FCL w/o FGSA | 90.68 | 92.54 | 93.01 | 96.74 | 84.46 | 86.95 | 92.78 | 95.63 | 88.58 | 93.01 |
| Safe-FCL w/o CRA | 89.74 | 91.61 | 91.84 | 95.92 | 84.62 | 87.57 | 91.84 | 95.69 | 90.91 | 96.27 |
| Safe-FCL (Ours) | 90.44 | 92.31 | 93.24 | 96.62 | 85.47 | 87.57 | 92.54 | 95.98 | 95.57 | 96.97 |
Appendix figures & tables8 assets
Supplementary material from the paper’s appendix.
Appendix
| Source IDs | Dataset or source group | Reference | Selected QA |
|---|---|---|---|
| S01 | Fenrir v2.1 (AlicanKiraz0) | ( Kiraz, 2026 ) | 108 |
| S02 | FalseReject | ( Zhang et al., 2025b ) | 28 |
| S03 | HH-RLHF | ( Bai et al., 2022 ) | 471 |
| S04 | gpt-oss-20b red-teaming evals (ChestnutKurisu) | ( Somane et al., n.d. ) | 73 |
| S05 | Circuit Breakers | ( Zou et al., 2024 ) | 456 |
| S06 | harmful-dataset (LLM-LAT) | ( LLM-LAT, n.d. ) | 2,323 |
| Task | Safety Domain | Role |
|---|---|---|
| Physical, public, and material safety | CL | |
| Privacy and information protection | CL | |
| Property, identity, and information deception | CL | |
| Digital security | CL | |
| Discrimination and interpersonal harm | OOD |
| Method | Task | Rule | MD-Judge | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Task 1 | Task 2 | Task 3 | Task 4 | Avg. | Task 1 | Task 2 | Task 3 | Task 4 | Avg. | ||
| Safe-FCL w/o FGSA | T1 | 90.68 | – | – | – | 90.68 | 92.54 | – | – | – | 92.54 |
| T2 | 93.47 | 92.54 | – | – | 93.01 | 97.67 | 95.80 | – | – | 96.74 | |
| T3 | 84.62 | 91.38 | 77.39 | – | 84.46 | 88.81 | 90.68 | 81.35 | – | 86.95 | |
| T4 | 93.71 | 91.38 | 92.31 | 93.71 | 92.78 | 95.10 | 95.57 | 92.77 | 99.07 | 95.63 | |
| Safe-FCL w/o CRA | T1 | 89.74 | – | – | – | 89.74 | 91.61 | – | – | – | 91.61 |
| Method | Task | Rule | MD-Judge | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Task 1 | Task 2 | Task 3 | Task 4 | Avg. | Task 1 | Task 2 | Task 3 | Task 4 | Avg. | ||
| FedAvg | T1 | 74.13 | – | – | – | 74.13 | 80.19 | – | – | – | 80.19 |
| T2 | 64.57 | 60.37 | – | – | 62.47 | 66.43 | 64.57 | – | – | 65.50 | |
| T3 | 69.93 | 72.73 | 47.09 | – | 63.25 | 69.46 | 72.03 | 42.19 | – | 61.23 | |
| T4 | 72.73 | 80.65 | 43.36 | 34.03 | 57.69 | 73.19 | 80.19 | 38.69 | 32.17 | 56.06 | |
| FLAME | T1 | 80.19 | – | – | – | 80.19 | 82.98 | – | – | – | 82.98 |
| Method | Task1 | Task2 | Task3 | Task4 | OOD | |||||
|---|---|---|---|---|---|---|---|---|---|---|
| Rule | MD-Judge | Rule | MD-Judge | Rule | MD-Judge | Rule | MD-Judge | Rule | MD-Judge | |
| Safe-FCL w/o FGSA | 92.07 | 96.04 | 91.96 | 97.32 | 93.09 | 94.64 | 88.00 | 91.43 | 88.34 | 92.54 |
| Safe-FCL w/o CRA | 91.14 | 96.74 | 90.09 | 96.86 | 92.62 | 95.34 | 86.19 | 90.27 | 93.94 | 97.90 |
| Safe-FCL (Ours) | 92.31 | 96.04 | 92.31 | 97.32 | 93.47 | 95.34 | 88.11 | 91.43 | 93.94 | 98.14 |
| Method | Task | Rule | MD-Judge | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Task 1 | Task 2 | Task 3 | Task 4 | Avg. | Task 1 | Task 2 | Task 3 | Task 4 | Avg. | ||
| Safe-FCL w/o FGSA | T1 | 92.07 | – | – | – | 92.07 | 96.04 | – | – | – | 96.04 |
| T2 | 93.24 | 90.68 | – | – | 91.96 | 95.80 | 98.83 | – | – | 97.32 | |
| T3 | 93.71 | 94.41 | 91.14 | – | 93.09 | 93.24 | 96.50 | 94.17 | – | 94.64 | |
| T4 | 91.14 | 96.04 | 87.41 | 77.39 | 88.00 | 92.07 | 97.67 | 92.31 | 83.68 | 91.43 | |
| Safe-FCL w/o CRA | T1 | 91.14 | – | – | – | 91.14 | 96.74 | – | – | – | 96.74 |
| Method | Task1 | Task2 | Task3 | Task4 | New ACC | OOD Task ACC | |||
|---|---|---|---|---|---|---|---|---|---|
| AA | AA | AF | AA | AF | AA | AF | |||
| Safe-FedLLM-Step | 94.67 | 85.00 | 20.67 | 91.00 | 7.09 | 79.62 | 17.00 | 92.38 | 93.00 |
| Safe-FedLLM-Client | 98.33 | 90.84 | 13.33 | 91.67 | 10.00 | 86.25 | 15.55 | 97.08 | 88.33 |
| Safe-FedLLM-Shadow | 99.63 | 85.38 | 28.80 | 90.08 | 14.55 | 91.59 | 10.55 | 99.51 | 94.40 |
| Safe-FCL w/o CRA | 99.93 | 98.10 | 3.70 | 99.66 | 0.05 | 99.36 | 0.27 | 99.56 | 89.93 |
| Safe-FCL (Ours) | 99.93 | 99.99 | -0.04 | 99.85 | 0.02 | 99.64 | -0.01 | 99.62 | 95.87 |
Federated Continual Learning
Federated continual learning enables distributed clients to adapt models to changing data while retaining past knowledge and keeping raw data local.
See all 35 papers