Few-Shot Concept Unlearning with Low Rank Adaptation
Udaya Shreyas, L. N. Aadarsh
TL;DR
This work tackles privacy and copyright concerns in text-to-image diffusion models by enabling fast, targeted concept unlearning without full retraining. It introduces a few-shot, low-rank adaptation approach that perturbs the final layers of the CLIP text encoder via a perturbation $\Delta P=AB^{\top}$, while keeping most of the model frozen, and optimizes a weighted loss to forget a concept while preserving retained knowledge. The method integrates with the Stable Diffusion pipeline and uses small forget datasets (4–5 images) to achieve unlearning in roughly tens of seconds to a minute, balancing effectiveness and efficiency. The results demonstrate the approach’s practicality for privacy-preserving diffusion models and highlight avenues for zero-shot extensions and broader applicability.
Abstract
Image Generation models are a trending topic nowadays, with many people utilizing Artificial Intelligence models in order to generate images. There are many such models which, given a prompt of a text, will generate an image which depicts said prompt. There are many image generation models, such as Latent Diffusion Models, Denoising Diffusion Probabilistic Models, Generative Adversarial Networks and many more. When generating images, these models can generate sensitive image data, which can be threatening to privacy or may violate copyright laws of private entities. Machine unlearning aims at removing the influence of specific data subsets from the trained models and in the case of image generation models, remove the influence of a concept such that the model is unable to generate said images of the concept when prompted. Conventional retraining of the model can take upto days, hence fast algorithms are the need of the hour. In this paper we propose an algorithm that aims to remove the influence of concepts in diffusion models through updating the gradients of the final layers of the text encoders. Using a weighted loss function, we utilize backpropagation in order to update the weights of the final layers of the Text Encoder componet of the Stable Diffusion Model, removing influence of the concept from the text-image embedding space, such that when prompted, the result is an image not containing the concept. The weighted loss function makes use of Textual Inversion and Low-Rank Adaptation.We perform our experiments on Latent Diffusion Models, namely the Stable Diffusion v2 model, with an average concept unlearning runtime of 50 seconds using 4-5 images.
