Learning to Forget using Hypernetworks

Jose Miguel Lara Rangel, Usman Anwar, Stefan Schoepf, Jack Foster, David Krueger · DOI

TL;DR

This paper introduces HyperForget, a novel framework for machine unlearning that uses hypernetworks to generate models capable of "forgetting" specific data points while retaining performance on the rest. By leveraging diffusion models, they demonstrate that their Diffusion HyperForget Networks (DiHyFo) can effectively remove targeted data's influence, achieving zero accuracy on the "forget set" while maintaining high accuracy on the "retain set." This offers a promising direction for dynamic and adaptive machine unlearning.

What Problem Does This Paper Address?

The increasing prevalence of AI in sensitive applications, coupled with regulations like GDPR and the EU AI Act, necessitates the ability to "unlearn" specific data from trained machine learning models. This is crucial for several reasons:

  • Security: Removing data poisoning attacks that manipulate model behavior.
  • Privacy: Complying with "right-to-be-forgotten" requests, where individuals can ask for their data to be deleted.
  • Ethics and Regulations: Adhering to evolving AI governance frameworks.

The core challenge is to efficiently and effectively remove the influence of specific data points from a trained model's parameters without having to retrain the entire model from scratch. Retraining is computationally expensive and requires full access to the original dataset, which is often impractical. Existing "machine unlearning" methods aim to achieve this, but often face trade-offs between effectiveness, speed, and complexity.

Methods

The paper proposes HyperForget, a Retrieval-Enhanced Unlearning (REU) framework that treats unlearning as a generative process. The key innovation is the use of hypernetworks.

  • Hypernetworks: These are neural networks that generate the parameters for another "main" neural network. In this context, a hypernetwork is trained to produce parameters for a main network such that the resulting main network exhibits desired performance characteristics – specifically, high performance on the "retain set" (data to be kept) and low performance on the "forget set" (data to be unlearned).
  • Diffusion Models: The authors integrate diffusion models as the hypernetworks, creating Diffusion HyperForget Networks (DiHyFo). Diffusion models are powerful generative models that can learn to generate data (in this case, model parameters) by gradually denoising random noise.
  • Two DiHyFo Implementations:
    • DiHyFo-1: Conditioned on current parameters, current losses, and target losses, acting as a learned optimizer-deoptimizer. It learns to "deoptimize" or "unlearn."
    • DiHyFo-2: Conditioned solely on target losses, acting as a conditioned generator. It directly generates parameters for the desired loss profile.

The core idea is to train the hypernetwork to generate parameters that effectively "forget" the target data, mimicking the behavior of a model that was never trained on that data, while preserving knowledge of the retain data.

Datasets

The experiments were conducted on the following datasets:

  • MNIST: A standard handwritten digit recognition dataset.
  • MNIST-4: A subset of MNIST containing four classes.

The authors collected checkpoints of trained MLP classifiers on these datasets, along with their associated class losses, to train the DiHyFo models.

Key Insights and Ideas

  • Unlearning as a Generative Process: Framing unlearning as a generative task, where the goal is to generate model parameters with specific performance characteristics, is a novel approach.
  • Hypernetworks for Targeted Forgetting: Hypernetworks are shown to be a powerful tool for dynamically generating models that exhibit specific levels of performance on different subsets of data, making them ideal for targeted unlearning.
  • Diffusion Models as Parameter Generators: The successful application of diffusion models as hypernetworks for generating model parameters opens up new avenues for generative unlearning.
  • Dynamic Unlearning: A single DiHyFo model can potentially sample unlearned models for various forget set configurations, enabling more adaptable and dynamic unlearning solutions.

Key Results

The paper presents promising results from Proof-of-Concept experiments:

  • Zero Accuracy on Forget Set: The unlearned models sampled using DiHyFo achieved zero accuracy on the forget set across various forgetting scenarios.
  • High Accuracy on Retain Set: These models maintained good accuracy on the retain set, comparable to models retrained from scratch.
  • Mimicking Retrained Models: The sampled unlearned models closely mimicked the behavior of retrained models, as evidenced by high output overlap and unlearning scores.
  • Robustness: DiHyFo-1 demonstrated more consistent and robust performance across different unlearning tasks, particularly with MNIST.
  • MIA Scores: The obtained Membership Inference Attack (MIA) scores for the sampled unlearned models were close to those of retrained models, indicating good unlearning and robustness against inference attacks.

Limitations and Future Work

The authors acknowledge several limitations and suggest future research directions:

  • Full-Class Unlearning: The current framework focuses on unlearning entire classes. Extending it to unlearn individual data points or subsets of data is a key area for future work.
  • Privacy Guarantees: The generative model retains knowledge of the forget sets, making it unsuitable for strict "unlearning-for-privacy" applications where complete data removal is paramount.
  • Scalability: The use of diffusion models introduces significant computational overhead, and the scalability of the approach to larger models and datasets needs further investigation.
  • Precise Loss Matching: While the models generally align with the direction of target losses, precisely matching the target loss values remains challenging.
  • Future Directions:
    • Evaluating the framework on other datasets (e.g., CIFAR-10, mini-ImageNet).
  • Improving scalability and exploring alternative architectures.
  • Investigating other unlearning tasks beyond class-level forgetting.
  • Leveraging model zoos and learning on latent spaces.

Summary updated

BibTeX
@misc{rangel2024learning,
  author = {Jose Miguel Lara Rangel and Usman Anwar and Stefan Schoepf and Jack Foster and David Krueger},
  title = {{Learning to Forget using Hypernetworks}},
  year = {2024},
  eprint = {2412.00761},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2412.00761},
}
Figure