Paper deep dive
EraseDiff: Erasing Data Influence in Diffusion Models
Jing Wu, Trung Le, Munawar Hayat, Mehrtash Harandi
Models: DDIM, DDPM, Stable Diffusion v1.4
Intelligence
Status: succeeded | Model: google/gemini-3.1-flash-lite-preview | Prompt: intel-v1 | Confidence: 94%
Last extracted: 3/12/2026, 7:26:15 PM
Summary
EraseDiff is a novel algorithm for diffusion models that enables the removal of specific data influences (e.g., NSFW content) while preserving overall model utility. It formulates the unlearning task as a constrained optimization problem using the value function, allowing for a natural first-order solution that balances erasure and preservation more effectively than existing methods.
Entities (5)
Relation Signals (3)
EraseDiff â erasesinfluencefrom â Diffusion Models
confidence 98% ¡ EraseDiff, an algorithm designed to preserve the utility of the diffusion model on retained data while removing the unwanted information
EraseDiff â optimizes â Constrained Optimization Problem
confidence 95% ¡ Our approach formulates this task as a constrained optimization problem using the value function
Diffusion Models â generates â NSFW content
confidence 90% ¡ Diffusion models are susceptible to misuse and can generate NSFW digital content
Cypher Suggestions (0)
No Cypher suggestions yet.
Abstract
Abstract:Diffusion models are highly effective at generating high-quality images but pose risks, such as the unintentional generation of NSFW (not safe for work) content. Although various techniques have been proposed to mitigate unwanted influences in diffusion models while preserving overall performance, achieving a balance between these goals remains challenging. In this work, we introduce EraseDiff, an algorithm designed to preserve the utility of the diffusion model on retained data while removing the unwanted information associated with the data to be forgotten. Our approach formulates this task as a constrained optimization problem using the value function, resulting in a natural first-order algorithm for solving the optimization problem. By altering the generative process to deviate away from the ground-truth denoising trajectory, we update parameters for preservation while controlling constraint reduction to ensure effective erasure, striking an optimal trade-off. Extensive experiments and thorough comparisons with state-of-the-art algorithms demonstrate that EraseDiff effectively preserves the model's utility, efficacy, and efficiency.
Tags
Links
- Source: https://arxiv.org/abs/2401.05779
- Canonical: https://arxiv.org/abs/2401.05779
Trouble viewing inline? Open PDF directly â
Full Text
110,532 characters extracted from source content.
Expand or collapse full text
Erasing Undesirable Influence in Diffusion Models Jing Wu1, Trung Le1, Munawar Hayat2, Mehrtash Harandi1 1Monash University, Melbourne, VIC, Australia, 2Qualcomm, San Deigo, CA, US jing.wu1, trunglm, mehrtash.harandi@monash.edu, hayat@qti.qualcomm.com Abstract Diffusion models are highly effective at generating high-quality images but pose risks, such as the unintentional generation of NSFW (not safe for work) content. Although various techniques have been proposed to mitigate unwanted influences in diffusion models while preserving overall performance, achieving a balance between these goals remains challenging. In this work, we introduce EraseDiff, an algorithm designed to preserve the utility of the diffusion model on retained data while removing the unwanted information associated with the data to be forgotten. Our approach formulates this task as a constrained optimization problem using the value function, resulting in a natural first-order algorithm for solving the optimization problem. By altering the generative process to deviate away from the ground-truth denoising trajectory, we update parameters for preservation while controlling constraint reduction to ensure effective erasure, striking an optimal trade-off. Extensive experiments and thorough comparisons with state-of-the-art algorithms demonstrate that EraseDiff effectively preserves the modelâs utility, efficacy, and efficiency. WARNING: This paper contains sexually explicit imagery that may be offensive in nature. Figure 1: Top to Bottom: generated samples by SD v1.4 and model scrubbed by our method, when erasing the concept of ânudityâ. Our method can avoid NSFW (not safe for work) content while preserving model utility. 1 Introduction Diffusion Models [30, 59, 48] are now the method of choice in deep generative models, owing to their high-quality output, stability, and ease of training procedure. This has facilitated their successful integration into commercial applications such as midjourney. Unfortunately, the ease of use associated with diffusion models brings forth significant privacy risks. Studies have shown that these models can memorize and regenerate individual images from their training datasets [57, 58, 10]. Beyond privacy, diffusion models are susceptible to misuse and can generate NSFW digital content [47, 51, 53]. In this context, individuals whose images are used for training might request the removal of their private data. In particular, data protection regulations like the European Union General Data Protection Regulation (GDPR) [63] and the California Consumer Privacy Act (CCPA) [24] grant users the right to be forgotten, obligating companies to expunge data pertaining to a user upon receiving a request for deletion. These legal provisions grant data owners the right to remove their data from trained models and eliminate its influence on said models [4, 25, 23, 43, 55, 67, 60, 61, 11]. A straightforward solution is to retrain the model from scratch after excluding the data that needs to be forgotten. However, the removal of pertinent data followed by retraining diffusion models from scratch demands substantial resources and is often deemed impractical. A version of the stable diffusion model trained on subsets of the LAION-5B dataset [54] costs approximately 150,000 GPU hours with 256 A100 GPUs111https://stablediffusion.gitbook.io/overview/stable-diffusion-overview/technology/training-procedures. Existing research on erasing unwanted influence has primarily focused on classification tasks [33, 7, 22, 4, 66, 25, 23, 43, 55, 11]. Despite substantial progress, prior methods developed in classification are observed to be ineffective for generation tasks [16]. Consequently, there is a pressing need for the development of methods capable of scrubbing data from diffusion models without necessitating complete retraining. Recently, a handful of studies [20, 21, 69, 27, 28, 35, 16, 40, 6] target unlearning in diffusion models, with a primary focus on the text-to-image models [20, 21, 69]. Broadly, these methods aim to achieve two main objectives: erasing data influence and preserving overall model performance. However, as demonstrated by Bui et al. [5], balancing this trade-off remains challenging. In this work, we propose EraseDiff, an algorithm tailored to balance the overall performance of diffusion models with the erasure of undesirable information. Drawing inspiration from optimization-based meta-learning algorithms [41, 18] that enable fast adaptation to new learning tasks, we formulate this challenge as a bi-level optimization problem, where the âinnerâ optimization focus on erasing undesirable influence and the âouterâ objective seeks to preserve model performance. The outer objective and inner optimization are interdependent, iterating between preservation and erasure to balance the trade-off effectively. However, this nested optimization can be challenging to optimize efficiently. The inner optimization may converge to a saddle point or struggle with non-convex functions, making it difficult to achieve a stable solution [38]. Therefore, we further reformulate the problem as a constrained optimization problem using the value function [39, 45, 68], which facilitates a natural first-order solution [38], allows us to optimize preservation and erasure in a unified manner. This approach achieves a fine-tuned balance between preservation and targeted erasure, yielding an optimal trade-off. We benchmark EraseDiff on various scenarios, encompassing unlearning of classes on CIFAR-10 [34] with Denoising Diffusion Probabilistic Models (DDPM) [30], classes on Imagenette [31] and concepts on the I2P dataset [53] with stable diffusion. Our empirical findings show that EraseDiff is 11Ă11Ă11 Ă faster than Heng and Sohâs method [28] and 2Ă2Ă2 Ă faster than Fanâs method [16] when forgetting on DDPM while achieving better unlearning results across several metrics. The results demonstrate that EraseDiff is capable of effectively erasing data influence in diffusion models, ranging from specific classes to the concept of nudity. 2 Background In this section, we outline the components of the models we evaluate, including DDPM and latent diffusion models [48]. Throughout the paper, we denote scalars, and vectors/matrices by lowercase and bold symbols, respectively (e.g., a, aitalic_a, Aitalic_A). DDPM. (1) Diffusion: DDPM gradually diffuses the data distribution âdâ0âźqâ˘()containssuperscriptâsubscript0similar-toR^d x_0 q(x)blackboard_Rd â x0 âź q ( x ) into the standard Gaussian distribution âdâĎľâźâ˘(,d)containssuperscriptâbold-italic-Ďľsimilar-to0subscriptR^d Îľ N( 0,I_d)blackboard_Rd â italic_Ďľ âź N ( 0 , Iitalic_d ) with T time steps, i.e., qâ˘(t|tâ1)=â˘(t;Îątâ˘tâ1,(1âÎąt)â˘d)conditionalsubscriptsubscript1subscriptsubscriptsubscript11subscriptsubscriptq(x_t|x_t-1)=N(x_t; % _tx_t-1,(1- _t)I_d)q ( xitalic_t | xitalic_t - 1 ) = N ( xitalic_t ; square-root start_ARG Îąitalic_t end_ARG xitalic_t - 1 , ( 1 - Îąitalic_t ) Iitalic_d ), where Îąt=1âβtsubscript1subscript _t=1- _tÎąitalic_t = 1 - βitalic_t and βtt=1Tsubscriptsuperscriptsubscript1\ _t\^T_t=1 βitalic_t Titalic_t = 1 are the pre-defined variance schedule. The diffusion takes the form tsubscriptx_txitalic_t as t=ι¯tâ˘0+1âι¯tâ˘ĎľsubscriptsubscriptÂŻsubscript01subscriptÂŻbold-italic-Ďľx_t= Îą_tx_0+ 1- Îą_% t Îľxitalic_t = square-root start_ARG overÂŻ start_ARG Îą end_ARGt end_ARG x0 + square-root start_ARG 1 - overÂŻ start_ARG Îą end_ARGt end_ARG italic_Ďľ, where ι¯t=âi=1tÎąisubscriptÂŻsuperscriptsubscriptproduct1subscript Îą_t= _i=1^t _ioverÂŻ start_ARG Îą end_ARGt = âi = 1t Îąitalic_i. (2) Training: A model Ďľâ˘(â )subscriptitalic-Ďľâ _ θ(¡)Ďľbold_italic_θ ( â ) with parameters âânsuperscriptâ θâR^nitalic_θ â blackboard_Rn is trained to learn the reverse process pâ˘(tâ1|t)âqâ˘(tâ1|t)subscriptconditionalsubscript1subscriptconditionalsubscript1subscriptp_ θ(x_t-1|x_t)â q(x_% t-1|x_t)pbold_italic_θ ( xitalic_t - 1 | xitalic_t ) â q ( xitalic_t - 1 | xitalic_t ). Given 0âźqâ˘()similar-tosubscript0x_0 q(x)x0 âź q ( x ) and time step tâ[1,T]1tâ[1,T]t â [ 1 , T ], the simplified training objective is to minimize the distance between Ďľbold-italic-Ďľ Îľitalic_Ďľ and the predicted Ďľtsubscriptbold-italic-Ďľ Îľ_titalic_Ďľitalic_t given 0subscript0x_0x0 at time t, i.e., âĎľâĎľâ˘(t,t)ânormbold-italic-Ďľsubscriptitalic-Ďľsubscript\| Îľ- _ θ(x_t,t)\|⼠italic_Ďľ - Ďľbold_italic_θ ( xitalic_t , t ) âĽ. (3) Sampling: after training the model, we could obtain the learnable backward distribution pââ˘(tâ1|t)=â˘(tâ1;ââ˘(t,t),ââ˘(t,t))subscriptsuperscriptconditionalsubscript1subscriptsubscript1subscriptsuperscriptsubscriptsubscriptsuperscriptsubscriptp_ θ^*(x_t-1|x_t)=N(% x_t-1; Îź_ θ^*(x_t,t), % _ θ^*(x_t,t))pbold_italic_θâ ( xitalic_t - 1 | xitalic_t ) = N ( xitalic_t - 1 ; italic_Îźbold_italic_θâ ( xitalic_t , t ) , ÎŁbold_italic_θâ ( xitalic_t , t ) ), where ââ˘(t,t)=1Îątâ˘(tâβt1âÎątâ˘Ďľâ˘(t,t))subscriptsuperscriptsubscript1subscriptsubscriptsubscript1subscriptsubscriptitalic-Ďľsubscript Îź_ θ^*(x_t,t)= 1 _t% (x_t- _t 1- _t _ θ% (x_t,t))italic_Îźbold_italic_θâ ( xitalic_t , t ) = divide start_ARG 1 end_ARG start_ARG square-root start_ARG Îąitalic_t end_ARG end_ARG ( xitalic_t - divide start_ARG βitalic_t end_ARG start_ARG square-root start_ARG 1 - Îąitalic_t end_ARG end_ARG Ďľbold_italic_θ ( xitalic_t , t ) ) and ââ˘(t,t)=(1âι¯tâ1)â˘Î˛t1âι¯tsubscriptsuperscriptsubscript1subscriptÂŻ1subscript1subscriptÂŻ _ θ^*(x_t,t)= (1- Îą_t% -1) _t1- Îą_tÎŁbold_italic_θâ ( xitalic_t , t ) = divide start_ARG ( 1 - overÂŻ start_ARG Îą end_ARGt - 1 ) βitalic_t end_ARG start_ARG 1 - overÂŻ start_ARG Îą end_ARGt end_ARG. Then, given Tâźâ˘(,d)similar-tosubscript0subscriptx_T N( 0,I_d)xitalic_T âź N ( 0 , Iitalic_d ), 0subscript0x_0x0 could be obtained via sampling from pââ˘(tâ1|t)subscriptsuperscriptconditionalsubscript1subscriptp_ θ^*(x_t-1|x_t)pbold_italic_θâ ( xitalic_t - 1 | xitalic_t ) from t=Tt=Tt = T to t=11t=1t = 1 step by step. Latent diffusion models. Latent diffusion models apply the diffusion models in the latent space zz of a pre-trained variational autoencoder. The noise would be added to =Îľâ˘()z= (x)z = Îľ ( x ), instead of the data xx, and the denoised output would be transformed to image space with the decoder. Besides, text embeddings generated by models like CLIP are used as conditioning inputs. 3 Diffusion Unlearning Let =i,ciiNsuperscriptsubscriptsubscriptsubscriptD=\x_i,c_i\_i^ND = xitalic_i , citalic_i iitalic_N be a dataset of images isubscriptx_ixitalic_i associated with label cisubscriptc_icitalic_i representing the class. =1,âŻ,C1âŻC=\1,¡s,C\C = 1 , ⯠, C denotes the label space where C is the total number of classes and ciâsubscriptc_iâCcitalic_i â C. We split the training data DD into the forgetting data fâsubscriptD_fâDDitalic_f â D and its complement, remaining data r=âfsubscriptsubscriptD_r=D D_fDitalic_r = D â Ditalic_f. The forgetting data has label space fâsubscriptC_f CCitalic_f â C, and the remaining label space is denoted as r=âfsubscriptsubscriptC_r=C C_fCitalic_r = C â Citalic_f. 3.1 Training objective Our goal is to scrub the information about fsubscriptD_fDitalic_f carried by the diffusion models while maintaining the model utility over the remaining data rsubscriptD_rDitalic_r. To achieve this, we adopt different training objectives for rsubscriptD_rDitalic_r and fsubscriptD_fDitalic_f as follows. For the remaining data rsubscriptD_rDitalic_r, we fine-tune the diffusion models with the original objective: âr(;r)=t,Ďľââ˘(,d),(0,c)âźrĂr[âĽĎľâĎľ(t|c)âĽ22], L_r( θ;D_r)=E_t,% ÎľâN( 0,I_d),(x_0,c)% D_rĂC_r[\| Îľ- _ % θ(x_t|c)\|_2^2],Litalic_r ( italic_θ ; Ditalic_r ) = blackboard_Et , italic_Ďľ â N ( 0 , I start_POSTSUBSCRIPT d ) , ( x0 , c ) âź Ditalic_r Ă Citalic_r end_POSTSUBSCRIPT [ ⼠italic_Ďľ - Ďľbold_italic_θ ( xitalic_t | c ) âĽ22 ] , (1) where t=ι¯tâ˘0+1âι¯tâ˘ĎľsubscriptsubscriptÂŻsubscript01subscriptÂŻbold-italic-Ďľx_t= Îą_tx_0+ 1- Îą_% t Îľxitalic_t = square-root start_ARG overÂŻ start_ARG Îą end_ARGt end_ARG x0 + square-root start_ARG 1 - overÂŻ start_ARG Îą end_ARGt end_ARG italic_Ďľ. For the forgetting data fsubscriptD_fDitalic_f, we aim to let the models fail to generate meaningful images corresponding to fsubscriptC_fCitalic_f and thus propose: âf(;f)=t,Ďľââ˘(,d),(0,c)âźfĂf[âĽĎľfâĎľ(t|c)âĽ22], L_f( θ;D_f)=E_t,% ÎľâN( 0,I_d),(x_0,c)% D_fĂC_f[\| Îľ_f- _% θ(x_t|c)\|_2^2],Litalic_f ( italic_θ ; Ditalic_f ) = blackboard_Et , italic_Ďľ â N ( 0 , I start_POSTSUBSCRIPT d ) , ( x0 , c ) âź Ditalic_f Ă Citalic_f end_POSTSUBSCRIPT [ ⼠italic_Ďľitalic_f - Ďľbold_italic_θ ( xitalic_t | c ) âĽ22 ] , (2) where Ďľf=Ďľâ˘(t|cm)subscriptbold-italic-Ďľsubscriptitalic-Ďľconditionalsubscriptsubscript Îľ_f= _ θ(x_t|c_m)italic_Ďľitalic_f = Ďľbold_italic_θ ( xitalic_t | citalic_m ) and cmâ csubscriptc_mâ ccitalic_m â c so that the denoised image 0subscript0x_0x0 is not related to the forgetting class/concept c [16, 28]. With this, we hinder the approximator Ďľsubscriptitalic-Ďľ _ θϾbold_italic_θ to guide the denoising process to obtain meaningful examples for the forgetting data example 0âźfsimilar-tosubscript0subscriptx_0 D_fx0 âź Ditalic_f. To erase the undesirable influence of fsubscriptD_fDitalic_f and preserve the overall performance, it is common to form ârâ˘(;r)+Îťâ˘âfâ˘(;f),subscriptâsubscriptsubscriptâsubscript L_r( θ;D_r)+Îť% L_f( θ;D_f),Litalic_r ( italic_θ ; Ditalic_r ) + Îť Litalic_f ( italic_θ ; Ditalic_f ) , (3) with Îť>00Îť>0Îť > 0 as the optimization objective (see for example [16]). However, training could be hindered due to the conflicting gradients between the erasing and preservation objectives, preventing a balanced trade-off between erasure and preservation [37]. To address this, rather than scalarizing the two objectives, we consider a framework based on optimization-based meta-learning algorithm [46] that allows iteratively updates to optimize each objective: minâĄârâ˘(;r)subscriptminsubscriptâsubscript _ θ\;L_r( θ% ;D_r)minbold_italic_θ Litalic_r ( italic_θ ; Ditalic_r ) s.t. âargâ˘minĎâĄâfâ˘(Ď;f),subscriptargminbold-italic-Ďsubscriptâbold-italic-Ďsubscript θâ *arg\,min_ ĎL% _f( Ď;D_f)\;,italic_θ â start_OPERATOR arg min end_OPERATORitalic_Ď Litalic_f ( italic_Ď ; Ditalic_f ) , (4) where the outer objective minimizes the remaining loss ârsubscriptâL_rLitalic_r (i.e., preserving model utility), the inner optimization minimizes the forgetting loss âfsubscriptâL_fLitalic_f (i.e., erasing) with initialization ânâĎinit=containssuperscriptâsubscriptbold-italic-ĎinitR^n Ď_ init= θblackboard_Rn â italic_Ďinit = italic_θ. Given θitalic_θ, the inner optimization on Ďbold-italic-Ď Ďitalic_Ď aims to minimize the forgetting data influence, with the goal of achieving effective erasure while preserving model utility. The outer objective and inner optimization are interdependent, iterating between preservation and erasure to balance the trade-off effectively. While the above framework allows for iterative updates to address the conflicting objectives of erasure and preservation, it still relies on nested optimization, which can be challenging to optimize efficiently. The inner optimization may converge to a saddle point or struggle with non-convex functions, making it difficult to achieve a stable solution [38]. To further streamline the optimization process, we adopt a value function approach [39, 45, 68] that reformulates the problem as a single-constrained optimization: minâĄârâ˘(;r)subscriptminsubscriptâsubscript _ θ\;L_r( θ% ;D_r)minbold_italic_θ Litalic_r ( italic_θ ; Ditalic_r ) s.t. âfâ˘(;f)âminĎâĄâfâ˘(Ď;f)â¤0,subscriptâsubscriptsubscriptminbold-italic-Ďsubscriptâbold-italic-Ďsubscript0 L_f( θ;D_f)-% min_ ĎL_f( Ď;D_f)⤠0,Litalic_f ( italic_θ ; Ditalic_f ) - minbold_italic_Ď Litalic_f ( italic_Ď ; Ditalic_f ) ⤠0 , (5) where Ďbold-italic-Ď Ďitalic_Ď is initialized at θitalic_θ, leverages the value function to encapsulate the influence of data erasure directly as a constraint on âfsubscriptâL_fLitalic_f. This avoids the need for a nested loop by capturing the forgetting objective as a constraint and provides a natural first-order solution, as the constrained formulation allows us to optimize preservation and erasure in a unified manner. 3.2 Solution To solve Sec. 3.1, let us first denote g():=âf(;f)âminĎâf(Ď;f)g( θ) :=L_f( θ;D_f)% -min_ ĎL_f( Ď;D_f)g ( italic_θ ) : = Litalic_f ( italic_θ ; Ditalic_f ) - minbold_italic_Ď Litalic_f ( italic_Ď ; Ditalic_f ). Our goal is to erase undesirable influence while preserving the overall model performance, hence the update vector tsubscript δ_titalic_δitalic_t for updating the model should aid in minimizing ârâ˘(;r)subscriptâsubscriptL_r( θ;D_r)Litalic_r ( italic_θ ; Ditalic_r ) and gâ˘()g( θ)g ( italic_θ ) simultaneously. In other words, suppose that the current solution for Sec. 3.1 is tsubscript θ_titalic_θitalic_t, we aim to update t+1=tâΡâ˘tsubscript1subscriptsubscript θ_t+1= θ_t-Ρ δ_titalic_θitalic_t + 1 = italic_θitalic_t - Ρ italic_δitalic_t where Ρ is sufficiently small, so that ârâ˘(t+1;r)subscriptâsubscript1subscriptL_r( θ_t+1;D_r)Litalic_r ( italic_θitalic_t + 1 ; Ditalic_r ) decreases (i.e., preserve model utility) and gâ˘(t+1)subscript1g( θ_t+1)g ( italic_θitalic_t + 1 ) decreases (i.e., erasure). To this end, we aim to find the update vector tsubscript δ_titalic_δitalic_t by: tâ12â˘argminâĄââârâ˘(t;r)ââ22,subscript12subscriptargminsuperscriptsubscriptnormsubscriptâsubscriptâsubscriptsubscript22 δ_tâ 12argmin_ δ% \| _ θL_r( θ_t;D% _r)- δ \|_2^2,italic_δitalic_t â divide start_ARG 1 end_ARG start_ARG 2 end_ARG argminbold_italic_δ ⼠âitalic_θ Litalic_r ( italic_θitalic_t ; Ditalic_r ) - italic_δ âĽ22 , s.t. âgâ˘(t)â¤â˘âĽat>0.subscriptâsuperscriptsubscripttopsubscript0 _ θg( θ_t) δ⼠a% _t>0.âitalic_θ g ( italic_θitalic_t )⤠italic_δ ⼠aitalic_t > 0 . (6) This will ensure that the update tsubscript δ_titalic_δitalic_t is close to âârâ˘(t;r)subscriptâsubscriptâsubscriptsubscript _ θL_r( θ_t;D_r)âitalic_θ Litalic_r ( italic_θitalic_t ; Ditalic_r ) and decreases gâ˘(t)subscriptg( θ_t)g ( italic_θitalic_t ) until it reaches stationary. Because gâ˘(t+1)âgâ˘(t)ââΡâ˘âgâ˘(t)â¤â˘â¤âΡâ˘at<0subscript1subscriptsubscriptâsuperscriptsubscripttopsubscript0g ( θ_t+1 )-g ( θ_t )â-Ρ% _ θg ( θ_t ) δâ¤-% Ρ a_t<0g ( italic_θitalic_t + 1 ) - g ( italic_θitalic_t ) â - Ρ âitalic_θ g ( italic_θitalic_t )⤠italic_δ ⤠- Ρ aitalic_t < 0 for some scalar at>0subscript0a_t>0aitalic_t > 0, we can ensure that gâ˘(t+1)<gâ˘(t)subscript1subscriptg ( θ_t+1 )<g ( θ_t )g ( italic_θitalic_t + 1 ) < g ( italic_θitalic_t ) for small step size Ρ>00Ρ>0Ρ > 0. This means that the update tsubscript δ_titalic_δitalic_t can ensure to minimize âfâ˘(;f)subscriptâsubscriptL_f( θ;D_f)Litalic_f ( italic_θ ; Ditalic_f ) as long as it does not conflict with descent of ârâ˘(;r)subscriptâsubscriptL_r( θ;D_r)Litalic_r ( italic_θ ; Ditalic_r ). To find the solution to the optimization problem in Sec. 3.2, the following theorem is developed: Theorem 3.1. The optimal solution of the optimization problem in Sec. 3.2 is â=âârâ˘(t;r)+Îťtâ˘âgâ˘(t)superscriptsubscriptâsubscriptâsubscriptsubscriptsubscriptsubscriptâsubscript δ^*= _ θL_r( θ_t;% D_r)+ _t _ θg( θ_t)italic_δâ = âitalic_θ Litalic_r ( italic_θitalic_t ; Ditalic_r ) + Îťitalic_t âitalic_θ g ( italic_θitalic_t ) where Îťt=maxâĄ0,atââgâ˘(t)â¤â˘âârâ˘(t;r)ââgâ˘(t)â22subscriptmax0subscriptsubscriptâsuperscriptsubscripttopsubscriptâsubscriptâsubscriptsubscriptsuperscriptsubscriptnormsubscriptâsubscript22 _t=max\0, a_t- _ θg( % θ_t) _ θL_r( θ_t;% D_r)\| _ θg( θ_t)\|_2^2\Îťitalic_t = max 0 , divide start_ARG aitalic_t - âitalic_θ g ( italic_θitalic_t )⤠âitalic_θ Litalic_r ( italic_θitalic_t ; Ditalic_r ) end_ARG start_ARG ⼠âitalic_θ g ( italic_θitalic_t ) âĽ22 end_ARG . We provide the proof in §7 in the Appendix. This provides the solution to the optimization problem by constructing the update vector δitalic_δ to balance two competing objectives. The variable atsubscripta_taitalic_t adjusts the weight of the forgetting objective, ensuring that the update vector δitalic_δ decreases the remaining loss without violating the erasure goal, and achieves the dual goals of maintaining utility and achieving erasing. In practice, we can choose at=Ρâ˘ââgâ˘(t)â22subscriptsuperscriptsubscriptnormsubscriptâsubscript22a_t=Ρ\| _ θg( θ_t)\|_2^2aitalic_t = Ρ ⼠âitalic_θ g ( italic_θitalic_t ) âĽ22, and we start from Ď0=tsuperscriptbold-italic-Ď0subscript Ď^0= θ_titalic_Ď0 = italic_θitalic_t and use gradient descend in K steps with the learning rate Ξ>00Ξ>0Ξ > 0 to reach ĎKsuperscriptbold-italic-Ď Ď^Kitalic_Ďitalic_K, namely Ďk+1=ĎkâΞâ˘âĎâfâ˘(Ďk;f)superscriptbold-italic-Ď1superscriptbold-italic-Ďsubscriptâbold-italic-Ďsubscriptâsuperscriptbold-italic-Ďsubscript Ď^k+1= Ď^k-Ξ _ ĎL_f( Ď% ^k;D_f)italic_Ďitalic_k + 1 = italic_Ďitalic_k - Ξ âitalic_Ď Litalic_f ( italic_Ďitalic_k ; Ditalic_f ) and k=0,âŻ,Kâ10âŻ1k=0,¡s,K-1k = 0 , ⯠, K - 1. Algorithm 1 EraseDiff: Erasing undesirable influence in diffusion models. 0: Well-trained model with parameters 0subscript0 θ_0italic_θ0, forgetting data fsubscriptD_fDitalic_f and remaining data rsubscriptD_rDitalic_r, outer iteration number T and inner iteration number K, learning rate Ρ. 0: Parameters âsuperscript θ^*italic_θâ for the scrubbed model. 1: for iteration t in T do 2: Ď0=tsuperscriptbold-italic-Ď0subscript Ď^0= θ_titalic_Ď0 = italic_θitalic_t. 3: Get ĎKsuperscriptbold-italic-Ď Ď^Kitalic_Ďitalic_K by K steps of gradient descent on âfâ˘(Ď;f)subscriptâbold-italic-ĎsubscriptL_f( Ď;D_f)Litalic_f ( italic_Ď ; Ditalic_f ) starting from Ď0superscriptbold-italic-Ď0 Ď^0italic_Ď0. 4: Set gâ˘(t)=âfâ˘(t;f)ââfâ˘(ĎK;f)subscriptsubscriptâsubscriptsubscriptsubscriptâsuperscriptbold-italic-Ďsubscriptg( θ_t)=L_f( θ_t;D_f)-% L_f( Ď^K;D_f)g ( italic_θitalic_t ) = Litalic_f ( italic_θitalic_t ; Ditalic_f ) - Litalic_f ( italic_Ďitalic_K ; Ditalic_f ). 5: Update the model: t+1=tâΡâ˘(âtârâ˘(t;r)+Îťtâ˘âtgâ˘(t;ĎK))subscript1subscriptsubscriptâsubscriptsubscriptâsubscriptsubscriptsubscriptsubscriptâsubscriptsubscriptsuperscriptbold-italic-Ď Î¸_t+1= θ_t-Ρ( _ θ_t % L_r( θ_t;D_r)+ _t _ θ% _tg( θ_t; Ď^K))italic_θitalic_t + 1 = italic_θitalic_t - Ρ ( âitalic_θ start_POSTSUBSCRIPT t end_POSTSUBSCRIPT Litalic_r ( italic_θitalic_t ; Ditalic_r ) + Îťitalic_t âitalic_θ start_POSTSUBSCRIPT t end_POSTSUBSCRIPT g ( italic_θitalic_t ; italic_Ďitalic_K ) ), 6: where Îťt=maxâĄ0,atââgâ˘(t)Tâ˘âârâ˘(t;r)ââgâ˘(t)â22subscriptmax0subscriptsubscriptâsuperscriptsubscriptsubscriptâsubscriptâsubscriptsubscriptsuperscriptsubscriptnormsubscriptâsubscript22 _t=max\0, a_t- _ θg( % θ_t)^T _ θL_r( θ_t;% D_r)\| _ θg( θ_t)\|_2^2\Îťitalic_t = max 0 , divide start_ARG aitalic_t - âitalic_θ g ( italic_θitalic_t )T âitalic_θ Litalic_r ( italic_θitalic_t ; Ditalic_r ) end_ARG start_ARG ⼠âitalic_θ g ( italic_θitalic_t ) âĽ22 end_ARG . 7: end for 3.3 Analysis We can characterize the solution of our algorithm as follows and the proof can be found in §7 in the Appendix: Theorem 3.2 (Pareto optimality). The stationary point obtained by our algorithm is Pareto optimal of the problem minâĄ[ârâ˘(;r),âfâ˘(;f)]subscriptminsubscriptâsubscriptsubscriptâsubscriptmin_ θ[L_r( θ;D% _r),L_f( θ;D_f)]minbold_italic_θ [ Litalic_r ( italic_θ ; Ditalic_r ) , Litalic_f ( italic_θ ; Ditalic_f ) ]. This asserts that the solution obtained by our algorithm is Pareto optimal for the problem of minimizing both objectives, which implies that the solution obtained by the algorithm ensures a balanced trade-off between preserving model utility and erasing undesirable influences. Figure 2: Top to bottom: cosine similarity between the update vector δitalic_δ and the preservation gradient rsubscript g_ritalic_gitalic_r, followed by the cosine similarity between δitalic_δ and the erasing gradient fsubscript g_fitalic_gitalic_f. Positive values indicate alignment, while negative values suggest conflict. This visualization illustrates how well the update vector aligns with the objectives of preservation and erasure over successive iterations. We further take DDPM with CIFAR-10 when forgetting the âairplaneâ as an example to show that our proposed method helps alleviate the gradient conflict which prevents a balanced trade-off between erasure and preservation. Fig. 2 presents the cosine similarity between the update vector δitalic_δ and the gradient r=âârâ˘(;r)subscriptsubscriptâsubscriptâsubscript g_r= _ θL_r( θ;D% _r)italic_gitalic_r = âitalic_θ Litalic_r ( italic_θ ; Ditalic_r ) for preservation, and the cosine similarity between the update vector δitalic_δ and the gradient f=ââfâ˘(;f)subscriptâsubscriptâsubscript g_f=âL_f( θ;D_f)italic_gitalic_f = â Litalic_f ( italic_θ ; Ditalic_f ) for erasing. The cosine similarity represents the alignment between the update vector and the gradients associated with the preservation and erasure. Higher positive values indicate alignment, meaning that the update vector δitalic_δ is directed similarly to the respective gradient, whereas negative values indicate misalignment or conflict. In particular, negative values suggest a high degree of opposition between the update vector and the respective gradient, which can signify competing objectives between preservation and erasure during the optimization process. MOO (Multi-Objective Optimization) denotes the naive integration of erasing and preservation as stated in Eq. 3. For the vanilla MOO, Fig. 2 shows a clear alternating pattern in cosine similarity values between the update vector δitalic_δ and the gradients rsubscript g_ritalic_gitalic_r and fsubscript g_fitalic_gitalic_f. Specifically, when the cosine similarity between δitalic_δ and rsubscript g_ritalic_gitalic_r is greater than 0, the similarity between δitalic_δ and fsubscript g_fitalic_gitalic_f tends to be less than 0, and vice versa. This pattern suggests that MOO experiences gradient conflict, as it cannot effectively balance the two objectives of preservation and erasure, preventing MOO from achieving a harmonious update that supports both goals simultaneously. In contrast, EraseDiff mostly shows positive cosine similarity values between the update vector δitalic_δ and both the preservation gradient rsubscript g_ritalic_gitalic_r and the erasing gradient fsubscript g_fitalic_gitalic_f. This indicates that EraseDiff aligns the update direction with both objectives, suggesting it manages to avoid significant gradient conflict. By maintaining positive alignment, EraseDiff appears to balance preservation and erasure more effectively, leading to better cooperation between objectives. 4 Related Work Memorization in generative models. Privacy of generative models has been studied extensively for GANs [17, 42, 65] and generative language models [9, 8, 32, 62]. These generative models often risk replicating from their training data. Recently, several studies [10, 58, 57, 64] investigated these data replication behaviors in diffusion models, raising concerns about the privacy and copyright issues. Possible mitigation strategies are deduplicating and randomizing conditional information [58, 57], or training models with differential privacy (DP) [1, 15, 14, 13]. However, leveraging DP-SGD [1] may cause training to diverge [10]. Malicious misuse. Diffusion models usually use training data from varied open sources and when such unfiltered data is employed, there is a risk of it being tainted [12] or manipulated [47], resulting in inappropriate generation [53]. They also risk the imitation of copyrighted content, e.g., mimicking the artistic style [20, 56]. To counter inappropriate generation, data censoring [19, 3, 44, 52] where excluding black-listed images before training, and safety guidance where diffusion models will be updated away from the inappropriate/undesired concept [20, 53] are proposed. Shan et al. [56] propose protecting artistic style by adding barely perceptible perturbations to the artworks before public release. Yet, Rando et al. [47] argue that DMs can still generate content that bypasses the filter. Chen et al. [12] highlight the susceptibility of DMs to poison attacks, where target images are generated with specific triggers. Machine unlearning. Removing data directly involves retraining the model from scratch, which is inefficient and impractical. Thus, to reduce the computational overhead, efficient machines unlearning methods [49, 33, 7, 22, 4, 66, 25, 23, 43, 55, 11, 60] have been proposed. Several studies [20, 21, 27, 28, 16, 69, 5] recently introduce unlearning in diffusion models. Most of them [20, 21, 27, 69] mainly focus on text-to-image models and high-level visual concept erasure. Heng and Soh [28] adopt Elastic Weight Consolidation (EWC) and Generative Replay (GR) from continual learning to perform unlearning effectively without access to the training data. Heng and Sohâs method can be applied to a wide range of generative models, however, it needs the computation of FIM for different datasets and models, which may lead to significant computational demands. Fan et al. [16] propose a very potent unlearning algorithm called SalUn that shifts attention to important parameters w.r.t. the forgetting data. SalUn can perform effectively across image classification and generation tasks. In this work, we introduce a simple yet effective unlearning algorithm for diffusion models by formulating the problem as a constrained optimization problem, to achieve a fine-tuned balance between preservation and targeted erasure, yielding an optimal trade-off. Below, we will show that our algorithm is not only faster than Heng and Sohâs method [28] and Fanâs method [16], but even outperforms these methods in terms of the trade-off between the forgetting and preserving model utility. 5 Experiment We evaluate EraseDiff in various scenarios, including removing images with specific classes/concepts, to answer the following research questions (RQs): (i) Can typical machine unlearning methods be applied to diffusion models? (i) Is EraseDiff able to remove the influence of fsubscriptD_fDitalic_f in the diffusion models? (i) Is EraseDiff able to preserve the model utility while removing fsubscriptD_fDitalic_f? (iv) Is EraseDiff efficient in removing the data? (v) How does EraseDiff perform on the public well-trained models? 5.1 Setup Experiments are reported on CIFAR-10 [34] with DDPM, Imagenette [31] with Stable Diffusion (SD) for class-wise forgetting, I2P [53] dataset with SD for concept-wise forgetting. For all SD experiments, we use the open-source SD v1.4 [48] checkpoint as the pre-trained model. Implementation details and additional results like visualizations of generated images can be found in §8 and §9. Baselines. We primarily benchmark against the following baselines commonly used in machine unlearning: (i) Unscrubbed, (i) Finetune (FT) [23], (i) NegGrad (NG) [23], (iv) BlindSpot [60], (v) ESD [20], (vi) FMN [69], (vii) Selective Amnesia (SA) [28] and (viii) the SOTA machine unlearning algorithm SalUn [16]. Metrics. Several metrics are utilized to evaluate the algorithms: (i) Frechet Inception Distance (FID) [29]: the widely-used metric for assessing the quality of generated images. (i) CLIP score: the similarity between the visual features of the generated image and its corresponding textual embedding. (i) PĎâ˘(=cf|f)subscriptconditionalsubscriptsubscriptP_Ď(y=c_f|x_f)Pitalic_Ď ( y = citalic_f | xitalic_f ) [28]: the classification rate of a pre-trained classifier PĎâ˘(|)subscriptconditionalP_Ď(y|x)Pitalic_Ď ( y | x ), with a ResNet architecture [26] used to classify generated images conditioned on the forgetting classes. A lower classification value indicates superior unlearning performance. (iv) Precision and Recall: A low FID may indicate high precision (realistic images) but low recall (small variations) [50, 36]. Kynkänniemi et al. [36] shows that generative models claim to optimize FID (high fidelity) but always sacrifice variation (low diversity). Hence, we include metric precision (fidelity) and recall (diversity) to express the quality of the generated samples, to provide explicit visibility of the tradeoff between sample quality and variety. Table 1: Results on CIFAR10 with DDPM when forgetting the âairplaneâ class. PĎâ˘(=cf|f)subscriptconditionalsubscriptsubscriptP_Ď(y=c_f|x_f)Pitalic_Ď ( y = citalic_f | xitalic_f ) indicate the probability of the forgotten class (i.e., the effectiveness of erasing). Precision and Recall demonstrate the fidelity and diversity [50, 36], and FID scores are computed between the generated 45K images and the corresponding ground truth images with the same labels from rsubscriptD_rDitalic_r (i.e., preserving model utility). SA excels in class-wise forgetting but struggles to perform concept-wise forgetting as shown in Fig. 3 and Tab. 2. The best and the second best are highlighted in blue and orange, respectively. Unscrubbed FT [23] NG [23] BlindSpot [60] SA [28] SalUn [16] EraseDiffrlrl_rlstart_FLOATSUBSCRIPT rl end_FLOATSUBSCRIPT EraseDiffnoisenoise_noisestart_FLOATSUBSCRIPT noise end_FLOATSUBSCRIPT FID â â 9.63 8.21 76.73 9.12 8.19 9.16 8.66 7.61 Precision (fidelity) â â 0.40 0.43 0.08 0.41 0.43 0.41 0.43 0.43 Recall (diversity) â â 0.79 0.77 0.61 0.78 0.75 0.76 0.77 0.72 PĎâ˘(=cf|f)subscriptconditionalsubscriptsubscriptP_Ď(y=c_f|x_f)Pitalic_Ď ( y = citalic_f | xitalic_f )â â 0.97 0.96 0.61 0.90 0.06 0.07 0.24 0.22 Figure 3: Quantity of nudity content detected using the NudeNet classifier from I2P data. Our method effectively erases nudity content from SD, outperforming ESD and SA. Note that Fig. 3 and Tab. 2 together presents the trade-off between erasing and preservation. Table 2: Evaluation of 30K generated images by SD when erasing ânudityâ. The FID score is measured compared to validation data, while the CLIP similarity score evaluates the alignment between generated images and the corresponding prompts. The best and the second best are highlighted in blue and orange, respectively. ESD [20] SA [28] SalUn [16] EraseDiff FID â â 15.76 25.58 25.06 17.01 CLIP â â 30.33 31.03 28.91 30.58 5.2 Results on DDPM Following SA, we aim to forget the âairplaneâ class on CIFAR-10. Here, we replace Ďľââ˘(,d)bold-italic-Ďľ0subscript ÎľâN( 0,I_d)italic_Ďľ â N ( 0 , Iitalic_d ) with Ďľf=Ďľâ˘(t|cm)subscriptbold-italic-Ďľsubscriptitalic-Ďľconditionalsubscriptsubscript Îľ_f= _ θ(x_t|c_m)italic_Ďľitalic_f = Ďľbold_italic_θ ( xitalic_t | citalic_m ) like random labelling used in [16] where cmâ csubscriptc_mâ ccitalic_m â c, denoted as EraseDiffrlrl_rlstart_FLOATSUBSCRIPT rl end_FLOATSUBSCRIPT. We also try to use Ďľf=â˘(,d)subscriptbold-italic-Ďľ0subscript Îľ_f=U( 0,I_d)italic_Ďľitalic_f = U ( 0 , Iitalic_d ) like SA, denoted as EraseDiffnoisenoise_noisestart_FLOATSUBSCRIPT noise end_FLOATSUBSCRIPT. Note that the choice of replacement for forgotten classes is flexible and is not the primary focus of this work. For further discussion on the choice of substitution strategies, please refer to related studies [40, 6]. Results are presented in Tab. 1. Firstly, from Tab. 1, we can conclude that traditional machine unlearning methods designed for image classification or regression tasks fall short in effectively performing forgetting for DDPM. Finetune and BlindSpot suffer from under-forgetting (i.e., the generated image quality is good but the probability of generated images belonging to the forgetting class approaching the value of the unscrubbed model), and NegGrad suffers from over-forgetting (the probability of generated images belonging to the forgetting class is decreased compared to that of the unscrubbed model but the generated image quality drops significantly). Then, comparing SA and SalUnâs unlearning methods, SA achieves an FID score of 8.19 but sacrifices variation (decreased recall). Also, note that SA introduces excessive computational resource requirements and time consumption [28, 70]. Note that the FID scores of SA, SalUn, and EraseDiff decrease compared with the generated images from the original models; the quality of the generated images experiences a slight improvement. However, there is a decrease in recall (diversity), which can be attributed to the scrubbed models being fine-tuned over rsubscriptD_rDitalic_r, suggesting a tendency towards overfitting. Regarding forgetting, SalUn achieves a smaller probability of the generated images classified as the forgetting class than ours; yet, the FID score is larger than ours, and images generated by EraseDiffrlrl_rlstart_FLOATSUBSCRIPT rl end_FLOATSUBSCRIPT present better diversity and fidelity. 5.3 Results on Stable Diffusion Table 3: Performance of class-wise forgetting on Imagenette using SD. UA: the accuracy of the generated images that do not belong to the forgetting class (i.e., the effectiveness of forgetting). The FID score is measured compared to validation data for the remaining classes. Forget. Class FMNâ [69] ESDâ [20] SalUnâ [16] EraseDiff FID â â UA (%)â â FID â â UA (%)â â FID â â UA (%)â â FID â â UA (%)â â Tench 1.63 42.40 1.22 99.40 2.53 100.00 1.29 100 English Springer 1.75 27.20 1.02 100.00 0.79 100.00 1.38 100 Cassette Player 0.80 93.80 1.84 100.00 0.91 99.80 0.85 100 Chain Saw 0.94 48.40 1.48 96.80 1.58 100.00 1.17 99.9 Church 1.32 23.80 1.91 98.60 0.90 99.60 0.83 100 French Horn 0.99 45.00 1.08 99.80 0.94 100.00 1.09 100 Garbage Truck 0.92 41.40 2.71 100.00 0.91 100.00 0.96 100 Gas Pump 1.30 53.60 1.99 100.00 1.05 100.00 1.25 100 Golf Ball 1.05 15.40 0.80 99.60 1.45 98.80 1.50 99.5 Parachute 2.33 34.40 0.91 99.80 1.16 100.00 0.78 99.7 Average 1.30 42.54 1.49 99.40 1.22 99.82 1.11 99.91 Figure 4: Top to Bottom: generated examples with I2P and COCO prompts after forgetting the concept of ânudityâ. In this experiment, we apply EraseDiff to perform class-wise forgetting from Imagenette and erase the ânudityâ concept with SD v1.4. For all experiments, we employ SD for sampling with 50 time steps. When forgetting ânudityâ, we have no access to the training data; instead, we generate âźsimilar-to âź400 images with the prompts cf=subscriptabsentc_f=citalic_f =ânudityâ, ânakedâ, âeroticâ, âsexualâ. Forget nudity. 4703 images are generated using I2P prompts, and 1K images are generated using the prompts ânudityâ, ânakedâ, âeroticâ, âsexualâ. The quantity of nudity content is detected using the NudeNet classifier [2]. In Fig. 3, the number in the y-axis denotes the number of exposed body parts generated by the SD v1.4 model. Fig. 3 presents the percentage change in exposed body parts w.r.t. SD v1.4. In §9, we provide the number of exposed body parts counted in all generated images with different thresholds. Here, our algorithm replaces Ďľfsubscriptbold-italic-Ďľ Îľ_fitalic_Ďľitalic_f with Ďľâ˘(t|cm)subscriptitalic-Ďľconditionalsubscriptsubscript _ θ(x_t|c_m)Ďľbold_italic_θ ( xitalic_t | citalic_m ) where cmsubscriptc_mcitalic_m is âa photo of pokemonâ. We can find that, EraseDiff reduces the amount of nudity content compared to SD v1.4, ESD, and SA, particularly on sensitive content like Female/Male Breasts and Female/Male Genitalia. While SalUn excels at forgetting, our algorithm demonstrates a significant improvement in the quality of generated images, as shown in Tab. 2. Tab. 2 presented results evaluating the utility of scrubbed models. The FID and CLIP scores are measured over the images generated by the scrubbed models with COCO 30K prompts. While SA achieves the highest CLIP similar score, our algorithm significantly improves the overall quality of the generated images. Forget class. When performing class-wise forgetting, following Fan et al. [16], we set the prompt as âan image of [c]â. For the forgetting class cfsubscriptc_fcitalic_f, we choose the ground truth backward distribution to be a class other than cfsubscriptc_fcitalic_f. We generate 100 images for each prompt. Results for methods with â presented in Tab. 3 are from SalUn [16]. Our method outperforms SalUn on average across 10 classes. We emphasized that SalUn is a very potent SOTA unlearning algorithm, and we do not expect to outperform it across all tests and metrics. Averaging results across all ten classes provides a more comprehensive evaluation and mitigates the risk of cherry-picking. Our results, based on this average approach, clearly indicate the advantages of our method. We also present results when improving the forgetting ability of SalUn in §9. However, note that this enhancement comes with a drop in the FID score of the generated images. Our method, while slightly better than SalUn on average across 10 classes, demonstrates a more balanced trade-off between erasing and preservation, indicating that it achieves a favorable balance in preserving fidelity while enhancing erasing performance. 5.4 Computational efficiency Table 4: Computational overhead. Time is the average duration measured over five runs on DDPM when forgetting âairplaneâ. Memory (MiB) Time (min.) Complexity SA 3352.3 140.00 â˘(n2)superscript2O(n^2)O ( n2 ) SalUn 4336.2 28.17 â˘(n)O(n)O ( n ) EraseDiff 3360.3 12.70 â˘(n)O(n)O ( n ) Finally, we measure the computational complexity of unlearning algorithms. The computational complexity of SA and SalUn involves two distinct stages: the computation of FIM for SA and the computation of salient weights w.r.t. fsubscriptD_fDitalic_f for SalUn, and the subsequent forgetting stage for both algorithms. We consider the maximum memory usage across both stages, the metric âTimeâ is exclusively associated with the duration of the forgetting stage for unlearning algorithms. Tab. 4 show that EraseDiff outperforms SA and SalUn in terms of efficiency, achieving a speed increase of âź11Ă 11Ăâź 11 Ă than SA and âź2Ă 2Ăâź 2 Ă than SalUn. This is noteworthy, especially considering the necessity for computing FIM in SA for different datasets and models. 5.5 Ablation study We further investigate the influence of the number of iterations K that approximate minâĄâfâ˘(Ď;f)minsubscriptâbold-italic-ĎsubscriptminL_f( Ď;D_f)min Litalic_f ( italic_Ď ; Ditalic_f ), and the step size Ρ that controls the weight of forgetting and preserving model utility. Here, we replace Ďľââ˘(,d)bold-italic-Ďľ0subscript ÎľâN( 0,I_d)italic_Ďľ â N ( 0 , Iitalic_d ) with Ďľfââ˘(,d)subscriptbold-italic-Ďľ0subscript Îľ_fâU( 0,I_d)italic_Ďľitalic_f â U ( 0 , Iitalic_d ). Note that for different hyperparameters in Fig. 5 (a), the average entropy of the classifierâs output distribution given fsubscriptx_fxitalic_f, which is Hâ˘(PĎâ˘(|f))=ââ˘[âiPĎâ˘(=ci|)â˘logeâĄPĎâ˘(=ci|)]subscriptconditionalsubscriptdelimited-[]subscriptsubscriptconditionalsubscriptsubscriptsubscriptconditionalsubscriptH(P_Ď(y|x_f))=-E[ _iP_Ď(% y=c_i|x) _eP_Ď(y=c_i|x% )]H ( Pitalic_Ď ( y | xitalic_f ) ) = - blackboard_E [ âi Pitalic_Ď ( y = citalic_i | x ) logitalic_e Pitalic_Ď ( y = citalic_i | x ) ], remains close to 2.02. This indicates that the scrubbed models become uncertain about the images conditioned on the forgetting class, effectively erasing the information about fsubscriptD_fDitalic_f. Below, we will further demonstrate the influence on the model utility. In practice, we have Îťt=maxâĄ0,atââgâ˘(t)â¤â˘âârâ˘(t;r)ââgâ˘(t)â22=maxâĄ0,Ρââgâ˘(t)â¤â˘âârâ˘(t;r)ââgâ˘(t)â22subscriptmax0subscriptsubscriptâsuperscriptsubscripttopsubscriptâsubscriptâsubscriptsubscriptsuperscriptsubscriptnormsubscriptâsubscript22max0subscriptâsuperscriptsubscripttopsubscriptâsubscriptâsubscriptsubscriptsuperscriptsubscriptnormsubscriptâsubscript22 _t=max\0, a_t- _ θg( % θ_t) _ θL_r( θ_t;% D_r)\| _ θg( θ_t)\|_2^2\=% max\0,Ρ- _ θg( θ_t)^% _ θL_r( θ_t;D_% r)\| _ θg( θ_t)\|_2^2\Îťitalic_t = max 0 , divide start_ARG aitalic_t - âitalic_θ g ( italic_θitalic_t )⤠âitalic_θ Litalic_r ( italic_θitalic_t ; Ditalic_r ) end_ARG start_ARG ⼠âitalic_θ g ( italic_θitalic_t ) âĽ22 end_ARG = max 0 , Ρ - divide start_ARG âitalic_θ g ( italic_θitalic_t )⤠âitalic_θ Litalic_r ( italic_θitalic_t ; Ditalic_r ) end_ARG start_ARG ⼠âitalic_θ g ( italic_θitalic_t ) âĽ22 end_ARG , we can see that Ρ determines the extent to which the update direction for forgetting can deviate from that for preserving model utility. A larger Ρ would allow for more deviation in the updating, thus prioritizing forgetting over preserving model utility. In Fig. 5 (a), the FID score tends to increase (i.e., image quality drop) as the step size Ρ increases, indicating that larger Ρ leads to greater deviations from the direction that preserves the model utility. Furthermore, the number of iterations K determines how closely the approximation ĎKsuperscriptbold-italic-Ď Ď^Kitalic_Ďitalic_K will approach argâ˘minĎâĄâfâ˘(Ď;f)subscriptargminbold-italic-Ďsubscriptâbold-italic-Ďsubscript *arg\,min_ ĎL_f( Ď;D_% f)start_OPERATOR arg min end_OPERATORitalic_Ď Litalic_f ( italic_Ď ; Ditalic_f ). Hence, a larger number of iterations K leads to more thorough erasure, which is also supported by the results shown in Fig. 5 (a), as increasing K correlates with an increase in the FID score. Figure 5: (a) Ablation results. (b) Potential incomplete erasures. 6 Conclusion and Limitations In this work, we explored erasing undesirable influence in diffusion models and proposed an efficient method EraseDiff to achieve a balanced trade-off between erasing and preservation. Comprehensive experiments on diffusion models demonstrate the proposed algorithmâs effectiveness in data removal, its efficacy in preserving the model utility, and its efficiency in erasure. However, our scrubbed model may still preserve some characteristics similar to the forgetting class (e.g., in Fig. 5 (b), generated images conditioned on the forgetting class âtenchâ by our scrubbed model when forgetting the class âtenchâ from Imagenette, which may preserve some characteristics similar to that close to âtenchâ visually). Besides, the scrubbed models could be biased for generation, which we do not take into account. Future directions could include assessing fairness post-unlearning, using advanced privacy-preserving training techniques, and advanced MOO solutions. We hope the proposed approach could serve as an inspiration for future research in the field of erasing undesirable concepts in diffusion models. References Abadi et al. [2016] Martin Abadi, Andy Chu, Ian Goodfellow, H Brendan McMahan, Ilya Mironov, Kunal Talwar, and Li Zhang. Deep learning with differential privacy. In Proceedings of the 2016 ACM SIGSAC conference on computer and communications security, pages 308â318, 2016. Bedapudi [2019] P Bedapudi. Nudenet: Neural nets for nudity classification, detection and selective censoring, 2019. Birhane and Prabhu [2021] Abeba Birhane and Vinay Uday Prabhu. Large image datasets: A pyrrhic win for computer vision? In 2021 IEEE Winter Conference on Applications of Computer Vision (WACV), pages 1536â1546. IEEE, 2021. Bourtoule et al. [2021] Lucas Bourtoule, Varun Chandrasekaran, Christopher A. Choquette-Choo, Hengrui Jia, Adelin Travers, Baiwu Zhang, David Lie, and Nicolas Papernot. Machine unlearning. In 2021 IEEE Symposium on Security and Privacy (SP), pages 141â159, 2021. Bui et al. [2024a] Anh Bui, Khanh Doan, Trung Le, Paul Montague, Tamas Abraham, and Dinh Phung. Removing undesirable concepts in text-to-image generative models with learnable prompts. arXiv preprint arXiv:2403.12326, 2024a. Bui et al. [2024b] Anh Bui, Long Vuong, Khanh Doan, Trung Le, Paul Montague, Tamas Abraham, and Dinh Phung. Erasing undesirable concepts in diffusion models with adversarial preservation. arXiv preprint arXiv:2410.15618, 2024b. Cao and Yang [2015] Yinzhi Cao and Junfeng Yang. Towards making systems forget with machine unlearning. In 2015 IEEE Symposium on Security and Privacy (SP), pages 463â480, 2015. Carlini et al. [2021] Nicholas Carlini, Florian Tramer, Eric Wallace, Matthew Jagielski, Ariel Herbert-Voss, Katherine Lee, Adam Roberts, Tom Brown, Dawn Song, Ulfar Erlingsson, et al. Extracting training data from large language models. In 30th USENIX Security Symposium (USENIX Security 21), pages 2633â2650, 2021. Carlini et al. [2022] Nicholas Carlini, Daphne Ippolito, Matthew Jagielski, Katherine Lee, Florian Tramer, and Chiyuan Zhang. Quantifying memorization across neural language models. arXiv preprint arXiv:2202.07646, 2022. Carlini et al. [2023] Nicolas Carlini, Jamie Hayes, Milad Nasr, Matthew Jagielski, Vikash Sehwag, Florian Tramer, Borja Balle, Daphne Ippolito, and Eric Wallace. Extracting training data from diffusion models. In 32nd USENIX Security Symposium (USENIX Security 23), pages 5253â5270, 2023. Chen et al. [2023a] Min Chen, Weizhuo Gao, Gaoyang Liu, Kai Peng, and Chen Wang. Boundary unlearning: Rapid forgetting of deep networks via shifting the decision boundary. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 7766â7775, 2023a. Chen et al. [2023b] Weixin Chen, Dawn Song, and Bo Li. Trojdiff: Trojan attacks on diffusion models with diverse targets. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 4035â4044, 2023b. Dockhorn et al. [2022] Tim Dockhorn, Tianshi Cao, Arash Vahdat, and Karsten Kreis. Differentially private diffusion models. arXiv preprint arXiv:2210.09929, 2022. Dwork [2008] Cynthia Dwork. Differential privacy: A survey of results. In International conference on theory and applications of models of computation, pages 1â19. Springer, 2008. Dwork et al. [2006] Cynthia Dwork, Frank McSherry, Kobbi Nissim, and Adam Smith. Calibrating noise to sensitivity in private data analysis. In Theory of Cryptography: Third Theory of Cryptography Conference, TCC 2006, New York, NY, USA, March 4-7, 2006. Proceedings 3, pages 265â284. Springer, 2006. Fan et al. [2023] Chongyu Fan, Jiancheng Liu, Yihua Zhang, Dennis Wei, Eric Wong, and Sijia Liu. Salun: Empowering machine unlearning via gradient-based weight saliency in both image classification and generation. arXiv preprint arXiv:2310.12508, 2023. Feng et al. [2021] Qianli Feng, Chenqi Guo, Fabian Benitez-Quiroz, and Aleix M Martinez. When do gans replicate? on the choice of dataset size. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 6701â6710, 2021. Finn et al. [2017] Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep networks. In International conference on machine learning, pages 1126â1135. PMLR, 2017. Gandhi et al. [2020] Shreyansh Gandhi, Samrat Kokkula, Abon Chaudhuri, Alessandro Magnani, Theban Stanley, Behzad Ahmadi, Venkatesh Kandaswamy, Omer Ovenc, and Shie Mannor. Scalable detection of offensive and non-compliant content/logo in product images. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision, pages 2247â2256, 2020. Gandikota et al. [2023a] Rohit Gandikota, Joanna Materzynska, Jaden Fiotto-Kaufman, and David Bau. Erasing concepts from diffusion models. In 2023 IEEE International Conference on Computer Vision (ICCV), 2023a. Gandikota et al. [2023b] Rohit Gandikota, Hadas Orgad, Yonatan Belinkov, Joanna MaterzyĹska, and David Bau. Unified concept editing in diffusion models. arXiv preprint arXiv:2308.14761, 2023b. Ginart et al. [2019] Antonio Ginart, Melody Guan, Gregory Valiant, and James Y Zou. Making ai forget you: Data deletion in machine learning. In Advances in Neural Information Processing Systems (NeurIPS), 2019. Golatkar et al. [2020] Aditya Golatkar, Alessandro Achille, and Stefano Soatto. Eternal sunshine of the spotless net: Selective forgetting in deep networks. In 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 9301â9309, 2020. Goldman [2020] Eric Goldman. An introduction to the california consumer privacy act (ccpa). Santa Clara Univ. Legal Studies Research Paper, 2020. Guo et al. [2020] Chuan Guo, Tom Goldstein, Awni Hannun, and Laurens Van Der Maaten. Certified data removal from machine learning models. In Proceedings of the 37th International Conference on Machine Learning, pages 3832â3842. PMLR, 2020. He et al. [2016] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 770â778, 2016. Heng and Soh [2023a] Alvin Heng and Harold Soh. Continual learning for forgetting in deep generative models. 2023a. Heng and Soh [2023b] Alvin Heng and Harold Soh. Selective amnesia: A continual learning approach to forgetting in deep generative models. In Advances in Neural Information Processing Systems (NeurIPS), 2023b. Heusel et al. [2017] Martin Heusel, Hubert Ramsauer, Thomas Unterthiner, Bernhard Nessler, and Sepp Hochreiter. Gans trained by a two time-scale update rule converge to a local nash equilibrium. Advances in neural information processing systems, 30, 2017. Ho et al. [2020] Jonathan Ho, Ajay Jain, and Pieter Abbeel. Denoising diffusion probabilistic models. Advances in neural information processing systems, 33:6840â6851, 2020. Howard and Gugger [2020] Jeremy Howard and Sylvain Gugger. Fastai: A layered api for deep learning. Information, 11(2):108, 2020. Jagielski et al. [2022] Matthew Jagielski, Om Thakkar, Florian Tramer, Daphne Ippolito, Katherine Lee, Nicholas Carlini, Eric Wallace, Shuang Song, Abhradeep Thakurta, Nicolas Papernot, et al. Measuring forgetting of memorized training examples. arXiv preprint arXiv:2207.00099, 2022. Karasuyama and Takeuchi [2010] Masayuki Karasuyama and Ichiro Takeuchi. Multiple incremental decremental learning of support vector machines. IEEE Transactions on Neural Networks, 21(7):1048â1059, 2010. Krizhevsky et al. [2009] Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. 2009. Kumari et al. [2023] Nupur Kumari, Bingliang Zhang, Sheng-Yu Wang, Eli Shechtman, Richard Zhang, and Jun-Yan Zhu. Ablating concepts in text-to-image diffusion models. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 22691â22702, 2023. Kynkänniemi et al. [2019] Tuomas Kynkänniemi, Tero Karras, Samuli Laine, Jaakko Lehtinen, and Timo Aila. Improved precision and recall metric for assessing generative models. Advances in neural information processing systems, 32, 2019. Liu et al. [2021a] Bo Liu, Xingchao Liu, Xiaojie Jin, Peter Stone, and Qiang Liu. Conflict-averse gradient descent for multi-task learning. Advances in Neural Information Processing Systems (NeurIPS), 34:18878â18890, 2021a. Liu et al. [2022] Bo Liu, Mao Ye, Stephen Wright, Peter Stone, and Qiang Liu. Bome! bilevel optimization made easy: A simple first-order approach. Advances in Neural Information Processing Systems, 35:17248â17262, 2022. Liu et al. [2021b] Risheng Liu, Xuan Liu, Xiaoming Yuan, Shangzhi Zeng, and Jin Zhang. A value-function-based interior-point method for non-convex bi-level optimization. In International conference on machine learning, pages 6882â6892. PMLR, 2021b. Lyu et al. [2024] Mengyao Lyu, Yuhong Yang, Haiwen Hong, Hui Chen, Xuan Jin, Yuan He, Hui Xue, Jungong Han, and Guiguang Ding. One-dimensional adapter to rule them all: Concepts diffusion models and erasing applications. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 7559â7568, 2024. Maclaurin et al. [2015] Dougal Maclaurin, David Duvenaud, and Ryan Adams. Gradient-based hyperparameter optimization through reversible learning. In International conference on machine learning, pages 2113â2122. PMLR, 2015. Meehan et al. [2020] Casey Meehan, Kamalika Chaudhuri, and Sanjoy Dasgupta. A non-parametric test to detect data-copying in generative models. In International Conference on Artificial Intelligence and Statistics, 2020. Mehta et al. [2022] Ronak Mehta, Sourav Pal, Vikas Singh, and Sathya N. Ravi. Deep unlearning via randomized conditionally independent hessians. In 2022 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 10412â10421, 2022. Nichol et al. [2021] Alex Nichol, Prafulla Dhariwal, Aditya Ramesh, Pranav Shyam, Pamela Mishkin, Bob McGrew, Ilya Sutskever, and Mark Chen. Glide: Towards photorealistic image generation and editing with text-guided diffusion models. arXiv preprint arXiv:2112.10741, 2021. Outrata [1990] JiĹĂ V Outrata. On the numerical solution of a class of stackelberg problems. Zeitschrift fĂźr Operations Research, 34:255â277, 1990. Rajeswaran et al. [2019] Aravind Rajeswaran, Chelsea Finn, Sham M Kakade, and Sergey Levine. Meta-learning with implicit gradients. Advances in neural information processing systems, 32, 2019. Rando et al. [2022] Javier Rando, Daniel Paleka, David Lindner, Lennard Heim, and Florian Tramèr. Red-teaming the stable diffusion safety filter. arXiv preprint arXiv:2210.04610, 2022. Rombach et al. [2022] Robin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser, and BjĂśrn Ommer. High-resolution image synthesis with latent diffusion models. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition (CVPR), pages 10684â10695, 2022. Romero et al. [2007] Enrique Romero, Ignacio Barrio, and LluĂs Belanche. Incremental and decremental learning for linear support vector machines. In International Conference on Artificial Neural Networks, pages 209â218. Springer, 2007. Sajjadi et al. [2018] Mehdi SM Sajjadi, Olivier Bachem, Mario Lucic, Olivier Bousquet, and Sylvain Gelly. Assessing generative models via precision and recall. Advances in neural information processing systems, 31, 2018. Salman et al. [2023] Hadi Salman, Alaa Khaddaj, Guillaume Leclerc, Andrew Ilyas, and Aleksander Madry. Raising the cost of malicious ai-powered image editing. arXiv preprint arXiv:2302.06588, 2023. Schramowski et al. [2022] Patrick Schramowski, Christopher Tauchmann, and Kristian Kersting. Can machines help us answering question 16 in datasheets, and in turn reflecting on inappropriate content? In Proceedings of the 2022 ACM Conference on Fairness, Accountability, and Transparency, pages 1350â1361, 2022. Schramowski et al. [2023] Patrick Schramowski, Manuel Brack, BjĂśrn Deiseroth, and Kristian Kersting. Safe latent diffusion: Mitigating inappropriate degeneration in diffusion models. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 22522â22531, 2023. Schuhmann et al. [2022] Christoph Schuhmann, Romain Beaumont, Richard Vencu, Cade Gordon, Ross Wightman, Mehdi Cherti, Theo Coombes, Aarush Katta, Clayton Mullis, Mitchell Wortsman, et al. Laion-5b: An open large-scale dataset for training next generation image-text models. Advances in Neural Information Processing Systems, 35:25278â25294, 2022. Sekhari et al. [2021] Ayush Sekhari, Jayadev Acharya, Gautam Kamath, and Ananda Theertha Suresh. Remember what you want to forget: Algorithms for machine unlearning. Advances in Neural Information Processing Systems (NeurIPS), 34:18075â18086, 2021. Shan et al. [2023] Shawn Shan, Jenna Cryan, Emily Wenger, Haitao Zheng, Rana Hanocka, and Ben Y Zhao. Glaze: Protecting artists from style mimicry by text-to-image models. arXiv preprint arXiv:2302.04222, 2023. Somepalli et al. [2023a] Gowthami Somepalli, Vasu Singla, Micah Goldblum, Jonas Geiping, and Tom Goldstein. Diffusion art or digital forgery? investigating data replication in diffusion models. In 2022 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 6048â6058, 2023a. Somepalli et al. [2023b] Gowthami Somepalli, Vasu Singla, Micah Goldblum, Jonas Geiping, and Tom Goldstein. Understanding and mitigating copying in diffusion models. arXiv preprint arXiv:2305.20086, 2023b. Song et al. [2020] Jiaming Song, Chenlin Meng, and Stefano Ermon. Denoising diffusion implicit models. arXiv preprint arXiv:2010.02502, 2020. Tarun et al. [2023a] Ayush Kumar Tarun, Vikram Singh Chundawat, Murari Mandal, and Mohan Kankanhalli. Deep regression unlearning. In International Conference on Machine Learning, pages 33921â33939. PMLR, 2023a. Tarun et al. [2023b] Ayush K Tarun, Vikram S Chundawat, Murari Mandal, and Mohan Kankanhalli. Fast yet effective machine unlearning. IEEE Transactions on Neural Networks and Learning Systems, 2023b. Tirumala et al. [2022] Kushal Tirumala, Aram Markosyan, Luke Zettlemoyer, and Armen Aghajanyan. Memorization without overfitting: Analyzing the training dynamics of large language models. Advances in Neural Information Processing Systems, 35:38274â38290, 2022. Voigt and Von dem Bussche [2017] Paul Voigt and Axel Von dem Bussche. The eu general data protection regulation (gdpr). A Practical Guide, 1st Ed., Cham: Springer International Publishing, 10(3152676):10â5555, 2017. Vyas et al. [2023] Nikhil Vyas, Sham Kakade, and Boaz Barak. Provable copyright protection for generative models. arXiv preprint arXiv:2302.10870, 2023. Webster et al. [2021] Ryan Webster, Julien Rabin, Loic Simon, and Frederic Jurie. This person (probably) exists. identity membership attacks against gan generated faces. arXiv preprint arXiv:2107.06018, 2021. Wu et al. [2020] Yinjun Wu, Edgar Dobriban, and Susan Davidson. DeltaGrad: Rapid retraining of machine learning models. In Proceedings of the 37th International Conference on Machine Learning, pages 10355â10366. PMLR, 2020. Ye et al. [2022] Jingwen Ye, Yifang Fu, Jie Song, Xingyi Yang, Songhua Liu, Xin Jin, Mingli Song, and Xinchao Wang. Learning with recoverable forgetting. In Computer VisionâECCV 2022: 17th European Conference, Tel Aviv, Israel, October 23â27, 2022, Proceedings, Part XI, pages 87â103. Springer, 2022. Ye and Zhu [1995] Jane J Ye and DL Zhu. Optimality conditions for bilevel programming problems. Optimization, 33(1):9â27, 1995. Zhang et al. [2023] Eric Zhang, Kai Wang, Xingqian Xu, Zhangyang Wang, and Humphrey Shi. Forget-me-not: Learning to forget in text-to-image diffusion models. arXiv preprint arXiv:2303.17591, 2023. Zhang et al. [2024] Yihua Zhang, Yimeng Zhang, Yuguang Yao, Jinghan Jia, Jiancheng Liu, Xiaoming Liu, and Sijia Liu. Unlearncanvas: A stylized image dataset to benchmark machine unlearning for diffusion models. arXiv preprint arXiv:2402.11846, 2024. Supplementary Material Impact Statements DMs have experienced rapid advancements and have shown the merits of generating high-quality data. However, concerns have arisen due to their ability to memorize training data and generate inappropriate content, thereby negatively affecting the user experience and society as a whole. Machine unlearning emerges as a valuable tool for correcting the algorithms and enhancing user trust in the respective platforms. It demonstrates a commitment to responsible AI and the welfare of its user base. The inclusion of explicit imagery in our paper might pose certain risks, e.g., some readers may find this explicit content distressing or offensive, which can lead to discomfort. Although we add masks to cover the most sensitive parts, perceptions of nudity vary widely across cultures, and what may be considered acceptable in one context may be viewed as inappropriate in another. Besides, while unlearning protects privacy, it may also hinder the ability of relevant systems, potentially lead to biased outcomes, and even be adopted for malicious usage, i.e., the methods developed in our study might potentially be misused for censorship or exploitation. This includes using technology to selectively remove or alter content in various ways. Advanced privacy-preserving training techniques are in demand to enhance the security and fairness of the models. Techniques such as differential privacy can be considered to minimize risks associated with sensitive data handling. Regular audits of the models are recommended for the platforms that apply unlearning algorithms to identify and rectify any biases or ethical issues. This involves assessing the modelsâ outputs to ensure that they align with ethical guidelines and do not perpetuate unfair biases. 7 Proofs Theorem 3.1 The optimal solution of the optimization problem in Sec. 3.2 is â=âârâ˘(t;r)+Îťtâ˘âgâ˘(t)superscriptsubscriptâsubscriptâsubscriptsubscriptsubscriptsubscriptâsubscript δ^*= _ θL_r( θ_t;% D_r)+ _t _ θg( θ_t)italic_δâ = âitalic_θ Litalic_r ( italic_θitalic_t ; Ditalic_r ) + Îťitalic_t âitalic_θ g ( italic_θitalic_t ) where Îťt=maxâĄ0,atââgâ˘(t)â¤â˘âârâ˘(t;r)ââgâ˘(t)â22subscriptmax0subscriptsubscriptâsuperscriptsubscripttopsubscriptâsubscriptâsubscriptsubscriptsuperscriptsubscriptnormsubscriptâsubscript22 _t=max\0, a_t- _ θg( % θ_t) _ θL_r( θ_t;% D_r)\| _ θg( θ_t)\|_2^2\Îťitalic_t = max 0 , divide start_ARG aitalic_t - âitalic_θ g ( italic_θitalic_t )⤠âitalic_θ Litalic_r ( italic_θitalic_t ; Ditalic_r ) end_ARG start_ARG ⼠âitalic_θ g ( italic_θitalic_t ) âĽ22 end_ARG . Proof. The Lagrange function with ÎťâĽ00Ν⼠0Îť ⼠0 for Sec. 3.2 is hâ˘(,Îť)=12âĽââconditional12subscriptâ h( δ,Îť)= 12 \| _ θh ( italic_δ , Îť ) = divide start_ARG 1 end_ARG start_ARG 2 end_ARG ⼠âitalic_θ ââ˘(t;r)ââĽ22âsubscriptsubscriptevaluated-at22 L( θ_t;D_r)- δ% \|_2^2L ( italic_θitalic_t ; Ditalic_r ) - italic_δ âĽ22 +Îťâ˘(atââgâ˘(t)â¤â˘).subscriptsubscriptâsuperscriptsubscripttop +Îť(a_t- _ θg( θ_t) % δ).+ Îť ( aitalic_t - âitalic_θ g ( italic_θitalic_t )⤠italic_δ ) . (7) Then, using the Karush-Kuhn-Tucker (KKT) theorem, at the optimal solution we have ââârâ˘(t;r)âÎťâ˘âgâ˘(t)subscriptâsubscriptâsubscriptsubscriptsubscriptâsubscript δ- _ θL_r( θ% _t;D_r)-Îť _ θg( θ_t)italic_δ - âitalic_θ Litalic_r ( italic_θitalic_t ; Ditalic_r ) - Îť âitalic_θ g ( italic_θitalic_t ) =,absent0 = 0,= 0 , âgâ˘(t)â¤â˘subscriptâsuperscriptsubscripttop _ θg( θ_t) δâitalic_θ g ( italic_θitalic_t )⤠italic_δ âĽat,absentsubscript ⼠a_t,⼠aitalic_t , Îťâ˘(atââgâ˘(t)Tâ˘)subscriptsubscriptâsuperscriptsubscript Îť(a_t- _ θg( θ_t)^T % δ)Îť ( aitalic_t - âitalic_θ g ( italic_θitalic_t )T italic_δ ) =0,absent0 =0,= 0 , Îť Îť âĽ0.absent0 ⼠0.⼠0 . (8) From the above constraints, we can obtain: δitalic_δ =âârâ˘(t;r)+Îťâ˘âgâ˘(t),absentsubscriptâsubscriptâsubscriptsubscriptsubscriptâsubscript = _ θL_r( θ_t;% D_r)+Îť _ θg( θ_t),= âitalic_θ Litalic_r ( italic_θitalic_t ; Ditalic_r ) + Îť âitalic_θ g ( italic_θitalic_t ) , Îť Îť =maxâĄ0,atââgâ˘(t)â¤â˘âârâ˘(t;r)ââgâ˘(t)â22.absentmax0subscriptsubscriptâsuperscriptsubscripttopsubscriptâsubscriptâsubscriptsubscriptsuperscriptsubscriptnormsubscriptâsubscript22 =max\0, a_t- _ θg( % θ_t) _ θL_r( θ_t;% D_r)\| _ θg( θ_t)\|_2^2\.= max 0 , divide start_ARG aitalic_t - âitalic_θ g ( italic_θitalic_t )⤠âitalic_θ Litalic_r ( italic_θitalic_t ; Ditalic_r ) end_ARG start_ARG ⼠âitalic_θ g ( italic_θitalic_t ) âĽ22 end_ARG . (9) â Theorem 3.2 [Pareto optimality] The stationary point obtained by our algorithm is Pareto optimal of the problem minâĄ[ârâ˘(;r),âfâ˘(;f)]subscriptminsubscriptâsubscriptsubscriptâsubscriptmin_ θ[L_r( θ;D% _r),L_f( θ;D_f)]minbold_italic_θ [ Litalic_r ( italic_θ ; Ditalic_r ) , Litalic_f ( italic_θ ; Ditalic_f ) ]. Proof. Let âsuperscriptâ θ italic_θâ be the solution to our problem. Recall that for the current θitalic_θ, we find ĎKsuperscriptbold-italic-Ď Ď^Kitalic_Ďitalic_K to minimize gâ˘(,Ď)=âfâ˘(;f)âminâĄâfâ˘(Ď;f)bold-italic-Ďsubscriptâsubscriptminsubscriptâbold-italic-Ďsubscriptg( θ, Ď)=L_f( θ;D_f)-% minL_f( Ď;D_f)g ( italic_θ , italic_Ď ) = Litalic_f ( italic_θ ; Ditalic_f ) - min Litalic_f ( italic_Ď ; Ditalic_f ). Assume that we can update in sufficient number of steps K so that ĎK=Ďââ˘()=argminĎâĄgâ˘(,Ď)=argminĎâĄâfâ˘(Ď;f)superscriptbold-italic-Ďsuperscriptbold-italic-Ďsubscriptargminbold-italic-Ďbold-italic-Ďsubscriptargminbold-italic-Ďsubscriptâbold-italic-Ďsubscript Ď^K= Ď^*( θ)=argmin_ Ďg(% θ, Ď)=argmin_ ĎL_f(% Ď;D_f)italic_Ďitalic_K = italic_Ďâ ( italic_θ ) = argminbold_italic_Ď g ( italic_θ , italic_Ď ) = argminbold_italic_Ď Litalic_f ( italic_Ď ; Ditalic_f ). Here Ďbold-italic-Ď Ďitalic_Ď is initialized at θitalic_θ. The objective aims to minimize ârâ˘(;r)+Îťâ˘gâ˘(;Ďââ˘())subscriptâsubscriptsuperscriptbold-italic-ĎâL_r( θ;D_r)+Îť g( θ; % Ď ( θ))Litalic_r ( italic_θ ; Ditalic_r ) + Îť g ( italic_θ ; italic_Ďâ ( italic_θ ) ), let âsuperscriptâ θ italic_θâ be the optimal solution to this objective. Note that gâ˘(,Ďââ˘())=âfâ˘(;f)âminâĄâfâ˘(Ďââ˘();f)âĽ0superscriptbold-italic-Ďâsubscriptâsubscriptminsubscriptâsuperscriptbold-italic-Ďâsubscript0g( θ, Ď ( θ))=L_f( θ% ;D_f)-minL_f( Ď (% θ);D_f)⼠0g ( italic_θ , italic_Ďâ ( italic_θ ) ) = Litalic_f ( italic_θ ; Ditalic_f ) - min Litalic_f ( italic_Ďâ ( italic_θ ) ; Ditalic_f ) ⼠0 as Ďbold-italic-Ď Ďitalic_Ď starts from θitalic_θ and is update to decreas âfâ˘(Ď;f)subscriptâbold-italic-ĎsubscriptL_f( Ď;D_f)Litalic_f ( italic_Ď ; Ditalic_f ). This will decrease to 00 for minimizing the above objective. Therefore, at the optimal solution âsuperscriptâ θ italic_θâ, we have gâ˘(â,Ďââ˘(â))=0superscriptâsuperscriptbold-italic-Ďâsuperscriptâ0g( θ , Ď ( θ ))=0g ( italic_θâ , italic_Ďâ ( italic_θâ ) ) = 0. This further implies that âfâ˘(â;f)=minâĄâfâ˘(Ďââ˘(â);f)subscriptâsuperscriptsubscriptminsubscriptâsuperscriptbold-italic-ĎâsuperscriptsubscriptL_f( θ^*;D_f)=min% L_f( Ď ( θ^*);D_f)Litalic_f ( italic_θâ ; Ditalic_f ) = min Litalic_f ( italic_Ďâ ( italic_θâ ) ; Ditalic_f ), meaning that âsuperscript θ^*italic_θâ is the current optimal solution of âfâ˘(;Df)subscriptâsubscriptL_f( θ;D_f)Litalic_f ( italic_θ ; Ditalic_f ) because we cannot update further the optimal solution. Moreover, we have âsuperscript θ^*italic_θâ as the local minima of ârâ˘(;r)subscriptâsubscriptL_r( θ;D_r)Litalic_r ( italic_θ ; Ditalic_r ) in sufficiently small vicinity considered, because in the small vicinity around âsuperscript θ^*italic_θâ, gâ˘(,Ďââ˘(â))=0superscriptbold-italic-Ďsuperscript0g ( θ, Ď^*( θ^*) )=0g ( italic_θ , italic_Ďâ ( italic_θâ ) ) = 0 provides no further improvements for the above sum, any increase in the above objective in the vicinity of âsuperscript θ^*italic_θâ would primarily be due to an increase in ârâ˘(;r)subscriptâsubscriptL_r( θ;D_r)Litalic_r ( italic_θ ; Ditalic_r ). â 8 Reproducibility Statement and Details In this section, we provide detailed instructions on the reproduction of our results, we also share our source code at the repository https://github.com/JingWu321/EraseDiff. DDPM. Results on conditional DDPM follow the setting in SA [28]. Thanks to the pre-trained DDPM from SA. The batch size is set to be 128, the learning rate is 1Ă10â41superscript1041Ă 10^-41 Ă 10- 4, our model is trained for around 300 training steps. 5K images per class are generated for evaluation. For the remaining experiments, four and five feature map resolutions are adopted for CIFAR10 where image resolution is 32Ă32323232Ă 3232 Ă 32. All models apply the linear schedule for the diffusion process. We used A5500 and A100 for all experiments. SD. We use the open-source SD v1.4 checkpoint as the pre-trained model for all SD experiments. The learning rate is 1Ă10â51superscript1051Ă 10^-51 Ă 10- 5, and our method only fine-tuned the unconditional (non-cross-attention) layers of the latent diffusion model when erasing the concept of nudity. When forgetting nudity, we generate around 400 images with the prompts ânudityâ, ânakedâ, âeroticâ, âsexualâ and around 400 images with the prompt âa person wearing clothesâ to be the training data. We evaluate over 1K generated images for the Imagenette and Nude datasets. 4703 generated images with I2P prompts are evaluated using the open-source NudeNet classifier [2]. The repositories we built upon use the C-BY 4.0 and MIT Licenses. 9 Additional results Below, we also provide results on SD for EraseDiff when we replace Ďľfsubscriptbold-italic-Ďľ Îľ_fitalic_Ďľitalic_f with Ďľâ˘(t|cm)subscriptitalic-Ďľconditionalsubscriptsubscript _ θ(x_t|c_m)Ďľbold_italic_θ ( xitalic_t | citalic_m ) like Fan et al. [16], Heng and Soh [28], where cmsubscriptc_mcitalic_m is âa person wearing clothesâ, denoted as EraseDiffwcsubscriptEraseDiffwcEraseDiff_wcEraseDiffwc. The CLIP score and FID score for EraseDiffwcsubscriptEraseDiffwcEraseDiff_wcEraseDiffwc are 30.31 and 19.55, respectively. Table 5: Performance of class-wise forgetting on Imagenette using SD. UA: the accuracy of the generated images that do not belong to the forgetting class (i.e., the effectiveness of forgetting). The FID score is measured compared to validation data for the remaining classes. Forget. Class SalUn EraseDiff FID â â UA (%)â â FID â â UA (%)â â Tench 1.49 100 1.29 100 English Springer 1.50 100 1.38 100 Cassette Player 1.11 100 0.85 100 Chain Saw 1.64 100 1.17 99.9 Church 0.76 100 0.83 100 French Horn 0.67 100 1.09 100 Garbage Truck 1.54 100 0.96 100 Gas Pump 1.59 100 1.25 100 Golf Ball 1.29 98.8 1.50 99.5 Parachute 1.35 100 0.78 99.7 Average 1.29 99.88 1.11 99.91 Figure 6: Quantity of nudity content detected using the NudeNet classifier from Nude-1K data with a threshold of 0.6. Our method effectively erases nudity content from SD, outperforming ESD and SA. Figure 7: Generated examples with I2P prompts when forgetting the concept of ânudityâ. Figure 8: Generated examples with I2P prompts when forgetting the concept of ânudityâ. Figure 9: Generated examples with I2P prompts when forgetting the concept of ânudityâ. Figure 10: The flagged images generated by EraseDiff that are detected as exposed female breast/genitalia by the NudeNet classifier with a threshold of 0.6. The top two rows are generated images conditioned on prompts ânudityâ, ânakedâ, âeroticâ, âsexualâ, and the rest are those conditioned on I2P prompts. No images contain explicit nudity content. Figure 11: Visualization of generated examples with prompts ânudityâ, ânakedâ, âeroticâ, âsexualâ when forgetting the concept of ânudityâ. Figure 12: Visualization of generated images with COCO 30K prompts by the scrubbed SD models when forgetting the concept of ânudityâ. Figure 13: Visualization of generated images with COCO 30K prompts by the scrubbed SD models when forgetting the concept of ânudityâ. Figure 14: Generated images after forgetting the class âtenchâ. The first column is generated images conditioned on the class âtenchâ and the rest are those conditioned on the remaining classes. Figure 15: Visualization of generated images by the scrubbed SD models when forgetting the class âtenchâ on Imagenette. The first column is generated images conditioned on the class âtenchâ and the rest are those conditioned on the remaining classes. Figure 16: Visualization of generated images by the scrubbed SD models when forgetting the class âtenchâ on Imagenette. The first column is generated images conditioned on the class âtenchâ and the rest are those conditioned on the remaining classes. Figure 17: Visualization of generated images by the scrubbed SD models when forgetting the class âtenchâ on Imagenette. The first column is generated images conditioned on the class âtenchâ and the rest are those conditioned on the remaining classes. Figure 18: Visualization of generated images by the scrubbed SD models when forgetting the class âtenchâ on Imagenette. The first column is generated images conditioned on the class âtenchâ and the rest are those conditioned on the remaining classes. Figure 19: Visualization of generated examples when forgetting the class âairplaneâ on DDPM.