Single Layer Single Gradient Unlearning

Zikui Cai, Yaoteng Tan, M. Salman AsifarXiv 2024 · OpenReview

Abstract: Unauthorized privacy-related and copyrighted content generation using generative-AI is becoming a significant concern for human society, raising ethical, legal, and privacy issues that demand urgent attention. The EU's General Data Protection Regulation (GDPR) include a "right to be forgotten," which allows individuals to request the deletion of their personal data. However, this primarily applies to data stored in traditional databases, not AI models. Recently, machine unlearning techniques have arise that attempt to eliminate the influence of sensitive content used during AI model training, but they often require extensive updates to the deployed systems and incur substantial computational costs. In this work, we propose a novel and efficient method called Single Layer Unlearning Gradient (SLUG), that can unlearn targeted information by updating targeted layers of a model using a one-time gradient computation. Our method is highly modular and enables the selective removal of multiple sensitive concepts, such as celebrity names and copyrighted content, from the generated outputs of widely used foundation models (e.g., CLIP) and generative models (e.g., Stable Diffusion). Broadly, our method ensures AI-generated content complies with privacy regulations and intellectual property laws, fostering responsible use of generative models, mitigating legal risks and promoting a trustworthy, socially responsible AI ecosystem.

Introduction

As large-scale generative models are trained on massive, often uncurated datasets, they inevitably ingest sensitive personal data, copyrighted material, or harmful content. Legal frameworks like the GDPR’s "Right to be Forgotten" and mounting copyright lawsuits necessitate a way to "delete" this information post-training. Traditional machine unlearning methods face a three-fold challenge: efficiency (retraining is too expensive), precision (removing one concept shouldn't degrade others), and robustness (the information shouldn't be easily recoverable). Existing methods often require iterative gradient updates across the entire model, leading to high compute costs and "catastrophic forgetting" of unrelated tasks.

Methodology: The SLUG Framework

We introduce SLUG (Single Layer Unlearning Gradient), a method that simplifies the unlearning process into three main steps, focusing on surgical precision and computational efficiency.

The SLUG pipeline for targeted concept unlearning.
  1. Single Gradient Computation: Instead of iterative training, SLUG computes the gradient for the "forget set" ($D_f$) and the "retain set" ($D_r$) exactly once for the initial model.
  2. Layer Identification via Pareto Optimization: SLUG identifies the optimal layer to modify by seeking a Pareto-optimal trade-off between two metrics:
  3. Layer Importance: How sensitive the layer is to the target information, estimated via Fisher Information.
  4. Gradient Alignment: The cosine similarity between the "forget" and "retain" gradients. SLUG targets layers where these gradients are nearly orthogonal, allowing for weight updates that minimize collateral damage to general knowledge.
  5. One-Step Linear Update: Once a layer is selected, weights are updated along a fixed gradient direction. A simple binary search determines the optimal step size ($\lambda$) to minimize forget accuracy while maintaining general utility.

Experimental Evaluation

SLUG was evaluated across multiple modalities and benchmarks:

  • Identities: Targeted celebrity faces in CLIP and LLaVA using LAION-400M and CelebA datasets.
  • General Utility: Monitored ImageNet classification accuracy to ensure core capabilities remained intact.
  • Artistic Styles & Objects: Utilized the UnlearnCanvas benchmark, testing erasure of specific styles (e.g., Van Gogh) and objects (e.g., dogs) in Stable Diffusion.

Key Results and Insights

SLUG demonstrates that targeted information is often concentrated enough that modifying a single layer is sufficient for effective unlearning. By picking layers with low gradient alignment, the update essentially occurs in the "null space" of retained features.

Layer identification and unlearning performance across vision and language models.
  • Effectiveness: In CLIP, SLUG reduced targeted identity accuracy to 0.0% while maintaining ImageNet accuracy at ~60%, matching the original model's performance.
  • Efficiency: On UnlearnCanvas, SLUG achieved the best trade-off (lowest "Gap Ratio") among 10 state-of-the-art methods, requiring only 39 seconds compared to hours for iterative approaches.
  • Qualitative Success: In Stable Diffusion, SLUG successfully blocked copyrighted characters (e.g., "Iron Man"). For unlearned concepts like "Elon Musk," the model generated generic imagery (e.g., electronic circuits) while retaining the ability to generate other celebrities correctly.
  • Robustness: The method proved resilient against concept arithmetic attacks and weight quantization.

Conclusion and Future Work

SLUG offers a modular and efficient path toward responsible AI by enabling the surgical removal of sensitive content. While highly effective for vision and vision-language models, future work is needed to explore its application to pure Large Language Models (LLMs) like Llama-3 and to develop theoretical proofs for the observed effectiveness of single-layer updates. Additionally, while robust, the potential for sophisticated adversarial recovery of unlearned data remains an open challenge in the field of machine unlearning.

Summary updated

Abstract

Unauthorized privacy-related and copyrighted content generation using generative-AI is becoming a significant concern for human society, raising ethical, legal, and privacy issues that demand urgent attention. The EU's General Data Protection Regulation (GDPR) include a "right to be forgotten," which allows individuals to request the deletion of their personal data. However, this primarily applies to data stored in traditional databases, not AI models. Recently, machine unlearning techniques have arise that attempt to eliminate the influence of sensitive content used during AI model training, but they often require extensive updates to the deployed systems and incur substantial computational costs. In this work, we propose a novel and efficient method called Single Layer Unlearning Gradient (SLUG), that can unlearn targeted information by updating targeted layers of a model using a one-time gradient computation. Our method is highly modular and enables the selective removal of multiple sensitive concepts, such as celebrity names and copyrighted content, from the generated outputs of widely used foundation models (e.g., CLIP) and generative models (e.g., Stable Diffusion). Broadly, our method ensures AI-generated content complies with privacy regulations and intellectual property laws, fostering responsible use of generative models, mitigating legal risks and promoting a trustworthy, socially responsible AI ecosystem.
BibTeX
@misc{cai2024single,
  author = {Zikui Cai and Yaoteng Tan and M. Salman Asif},
  title = {{Single Layer Single Gradient Unlearning}},
  year = {2024},
  eprint = {2407.11867},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2407.11867},
}
Figure