ReTrack: Data Unlearning in Diffusion Models through Redirecting the Denoising Trajectory

Qitan Shi, Cheng Jin, Jiawei Zhang, Yuantao Gu

TL;DR

Diffusion models are amazing at generating images but can inadvertently memorize and reproduce training data, posing privacy risks. ReTrack offers a novel, efficient method to "unlearn" specific data from these models by redirecting their internal denoising process, achieving strong unlearning without sacrificing image quality.

What Problem Does This Paper Address?

Diffusion models, like Stable Diffusion, have revolutionized image generation. However, a significant drawback is their tendency to memorize training data. This means they can sometimes output images that are nearly identical to specific training examples. This is problematic when training data includes sensitive personal information, copyrighted material, or undesirable content, raising privacy, legal, and ethical concerns. The ideal solution is to retrain the model from scratch without the offending data, but this is computationally prohibitive. Data unlearning aims to modify a pretrained model to forget specific data without full retraining. Existing methods for diffusion models either fail to fully unlearn, degrade generation quality, or are computationally expensive. This paper tackles the challenge of achieving effective and efficient data unlearning for diffusion models while preserving their generative capabilities.

Methods

ReTrack introduces a novel data unlearning approach for diffusion models based on redirecting the denoising trajectory. The core idea is to modify the standard fine-tuning loss to focus on the data to be unlearned.

  • Importance Sampling for Efficient Loss: The authors propose a new loss function that uses importance sampling. Instead of sampling from the entire remaining dataset, it strategically samples from regions closer to the data to be unlearned. This makes the fine-tuning process more efficient by focusing computational effort where it's most needed.
  • Truncated Approximation: To further reduce computational cost, the proposed loss is approximated by retaining only the dominant terms. This is achieved by focusing on the $k$-nearest neighbors of the data to be unlearned within the remaining dataset.
  • Redirecting Denoising Trajectories: The key insight is that this approximated loss encourages the model to redirect its denoising process. Instead of reconstructing an image that would have originally led to the "unlearned" data point, it steers the reconstruction towards its $k$-nearest neighbors in the "allowed" dataset. This is visualized as guiding the denoising path away from the unwanted data point and towards similar, acceptable data points.
  • Regularization: To prevent "catastrophic forgetting" (where unlearning specific data also degrades performance on other data), ReTrack incorporates the standard vanilla fine-tuning loss as a regularizer, balancing unlearning strength with overall model quality.

Datasets

The paper evaluates ReTrack on several standard datasets and a modified version of the Stable Diffusion dataset:

  • MNIST T-Shirt: A modified version of MNIST designed for unlearning tasks.
  • CelebA-HQ: A dataset of high-quality celebrity faces.
  • CIFAR-10: A dataset of common objects.
  • Stable Diffusion Dataset: A dataset constructed by the authors for Stable Diffusion, where specific text-image pairs are targeted for unlearning. This involves sampling images conditioned on a prompt and clustering them to define the "unlearning set" (images to forget) and the "remaining set" (images to keep).

Key Insights and Ideas

  • Unlearning as Trajectory Redirection: The most significant insight is framing data unlearning not just as modifying model weights, but as actively redirecting the internal generative process (the denoising trajectory) of diffusion models.
  • The Power of $k$-Nearest Neighbors: Using the $k$-nearest neighbors of the data to be unlearned as targets for redirection is a clever way to achieve efficient unlearning. It leverages the inherent structure of the data distribution and requires only small, localized adjustments to the model's behavior.
  • Unbiased Loss is Crucial for Quality: The paper emphasizes that maintaining an unbiased fine-tuning loss is critical for preserving the generative quality of diffusion models, a common pitfall of other methods.
  • Importance Sampling is Intrinsic, Not Just a Trick: Unlike some prior methods where importance sampling is a computational shortcut, ReTrack uses it fundamentally to make the unlearning process efficient and effective.

Key Results

ReTrack demonstrates state-of-the-art performance across multiple datasets, achieving a superior trade-off between unlearning strength and generation quality preservation.

  • MNIST T-Shirt: ReTrack achieved perfect unlearning (0% frequency of unlearned images) while maintaining high generation quality (FID of 2.09).
  • CelebA-HQ: ReTrack achieved excellent unlearning (SSCD of 0.41) with minimal impact on generation quality (FID of 21.26), outperforming other quality-preserving methods.
  • CIFAR-10: ReTrack showed strong unlearning (SSCD of 0.37) and maintained high generation quality (FID of 8.45).
  • Stable Diffusion: Experiments showed ReTrack's unlearning metric was only slightly worse than NegGrad (which severely degrades quality), indicating it strikes the best balance for this complex model.

Limitations and Future Work

  • Computational Cost of Finding Neighbors: While ReTrack is efficient during fine-tuning, the initial step of finding $k$-nearest neighbors can still be computationally intensive for very large datasets.
  • Hyperparameter Tuning: The method involves hyperparameters like $k$ and $\lambda$ that need to be tuned for optimal performance, though the paper suggests reasonable defaults.
  • Future Work: The authors suggest exploring more advanced techniques for finding $k$-nearest neighbors and investigating the theoretical underpinnings of unlearning in more complex diffusion model architectures. They also hint at the potential for ReTrack to be extended to other generative models.

Summary updated

BibTeX
@inproceedings{shi2026retrack,
  author = {Qitan Shi and Cheng Jin and Jiawei Zhang and Yuantao Gu},
  title = {{ReTrack: Data Unlearning in Diffusion Models through Redirecting the Denoising Trajectory}},
  booktitle = {International Conference on Artificial Intelligence and Statistics},
  year = {2026},
  url = {https://openreview.net/forum?id=oTUZfa0iPv},
}
Figure