Unlearning during Learning: An Efficient Federated Machine Unlearning Method

Hanlin Gu, Gongxi Zhu, Jie Zhang, Xinyuan Zhao, Yuxing Han, Lixin Fan, Qiang Yang

Abstract

In recent years, Federated Learning (FL) has garnered significant attention as a distributed machine learning paradigm. To facilitate the implementation of the "right to be forgotten," the concept of federated machine unlearning (FMU) has also emerged. However, current FMU approaches often involve additional time-consuming steps and may not offer comprehensive unlearning capabilities, which renders them less practical in real FL scenarios. In this paper, we introduce FedAU, an innovative and efficient FMU framework aimed at overcoming these limitations. Specifically, FedAU incorporates a lightweight auxiliary unlearning module into the learning process and employs a straightforward linear operation to facilitate unlearning. This approach eliminates the requirement for extra time-consuming steps, rendering it well-suited for FL. Furthermore, FedAU exhibits remarkable versatility. It not only enables multiple clients to carry out unlearning tasks concurrently but also supports unlearning at various levels of granularity, including individual data samples, specific classes, and even at the client level. We conducted extensive experiments on MNIST, CIFAR10, and CIFAR100 datasets to evaluate the performance of FedAU. The results demonstrate that FedAU effectively achieves the desired unlearning effect while maintaining model accuracy.

Introduction

The implementation of privacy regulations such as GDPR and CCPA has established the "right to be forgotten," necessitating that machine learning models be able to remove the influence of specific user data upon request. In Federated Learning (FL), where data remains decentralized across numerous clients, this "unlearning" process is particularly challenging. Traditional Federated Machine Unlearning (FMU) methods typically rely on retraining from scratch, which is computationally prohibitive, or techniques like gradient ascent and pruning, which often degrade model performance or require significant post-processing time.

The FedAU Framework

To address these challenges, we propose FedAU (Federated Adaptive Unlearning), a framework designed for "unlearning during learning." Unlike reactive methods that only begin work after a request is received, FedAU is proactive.

Overview of the FedAU framework architecture and module logic.

Auxiliary Unlearning (AU) Module

The core of FedAU is the integration of a lightweight Auxiliary Unlearning (AU) module ($W^a$) alongside the primary learning module ($W^l$). During the standard FL training process, clients update both modules. The AU module is specifically trained to capture the characteristics of data that might need to be forgotten. For sample-level unlearning, the AU module learns to associate target samples with random labels; for class-level unlearning, it focuses on identifying the specific features of the target class.

Instant Unlearning via Linear Operations

The breakthrough of FedAU lies in its use of simple linear algebra to achieve unlearning. When a request is made, the server performs a linear operation on the weights of the final layers:

  • Sample Unlearning: A weighted average is calculated: $\hat{W} = \alpha W^l + (1-\alpha)W^a$.
  • Class Unlearning: The influence of the AU module is subtracted: $\hat{W} = W^l - \beta W^a$.

Because these operations involve basic arithmetic on weight matrices, the unlearning process is nearly instantaneous, occurring in milliseconds rather than the hours required for retraining.

Key Insights and Visualization

FedAU exploits the linear relationship between the weights of the final fully connected layers and the output logits. By proactively training the AU module, the system prepares for unlearning requests in advance.

Visualization of how the linear operation shifts classification boundaries in the feature space to forget specific samples.

As shown in the feature space visualization, the linear combination of the main model and the AU module effectively shifts the decision boundaries. This allows the model to "forget" the specific clusters associated with the unlearn samples while maintaining clear boundaries for the remaining data classes.

Experimental Results

We evaluated FedAU on the MNIST, CIFAR-10, and CIFAR-100 datasets under both IID and Non-IID conditions.

  • Efficiency: FedAU achieved unlearning in approximately 0.001 seconds, compared to ~1,000 seconds for retraining from scratch on CIFAR-10.
  • Effectiveness: The accuracy on forgotten data dropped to near-zero levels, while the accuracy on the remaining data remained within 1-2% of the gold-standard retrained model.
  • Versatility: The framework successfully handled concurrent requests from multiple clients and supported unlearning at sample, class, and client granularities.

Conclusion

FedAU provides a practical and highly efficient solution for the "right to be forgotten" in federated environments. By shifting the computational burden to a proactive, lightweight auxiliary module, it enables instant unlearning without compromising the overall utility of the global model. Future work will explore reducing the storage overhead of the AU module and extending these linear operations to deeper layers of the network.

Summary updated

BibTeX
@inproceedings{gu2024unlearning,
  author = {Hanlin Gu and Gongxi Zhu and Jie Zhang and Xinyuan Zhao and Yuxing Han and Lixin Fan and Qiang Yang},
  title = {{Unlearning during Learning: An Efficient Federated Machine Unlearning Method}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {2024},
  url = {https://openreview.net/forum?id=L5LA1SCfNV},
}
Figure