LoReUn: Data Itself Implicitly Provides Cues to Improve Machine Unlearning

Xiang Li, Qianli Shen, Haonan Wang, Kenji Kawaguchi

TL;DR

Machine unlearning (MU) removes the influence of sensitive or harmful data from trained models without retraining from scratch, but existing methods struggle because some data points are much harder to unlearn or retain than others. LoReUn (Loss-based Reweighting Unlearning) solves this by dynamically reweighting data points during unlearning based on their loss difference relative to the original model. This lightweight, plug-and-play approach narrows the gap with exact retraining in both image classification and text-to-image diffusion tasks without incurring heavy computational overhead.

What Problem Does This Paper Address?

Deep models—particularly generative text-to-image systems—frequently memorize private, copyrighted, or inappropriate content from training data. When prompted, they can generate harmful imagery (such as nudity or violence). Exact unlearning (retraining from scratch without the undesirable data) provides a gold standard, but it is computationally prohibitive.

Approximate machine unlearning techniques (such as Random Labeling or saliency-based updates) are faster, but they treat all samples equally. In practice, individual data points exhibit varying "difficulty": some are heavily memorized and stubborn to erase, while others in the retain set are easily corrupted by the unlearning process. Previous methods that explicitly quantified data difficulty relied on expensive memorization or entanglement calculations. The challenge is capturing and adapting to sample difficulty dynamically and cheaply.

Methods

LoReUn introduces a simple hypothesis: the training loss of a sample implicitly signals its unlearning difficulty relative to the original model.

  1. Precomputing Reference Losses: The original model evaluates the average reference loss on the forget set ($\ell_f^o$) and retain set ($\ell_r^o$). For diffusion models—where loss varies drastically across diffusion timesteps $t$—the authors sample losses across 10 discrete timesteps and fit an exponential curve $\ell_t^o$ to estimate baseline loss across all timesteps efficiently.

  2. Dynamic Loss-Based Reweighting:

  3. Forgetting Set: An ideal unlearned model should have high loss on the forget set. If a forget sample still exhibits low "excess loss" (it remains close to the reference loss), it is stubborn and well-memorized. LoReUn upweights it using exponential decay: $$w'_f(\ell) = \exp(-\eta_f \cdot d(\ell, \ell_f^o))$$
  4. Retaining Set: An ideal model should maintain low loss on retained data. If a retain sample's loss spikes, the unlearning update is corrupting it. LoReUn upweights degraded retain points using exponential growth: $$w'_r(\ell) = \exp(\eta_r \cdot d(\ell, \ell_r^o))$$ (Here, $d(\cdot, \cdot)$ measures absolute difference for classification, or relative ratio $\ell / \ell_t^o$ for diffusion models).
  5. Plug-and-Play Optimization: Weights are normalized per batch and plugged directly into standard random-labeling objectives (like RL or SalUn) without requiring extra forward passes or model copies during training.

Datasets

  • CIFAR-10: Evaluated on a ResNet-18 architecture for both 10% random sample forgetting and full class-wise forgetting.
  • Imagenette (10-class ImageNet subset): Evaluated on Stable Diffusion for class-wise concept erasure using prompt templates like "an image of [class name]".
  • I2P (Inappropriate Image Prompts): Evaluated on Stable Diffusion using 931 nudity-related sexual prompts (e.g., "shirtless man on a bed"), with generated images evaluated via the NudeNet detector.

Key Insights and Ideas

  • Loss as an implicit difficulty proxy: Instead of running auxiliary models or data attribution schemes to quantify memorization, the current-vs-original loss difference dynamically reveals whether a sample needs stronger unlearning or stronger preservation.
  • Timestep normalization in diffusion: Because diffusion loss naturally declines at larger timesteps, using a fitted reference curve and ratio-based loss differences ensures fair sample weighting across noisy latents.
  • Asymmetric weighting strategy: Reweighting must act inversely across sets: penalize samples in the forget set that resist loss increases, and penalize samples in the retain set that suffer loss increases.

Key Results

  • Image Classification (CIFAR-10):
  • In class-wise unlearning, integrating LoReUn with SalUn improved the "Tug-of-War" (ToW) balance metric to 0.9958 (near-perfect match to Retrain's 1.00), achieving 0.002% forget accuracy while keeping retain accuracy at 99.85% and test accuracy at 94.57%.
  • In 10% random unlearning, LoReUn combined with SalUn achieved 0.9882 ToW and matched Retrain's membership inference attack (MIA) resilience closely, running in 2.54 seconds versus Retrain's 41.93 seconds.
  • Class-wise Diffusion Erasure (Imagenette):
  • LoReUn on the forget set ($\text{LoReUn}_f$) achieved 0.00% Unlearning Accuracy (UA) across all 10 classes while improving generation quality on retain classes to an FID of 1.06 (outperforming SalUn's 1.22, FMN's 1.30, and ESD's 1.49).
  • NSFW Concept Removal (I2P):
  • LoReUn generated the fewest nudity-related images across all audited categories, achieving zero detected generations in female genitalia, male genitalia, and buttocks.
  • Visualizations confirm that while baselines like SalUn often distort overall prompt style and non-sensitive semantics, LoReUn preserves composition while safely neutralizing nude concepts.

Limitations and Future Work

  • Hyperparameter Sensitivity: The method introduces weighting scaling hyperparameters ($\eta_f, \eta_r$), which require manual tuning depending on whether the task is random or class-wise forgetting.
  • Scope of Generation: Experiments focused primarily on object classes (Imagenette) and nudity (I2P); evaluating broader copyright styles, artistic concepts, or text-based large language models (LLMs) remains open for investigation.
  • Adversarial Prompting: While evaluated on benign inappropriate prompts from I2P, the paper does not systematically evaluate resilience against adversarial red-teaming or jailbreak prompt injections.

Summary updated

BibTeX
@inproceedings{li2024loreun,
  author = {Xiang Li and Qianli Shen and Haonan Wang and Kenji Kawaguchi},
  title = {{LoReUn: Data Itself Implicitly Provides Cues to Improve Machine Unlearning}},
  booktitle = {SafeGenAi @ NeurIPS},
  year = {2024},
  url = {https://openreview.net/forum?id=1R9V2oWSjh},
}
Figure