Deep Unlearning: Fast and Efficient Gradient-free Class Forgetting

Sangamesh Kodge, Gobinda Saha, Kaushik Roy

Abstract

Machine unlearning is a prominent and challenging field, driven by regulatory demands for user data deletion and heightened privacy awareness. Existing approaches involve retraining model or multiple finetuning steps for each deletion request, often constrained by computational limits and restricted data access. In this work, we introduce a novel class unlearning algorithm designed to strategically eliminate specific classes from the learned model. Our algorithm first estimates the Retain and the Forget Spaces using Singular Value Decomposition on the layerwise activations for a small subset of samples from the retain and unlearn classes, respectively. We then compute the shared information between these spaces and remove it from the forget space to isolate class-discriminatory feature space. Finally, we obtain the unlearned model by updating the weights to suppress the class discriminatory features from the activation spaces. We demonstrate our algorithm's efficacy on ImageNet using a Vision Transformer with only ~1.5% drop in retain accuracy compared to the original model while maintaining under 1% accuracy on the unlearned class samples. Furthermore, our algorithm exhibits competitive unlearning performance and resilience against Membership Inference Attacks (MIA). Compared to baselines, it achieves an average accuracy improvement of 1.38% on the ImageNet dataset while requiring up to 10x fewer samples for unlearning. Additionally, under stronger MIA attacks on the CIFAR-100 dataset using a ResNet18 architecture, our approach outperforms the best baseline by 1.8%.

Introduction

As AI models become more integrated into society, the "right to be forgotten"—driven by regulations like GDPR—has become a technical necessity. If a user requests their data be deleted, simply removing it from a database is insufficient, as the model may have "memorized" that data during training. The gold standard for unlearning is retraining the model from scratch without the target data. However, for modern architectures like Vision Transformers (ViT), this is prohibitively expensive.

Existing "approximate" unlearning methods usually rely on iterative gradient descent (fine-tuning), which is slow, can be unstable, and often requires access to large portions of the original training data. This paper introduces a novel "gradient-free" algorithm for machine unlearning that allows models to "forget" specific classes in a single step, making unlearning fast, stable, and sample-efficient enough for large-scale models.

Methodology

The proposed algorithm adopts a geometric approach to unlearning rather than an optimization-based one. The process involves four key stages:

  1. Space Estimation: A small subset of "retain" and "forget" samples is passed through the model to collect activations at each layer.
  2. SVD Analysis: Singular Value Decomposition (SVD) is performed on these activations to identify the basis vectors (directions) representing features for both the classes to be kept and the class to be forgotten.
  3. Isolating Discriminatory Features: The algorithm identifies the "Forget Space" and the "Retain Space." Crucially, it calculates and removes shared information between these spaces from the Forget Space. This ensures that only features unique to the class being deleted are targeted, preventing "catastrophic forgetting" of the remaining classes.
  4. Weight Suppression: Instead of using gradients, a closed-form mathematical transformation is applied to the weights. The weights are projected into a space that suppresses the activations of the forgotten class.
The unlearning framework and evaluation against Membership Inference Attacks (MIA).

This single-step update is a one-time calculation per layer, making it significantly faster than iterative methods.

Experimental Results

The researchers evaluated the method across standard benchmarks including CIFAR-10, CIFAR-100, and ImageNet-1k, using architectures such as VGG11, ResNet18, and Vision Transformers (ViT-B/16).

Performance and Efficiency

On ImageNet using a ViT, the model maintained high accuracy, seeing only a ~1.5% drop for retained classes while the accuracy for the forgotten class dropped to under 1%. The method is remarkably "data-frugal," requiring only ~1,500 samples (0.0012% of the training set) on ImageNet. Furthermore, the SVD-based approach proved to be 60% faster than recent gradient-based baselines when running on standard CPUs.

Qualitative Analysis

Visualizing the decision boundaries reveals that the unlearned model closely mimics the behavior of a model retrained from scratch. When a class (e.g., "Red") is forgotten, the algorithm naturally redistributes that input space to the most similar remaining classes.

Comparison of decision boundaries for the original model, the unlearned model, and a model retrained from scratch.

Privacy Resilience

The unlearned model was tested against Membership Inference Attacks (MIA), which attempt to determine if specific data was used in training. The results showed that the unlearned model performs similarly to a model retrained from scratch, effectively "hiding" the presence of the forgotten data.

Discussion and Limitations

A key insight of this work is that gradients are optional for unlearning; by treating weights as geometric projections, specific feature directions can be mathematically "zeroed out." However, the algorithm assumes a significant distributional difference in activations between "forget" and "retain" samples. If classes are extremely similar or if the request is to forget a random subset of data rather than a whole class, the SVD may struggle to isolate the correct features. Additionally, while the method has fewer hyperparameters than gradient descent, it still requires tuning scaling coefficients ($\alpha_r$ and $\alpha_f$) to balance forgetting and retention.

Conclusion

This research presents a fast, efficient, and gradient-free approach to class unlearning. By leveraging SVD to isolate and suppress class-specific features, the method achieves state-of-the-art performance on large-scale datasets with minimal data and computational overhead, providing a practical solution for meeting regulatory privacy requirements in modern AI systems.

Summary updated

BibTeX
@article{kodge2024deep,
  author = {Sangamesh Kodge and Gobinda Saha and Kaushik Roy},
  title = {{Deep Unlearning: Fast and Efficient Gradient-free Class Forgetting}},
  journal = {Accepted by TMLR},
  year = {2024},
  url = {https://openreview.net/forum?id=BmI5p6wBi0},
}
Figure