Debiasing Machine Unlearning with Counterfactual Examples

Ziheng Chen, Jia Wang, Jun Zhuang, Abbavaram Gowtham Reddy, Fabrizio Silvestri, Jin Huang, Kaushiki Nag, Kun Kuang, Xin Ning, Gabriele TolomeiarXiv 2024 · DOI

Abstract

Machine Unlearning (MU) is essential for compliance with privacy regulations like the "Right to be Forgotten," yet existing methods often introduce unintended biases. This paper proposes a novel framework that combines causal intervention with counterfactual examples to ensure data removal does not compromise model fairness or accuracy. By treating forgotten samples as counterfactuals and applying a contrastive boundary loss, the framework achieves superior privacy protection and performance preservation compared to state-of-the-art baselines.

Introduction

As AI systems become more integrated into society, the ability to selectively erase specific training data—known as Machine Unlearning (MU)—has become a regulatory necessity. However, simply removing data can lead to "unlearning bias." This research addresses two primary forms of this bias: data-level bias, where removing samples creates spurious correlations, and algorithm-level bias, where forcing high error on forgotten data distorts the model's decision logic.

The Bias Problem in Unlearning

Existing MU techniques often fail because they treat the "forget set" as noise. For example, if a model is told to forget "rabbits," it might naturally reclassify them as "hamsters" due to semantic similarity. Forcing the model to instead classify them as something unrelated (like an "airplane") creates sharp, unnatural decision boundaries that degrade performance on the remaining data ($D_r$).

Figure 1: Unlearning as strategic boundary expansion using counterfactual examples.

As shown in Figure 1, the authors propose viewing unlearning not as deletion, but as strategically expanding the decision boundaries of semantically similar classes to encompass the forgotten data ($x$) via counterfactual counterparts ($x^{CF}$).

Methodology

The proposed framework utilizes a teacher-student architecture where the original model (teacher) guides the unlearning model (student) through two primary mechanisms:

1. Causal Intervention for "Remembering"

To prevent the model from learning shortcuts during the unlearning process, the authors employ a Structural Causal Model (SCM). By applying "do-calculus," they decouple object features from background noise. This ensures the student model maintains its performance on $D_r$ by focusing on invariant causal features rather than coincidental correlations.

2. Counterfactual Examples for "Forgetting"

Instead of maximizing error on the forget set ($D_f$), the model is guided to treat these samples as counterfactuals. A counterfactual example is a version of the input with minimal changes required to flip its label to a semantically similar class.

Figure 3: The overall framework showing the teacher-student relationship, KL divergence for remembering/forgetting, and contrastive learning.

3. Contrastive Boundary Loss

As illustrated in Figure 3, a contrastive loss is used to pull forgotten samples closer to their counterfactual counterparts in the representation space while pushing them away from unrelated classes. This creates a smoother transition in the decision boundary, preserving the model's overall logical structure.

Experimental Results

The researchers evaluated their method on image classification (CIFAR-100, CUB200) and tabular fairness benchmarks (Adult, German).

  • Privacy Protection: The method achieved a Membership Inference Attack (MIA) score of 0.07, significantly outperforming baselines like SCRUB (0.11), indicating it is much harder to detect if data was previously in the training set.
  • Accuracy Preservation: When removing 40% of the data, the Remaining Accuracy (RA) was 5-8% higher than common baselines.
  • Fairness: On the Adult dataset, the method maintained a Disparate Impact (DI) score of 0.85, closely matching the fairness of a model retrained from scratch, whereas other MU methods saw fairness significantly decline.
  • Efficiency: The approach proved to be 5.6x faster than SISA, the current "gold standard" for exact unlearning, while maintaining better performance.

Conclusion

By framing machine unlearning as a causal and counterfactual problem, this research provides a path toward privacy-compliant AI that does not sacrifice fairness or accuracy. Future work will focus on extending these causal masks and counterfactual strategies to Natural Language Processing (NLP) tasks and optimizing the computational overhead of generating counterfactuals at scale.

Summary updated

BibTeX
@misc{chen2024debiasing,
  author = {Ziheng Chen and Jia Wang and Jun Zhuang and Abbavaram Gowtham Reddy and Fabrizio Silvestri and Jin Huang and Kaushiki Nag and Kun Kuang and Xin Ning and Gabriele Tolomei},
  title = {{Debiasing Machine Unlearning with Counterfactual Examples}},
  year = {2024},
  eprint = {2404.15760},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2404.15760},
}
Figure