Paper deep dive
Bridging the Gap Between Preference Alignment and Machine Unlearning
Xiaohua Feng, Yuyuan Li, Huwei Ji, Jiaming Zhang, Li Zhang, Tianyu Du, Chaochao Chen
Intelligence
Status: succeeded | Model: google/gemini-3.1-flash-lite-preview | Prompt: intel-v1 | Confidence: 95%
Last extracted: 3/12/2026, 6:22:35 PM
Summary
The paper introduces 'Unlearning to Align' (U2A), a bi-level optimization framework that bridges the gap between Machine Unlearning (MU) and Preference Alignment (PA) in Large Language Models. By quantifying the impact of unlearning specific negative examples on PA performance, the authors demonstrate that selective unlearning, rather than indiscriminate removal, maximizes alignment efficiency and effectiveness.
Entities (5)
Relation Signals (3)
U2A â utilizes â Bi-level Optimization
confidence 98% ¡ we propose a framework called Unlearning to Align (U2A), which leverages bi-level optimization
U2A â optimizes â Preference Alignment
confidence 95% ¡ U2A... to efficiently select and unlearn examples for optimal PA performance.
Machine Unlearning â integrateswith â Preference Alignment
confidence 92% ¡ This framework bridges the gap between MU and PA, offering a systematic approach to their integration.
Cypher Suggestions (0)
No Cypher suggestions yet.
Abstract
Abstract:Despite advances in Preference Alignment (PA) for Large Language Models (LLMs), mainstream methods like Reinforcement Learning with Human Feedback (RLHF) face notable challenges. These approaches require high-quality datasets of positive preference examples, which are costly to obtain and computationally intensive due to training instability, limiting their use in low-resource scenarios. LLM unlearning technique presents a promising alternative, by directly removing the influence of negative examples. However, current research has primarily focused on empirical validation, lacking systematic quantitative analysis. To bridge this gap, we propose a framework to explore the relationship between PA and LLM unlearning. Specifically, we introduce a bi-level optimization-based method to quantify the impact of unlearning specific negative examples on PA performance. Our analysis reveals that not all negative examples contribute equally to alignment improvement when unlearned, and the effect varies significantly across examples. Building on this insight, we pose a crucial question: how can we optimally select and weight negative examples for unlearning to maximize PA performance? To answer this, we propose a framework called Unlearning to Align (U2A), which leverages bi-level optimization to efficiently select and unlearn examples for optimal PA performance. We validate the proposed method through extensive experiments, with results confirming its effectiveness.
Tags
Links
- Source: https://arxiv.org/abs/2504.06659
- Canonical: https://arxiv.org/abs/2504.06659
Trouble viewing inline? Open PDF directly â
Full Text
144,045 characters extracted from source content.
Expand or collapse full text
Bridging the Gap Between Preference Alignment and Machine Unlearning Xiaohua Feng Yuyuan Li Huwei Ji Jiaming Zhang Li Zhang Tianyu Du Chaochao Chen Abstract Despite advances in Preference Alignment (PA) for Large Language Models (LLMs), mainstream methods like Reinforcement Learning with Human Feedback (RLHF) face notable challenges. These approaches require high-quality datasets of positive preference examples, which are costly to obtain and computationally intensive due to training instability, limiting their use in low-resource scenarios. LLM unlearning technique presents a promising alternative, by directly removing the influence of negative examples. However, current research has primarily focused on empirical validation, lacking systematic quantitative analysis. To bridge this gap, we propose a framework to explore the relationship between PA and LLM unlearning. Specifically, we introduce a bi-level optimization-based method to quantify the impact of unlearning specific negative examples on PA performance. Our analysis reveals that not all negative examples contribute equally to alignment improvement when unlearned, and the effect varies significantly across examples. Building on this insight, we pose a crucial question: how can we optimally select and weight negative examples for unlearning to maximize PA performance? To answer this, we propose a framework called Unlearning to Align (U2A), which leverages bi-level optimization to efficiently select and unlearn examples for optimal PA performance. We validate the proposed method through extensive experiments, with results confirming its effectiveness. Machine Learning, ICML 1 Introduction Despite the strong performance of Large Language Models (LLMs) in predicting the next token, their generated content often exhibits biases, factual inaccuracies, and other undesirable behaviors (Bai et al., 2022; Casper et al., 2023). Preference Alignment (PA) has been proposed to address these issues by guiding LLMs to generate responses aligned with human preferences, such as fairness and helpfulness (Christiano et al., 2017; Ziegler et al., 2019; Stiennon et al., 2020). This approach uses datasets of human-annotated preferred and non-preferred responses to optimize the model. Reinforcement Learning from Human Feedback (RLHF) is the primary method for achieving PA (Korbak et al., 2023; Wu et al., 2024; Azar et al., 2024), involving the training of a reward model on human preference data and optimizing the LLM using algorithms like Proximal Policy Optimization (PPO) (Schulman et al., 2017) or Direct Preference Optimization (DPO) (Rafailov et al., 2024). While RLHF shows strong performance across diverse applications, such as programming and creative writing, it relies on costly large-scale preference-aligned datasets, especially for positive examples (Yao et al., 2024). Additionally, RLHF training is computationally intensive and prone to instability (Liu et al., 2024b; Zhou et al., 2024), posing challenges for low-resource alignment scenarios. As a key technique aimed at protecting user privacy, Machine Unlearning (MU) in LLMs offers a novel solution to the aforementioned challenges (Liu et al., 2024c; Yao et al., 2024). This technique enables the removal of specific user data from pre-trained LLMs without requiring a complete retraining of the model. By facilitating the unlearning of negative examples, this technique promotes PA while addressing the high costs and difficulties associated with acquiring positive examples for standard RLHF. Unlike RLHF, LLM unlearning requires only negative examples, which are typically easier and cheaper to collect via mechanisms like user reports or red team testing. For unaligned pre-trained models, identifying counterexamples can be highly automated, further reducing data collection costs. Additionally, the computational overhead of unlearning is comparable to fine-tuning and significantly lower than RLHFâs full training process, making it a practical approach for achieving alignment in low-resource scenarios. Existing studies (Feng et al., 2024; Liu et al., 2024c; Yao et al., 2024) have validated the effectiveness of achieving model alignment through the unlearning of negative examples, highlighting the potential of integrating MU with PA. However, these studies primarily rely on experimental demonstrations, lacking in-depth quantitative analysis. For instance, the quantitative impact of unlearning specific samples on PA remains unclear. Additionally, critical questions such as which examples should be unlearned to maximize alignment and how to optimally select subsets of examples for unlearning to achieve the best outcomes remain unresolved. These gaps underscore a theoretical and practical disconnect between MU and PA. Addressing these challenges requires the development of a comprehensive analytical framework to unify these two domains and facilitate a deeper understanding of their intrinsic connections. To address the identified challenges, we first develop a special bi-level optimization framework to quantify how unlearning specific negative samples impacts model PA performance. In particular, the inner optimization focuses on unlearning the target sample, while the outer optimization assesses the resulting change in PA performance. After further analysis, we find that not all negative examples contribute to PA improvement, with the degree of impact varying across examples. Meanwhile, the magnitude of the impact is influenced by the unlearning weights. This suggests that indiscriminately applying unlearning to all negative examples fails to achieve optimal PA performance. To address this, we propose a framework called Unlearning to Align (U2A), based on bi-level optimization, to strategically select samples and determine optimal unlearning weights. Further convergence and computational complexity analysis indicate that our proposed method demonstrates good applicability and efficiency in LLMs. This framework bridges the gap between MU and PA, offering a systematic approach to their integration. We summarize the main contributions of this paper as follows: ⢠We propose a special bi-level optimization framework to measure the impact of unlearning specific samples on PA performance, bridging the gap between MU and PA. ⢠We find that unlearning all negative examples does not always benefit PA, as their contributions to PA improvement vary and can be adjusted through unlearning weights. ⢠We propose the U2A framework, leveraging bi-level optimization to select and weight negative examples for unlearning, thereby maximizing PA performance. ⢠We conduct extensive evaluations on multiple models and real-world datasets, and the experimental results demonstrate the effectiveness of our method. 2 Related Work 2.1 Preference Alignment PA methods can be broadly classified into learning-based and decoding-based methods, depending on whether model parameters are updated (Zhou et al., 2024). Learning-based methods (Ziegler et al., 2019; Stiennon et al., 2020; Ouyang et al., 2022; Azar et al., 2024), such as RLHF, optimize models using preference datasets with techniques like PPO (Schulman et al., 2017), DPO (Rafailov et al., 2024), and Self-play Preference Optimization (SPO) (Wu et al., 2024). However, RLHF is computationally expensive (Rafailov et al., 2024). To mitigate this, decoding-based methods (Kim et al., 2023; Gao et al., 2023; Huang et al., 2024; Mudgal et al., 2024), which guide inference without parameter updates, have gained attention. Examples include rejection sampling (Mitchell et al., 2024; Beirami et al., 2024) and Monte Carlo Tree Search (Liu et al., 2023; Wan et al., 2024), which reduce computational costs by keeping parameters fixed. Since this study focuses on the relationship between MU and PA, and the former requires parameter updates, we primarily consider learning-based methods. 2.2 LLM unlearning The goal of LLM unlearning is to remove specific knowledge from training data while preserving the modelâs performance on unrelated tasks (Jang et al., 2023; Ji et al., 2024b; Liu et al., 2024a; Feng et al., 2024). Existing methods can be categorized into three main approaches: i) Gradient-based methods (Jang et al., 2023; Maini et al., 2024) use gradient ascent on the forget set (i.e., the data to be unlearned) to remove associated knowledge, with parameter regularization added to preserve performance on other tasks. i) Preference optimization-based methods (Maini et al., 2024; Zhang et al., 2024) treat the forget set as negative examples or assign predefined responses (e.g., rejection responses) to achieve unlearning during PA. i) Model weight-based methods (Jia et al., 2024b) analyze the roles of different model modules to guide unlearning, leveraging the modularity of LLMs. As model weight-based methods are primarily used for attribution analysis, this study focuses on gradient-based and preference optimization-based approaches. 3 Preliminary Given a training set t=1,2,âŚ,Ntsubscriptsuperscript1superscript2âŚsuperscriptsubscriptD_t=\ x^1, x^2,âŚ, x^% N_t\Ditalic_t = italic_x1 , italic_x2 , ⌠, italic_xitalic_Nitalic_t , where i=x1,x2,âŚ,xnisuperscriptsubscript1subscript2âŚsubscriptsubscript x^i=\x_1,x_2,âŚ,x_n_i\italic_xitalic_i = x1 , x2 , ⌠, xitalic_n start_POSTSUBSCRIPT i end_POSTSUBSCRIPT represents samples (i.e., sentences) with a token length of nisubscriptn_initalic_i, and NtsubscriptN_tNitalic_t denotes the number of samples. A model Ď is trained on tsubscriptD_tDitalic_t, and its optimal parameters âsuperscript θ^*italic_θâ satisfy the following equation: âsuperscript θ^*italic_θâ =argâ˘minâĄâNLLâ˘(t;)absentsubscriptargminsubscriptâNLLsubscript = *arg\,min_ θL_% NLL(D_t; θ)= start_OPERATOR arg min end_OPERATORitalic_θ Lroman_NLL ( Ditalic_t ; italic_θ ) =argâ˘minâiâźtâ˘[ât=1nilogâĄpâ˘(xtâŁ<t;)],absentsubscriptargminsubscriptsimilar-tosuperscriptsubscriptdelimited-[]superscriptsubscript1subscriptconditionalsubscriptsubscriptabsent = *arg\,min_ θ-E_% x^i _t [ _t=1^n_i p(x_t % x_<t; θ) ],= start_OPERATOR arg min end_OPERATORitalic_θ - blackboard_Eitalic_xitalic_i âź D start_POSTSUBSCRIPT t end_POSTSUBSCRIPT [ ât = 1nitalic_i log p ( xitalic_t ⣠italic_x< t ; italic_θ ) ] , (1) where pâ˘(xtâŁ<t;)=Ďâ˘(xtâŁ<t)conditionalsubscriptsubscriptabsentsubscriptconditionalsubscriptsubscriptabsentp(x_t x_<t; θ)= _ θ(% x_t x_<t)p ( xitalic_t ⣠italic_x< t ; italic_θ ) = Ďbold_italic_θ ( xitalic_t ⣠italic_x< t ) denotes the prediction probability of model Ďsubscript _ θĎbold_italic_θ for the t-th token, given the first tâ11t-1t - 1 tokens as input. Next, we define the objectives for conducting RLHF and MU on the model Ďsubscript _ θĎbold_italic_θ, respectively. 3.1 Definition of RLHF The standard RLHF paradigm consists of two main stages (Azar et al., 2024): i) learning a reward model, and i) optimizing the policy (i.e., the model parameters) based on the learned reward. In the reward model learning phase, a binary classifier is often trained using a logistic regression loss to distinguish preferred from non-preferred behaviors. A popular choice is the Bradley-Terry model (Bradley & Terry, 1952), where the pointwise reward râ˘(<t,xt)subscriptabsentsubscriptr( x_<t,x_t)r ( italic_x< t , xitalic_t ) serves as the score for action xtsubscriptx_txitalic_t, given context <tsubscriptabsent x_<titalic_x< t. Given a dataset a=<ti,xtiâťx^tii=1Nasubscriptsuperscriptsubscriptsucceedssubscriptsuperscriptabsentsubscriptsuperscriptsubscriptsuperscript^1subscriptD_a=\ x^i_<t,x^i_t x^i_t\_i=1% ^N_aDitalic_a = italic_xitalic_i< t , xitalic_iitalic_t âť over start_ARG x end_ARGiitalic_t i = 1Nitalic_a, where xtiâťx^tisucceedssubscriptsuperscriptsubscriptsuperscript^x^i_t x^i_txitalic_iitalic_t âť over start_ARG x end_ARGiitalic_t denotes a preference for xtisubscriptsuperscriptx^i_txitalic_iitalic_t over x^tisubscriptsuperscript x^i_tover start_ARG x end_ARGiitalic_t, the reward function is learned by minimizing the following logistic regression loss: ââ˘(r)=â(<ti,xtiâťx^ti)âźaâ˘[logâĄ(pâ˘(xtiâťx^ti|<ti))],âsubscriptâźsucceedssubscriptsuperscriptabsentsubscriptsuperscriptsubscriptsuperscript^subscriptdelimited-[]succeedssubscriptsuperscriptconditionalsubscriptsuperscript^subscriptsuperscriptabsentL(r)=-E_( x^i_<t,x^i_t x^i% _t) _a [ (p(x^i_t x^i_t|% x^i_<t) ) ],L ( r ) = - blackboard_E( italic_xitalic_i start_POSTSUBSCRIPT < t , xitalic_iitalic_t âť over start_ARG x end_ARGiitalic_t ) âź Ditalic_a end_POSTSUBSCRIPT [ log ( p ( xitalic_iitalic_t âť over start_ARG x end_ARGiitalic_t | italic_xitalic_i< t ) ) ] , (2) where pâ˘(xtiâťx^ti|<ti)=Ďâ˘(râ˘(<ti,xti)ârâ˘(<ti,x^ti))succeedssubscriptsuperscriptconditionalsubscriptsuperscript^subscriptsuperscriptabsentsubscriptsuperscriptabsentsubscriptsuperscriptsubscriptsuperscriptabsentsubscriptsuperscript^p(x^i_t x^i_t| x^i_<t)=Ď (r(% x^i_<t,x^i_t)-r( x^i_<t, x^i_t) )p ( xitalic_iitalic_t âť over start_ARG x end_ARGiitalic_t | italic_xitalic_i< t ) = Ď ( r ( italic_xitalic_i< t , xitalic_iitalic_t ) - r ( italic_xitalic_i< t , over start_ARG x end_ARGiitalic_t ) ) and Ďâ˘(¡)¡Ď( )Ď ( ¡ ) denotes the sigmoid function. Based on the reward function, the objective of RLHF is to maximize the expected reward while minimizing the divergence between the policy Ďsubscript _ θĎbold_italic_θ and a reference policy Ďrefsubscriptref _refĎroman_ref. The specific objective can be expressed as: â˘()=Ďâ˘[râ˘(<ti,xti)]âĎâ˘DKLâ˘(ĎâĽĎref),subscriptsubscriptdelimited-[]subscriptsuperscriptabsentsubscriptsuperscriptsubscriptKLconditionalsubscriptsubscriptrefJ( θ)=E_ _ θ[r(% x^i_<t,x^i_t)]-Ď D_KL( _ % θ _ref),J ( italic_θ ) = blackboard_EĎ start_POSTSUBSCRIPT italic_θ end_POSTSUBSCRIPT [ r ( italic_xitalic_i< t , xitalic_iitalic_t ) ] - Ď Droman_KL ( Ďbold_italic_θ ⼠Ďroman_ref ) , (3) where <tiâźĎsimilar-tosubscriptsuperscriptabsent x^i_<t _xitalic_i< t âź Ď denote the sampled history, xtiâźĎ(â |<ti)x^i_t _ θ(¡| x^i_<t)xitalic_iitalic_t âź Ďbold_italic_θ ( â | italic_xitalic_i< t ) denote the action drawn from the policy, and Ď is the parameter balancing the alignment and regularization objectives. The KL divergence DKLsubscriptKLD_KLDroman_KL is used to quantify the difference between the reference and current policies. Since LLM unlearning in this work incorporates a regularization term with analogous effects, we retain only the reward term in Eq. (3). 3.2 Definition of LLM Unlearning Mainstream methods for unlearning in LLMs typically involve fine-tuning the original model with an unlearning objective function. Giver a forget set fsubscriptD_fDitalic_f, while specific designs vary, the loss function in LLM unlearning tasks can generally be expressed as: ââ˘()=âforgetâ˘(f;)+Îťâ˘âregâ˘().âsubscriptâforgetsubscriptsubscriptâregL( θ)=L_forget(D_% f; θ)+ _reg( θ).L ( italic_θ ) = Lroman_forget ( Ditalic_f ; italic_θ ) + Îť Lroman_reg ( italic_θ ) . (4) Here, âforgetsubscriptâforgetL_forgetLroman_forget often is a loss term targeting data to be unlearned, reducing the modelâs performance on these samples to minimize their influence on future predictions. To preserve the modelâs overall performance on unrelated data and confine unlearning to the intended scope, regularization terms âregsubscriptâregL_regLroman_reg such as output loss or divergence regularization are commonly introduced. These terms essentially act as parameter regularization. Specifically, commonly used loss-based methods (Jia et al., 2024a; Ji et al., 2024b) typically integrate one or more of the loss components. For readability, in this paper, we employ the widely adopted gradient ascent unlearning loss and parameter regularization loss as general objectives for LLM unlearning, considering their broad applicability. The formalization is as follows: minâĄ1|f|â˘âi=1|f|ât=1nilogâĄpâ˘(xtâŁ<ti;)ââforgetâ˘(f;)+Îťâ˘ââââ2ââregâ˘().subscriptsubscriptâ1subscriptsuperscriptsubscript1subscriptsuperscriptsubscript1subscriptconditionalsubscriptsubscriptsuperscriptabsentsubscriptâforgetsubscriptsubscriptâsuperscriptnormsuperscript2subscriptâreg _ θ 1|D_f| _i=1^|% D_f| _t=1^n_i p(x_t x^i_<t;% θ)_L_forget(D_f;% θ)+Îť \| θ- % θ^*\|^2_L_reg( θ).minbold_italic_θ underâ start_ARG divide start_ARG 1 end_ARG start_ARG | Ditalic_f | end_ARG âi = 1| Ditalic_f | ât = 1nitalic_i log p ( xitalic_t ⣠italic_xitalic_i< t ; italic_θ ) end_ARGL start_POSTSUBSCRIPT forget ( Ditalic_f ; italic_θ ) end_POSTSUBSCRIPT + Îť underâ start_ARG ⼠italic_θ - italic_θâ âĽ2 end_ARGL start_POSTSUBSCRIPT reg ( italic_θ ) end_POSTSUBSCRIPT . (5) A more detailed discussion on the definition of LLM unlearning can be found in Appendix A. 4 Connection between MU and PA 4.1 Impact of MU on PA Given a training sample xitalic_x to be unlearned, the unlearning objective in an LLM is described by Eq (5). We adopt a special bi-level optimization framework to link MU with PA, quantifying how unlearning a single sample affects the modelâs PA performance. In this setup, the inner problem ensures the unlearning objective is achieved, while the outer problem evaluates its impact on PA performance. Specifically, we assume that the degree of unlearning for a sample xitalic_x is represented by the weight âĽ00 Ď⼠0italic_Ď âĽ 0, and the model parameters that satisfy the unlearning objective under this condition are denoted as ââ˘()superscript θ^*( Ď)italic_θâ ( italic_Ď ). The bi-level optimization problem is formulated as: Findâ˘(ââ˘())ââ˘(ââ˘(0))Findsuperscriptsuperscript0 ( θ^*( % Ď))-J( θ^*(0))Find J ( italic_θâ ( italic_Ď ) ) - J ( italic_θâ ( 0 ) ) s.t.ââ˘()=argâĄminâĄâ˘âforgetâ˘(;)+Îťâ˘âregâ˘(),s.t.superscriptsubscriptsubscriptâforgetsubscriptâreg .t. θ^*( Ď)= % _ θ ĎL_forget(% x; θ)+ _reg(% θ),s.t. italic_θâ ( italic_Ď ) = arg minbold_italic_θ italic_Ď Lroman_forget ( italic_x ; italic_θ ) + Îť Lroman_reg ( italic_θ ) , (6) where â˘(ââ˘())superscriptJ( θ^*( Ď))J ( italic_θâ ( italic_Ď ) ) represents the PA performance of the model when the unlearning weight is Ďitalic_Ď. For example, â˘(ââ˘(0))superscript0J( θ^*(0))J ( italic_θâ ( 0 ) ) represents the PA performance of the model without any unlearning. Inspired by the implicit function method for solving bi-level optimization problems, we further derive and prove Proposition 7. Assumption 4.1. âforgetâ˘(;)subscriptâforgetL_forget( x; θ)Lroman_forget ( italic_x ; italic_θ ) is continuously differentiable w.r.t. θitalic_θ, and its Hessian matrix is positive semidefinite. â˘()J( θ)J ( italic_θ ) is twice continuously differentiable w.r.t θitalic_θ. Proposition 4.2. If Assumptions 4.1 holds, the change in PA performance for a model with parameters âsuperscript θ^*italic_θâ after unlearning sample xitalic_x using unlearning weight Ďitalic_Ď satisfies: Îâ˘(ââ˘())ââ2â˘ââ˘(â)â¤â˘ââforgetâ˘(;â).Îsuperscript2subscriptâsuperscriptsuperscripttopsubscriptâsubscriptâforgetsuperscript ( θ^*( Ď))â- % Ď2 _ θJ( % θ^*) _ θL_forget(% x; θ^*).Î J ( italic_θâ ( italic_Ď ) ) â - divide start_ARG italic_Ď end_ARG start_ARG 2 end_ARG âitalic_θ J ( italic_θâ )⤠âitalic_θ Lroman_forget ( italic_x ; italic_θâ ) . (7) Proof. The proof can be found in Appendix B.1. â According to Proposition 7, we can directly set the unlearning weight Ďitalic_Ď to 1 (i.e., Î(â(1) ( θ^*(1)Î J ( italic_θâ ( 1 )) to quantitatively assess the impact of unlearning a single sample on the modelâs PA performance. To further analyze the factors influencing Îâ˘(ââ˘())Îsuperscript ( θ^*( Ď))Î J ( italic_θâ ( italic_Ď ) ), we decompose the gradient inner product into the gradient norm and the cosine of the angle between gradients, as follows: Îâ˘(ââ˘())ââ2â˘âââ˘(â)ââ âââforgetâ˘(;â)ââ cosâĄ(Ď),Îsuperscriptâ 2normsubscriptâsuperscriptnormsubscriptâsubscriptâforgetsuperscriptitalic-Ď ( θ^*( Ď))â- % Ď2\| _ θJ( % θ^*)\|¡\| _ θL_forget% ( x; θ^*)\|¡ (Ď),Î J ( italic_θâ ( italic_Ď ) ) â - divide start_ARG italic_Ď end_ARG start_ARG 2 end_ARG ⼠âitalic_θ J ( italic_θâ ) ⼠â ⼠âitalic_θ Lroman_forget ( italic_x ; italic_θâ ) ⼠â cos ( Ď ) , (8) where cosâĄ(Ď)italic-Ď (Ď)cos ( Ď ) denotes the angle between the two gradient vectors. Then, the following conclusions can be drawn: ⢠Conclusion 1: impact can be positive or negative. The impact of unlearning a sample on PA performance can be either positive or negative, depending on the gradient direction relationship (i.e., the sign of cosâĄ(Ď)italic-Ď (Ď)cos ( Ď )), which is partially influenced by the reward of the unlearned sampleâs combination. A sample xitalic_x can be represented as multiple combinations, i.e., =<t,xtt=1nsuperscriptsubscriptsubscriptabsentsubscript1 x=\ x_<t,x_t\_t=1^nitalic_x = italic_x< t , xitalic_t t = 1n. For low-reward combinations, where generated behavior often deviates significantly from human preferences, the unlearning objective gradient direction (i.e., the direction increasing the sampleâs generation probability) is more likely to oppose the PA objective gradient direction. This results in cosâĄ(Ď)<0italic-Ď0 (Ď)<0cos ( Ď ) < 0 and Îâ˘(ââ˘())>0Îsuperscript0 ( θ^*( Ď))>0Î J ( italic_θâ ( italic_Ď ) ) > 0. Further analysis indicates that if the rewards for most combinations <t,xtsubscriptabsentsubscript\ x_<t,x_t\ italic_x< t , xitalic_t in a sample xitalic_x are low, unlearning the sample tends to improve preference alignment. Conversely, if only a few combinations have low rewards, unlearning the sample will likely hinder PA. ⢠Conclusion 2: magnitude of impact varies. The effect of unlearning on PA performance varies across samples and is influenced by the unlearning degree and gradient norm. The gradient norm is an inherent property of the sample, such as the modelâs degree of fit to the sample. For samples that the model fits well, the gradient norm tends to be smaller. On the other hand, the unlearning weight is a controllable factor that can be adjusted by tuning parameters such as the unlearning weight. 4.2 A Weighted MU Framework for PA The above conclusions indicate that, given a set =ii=1nsuperscriptsubscriptsuperscript1D=\ x^i\_i=1^nD = italic_xitalic_i i = 1n containing nnn negative samples, simply performing the unlearning operation directly according to Eq. (5) does not guarantee optimal PA results. This is primarily due to the following two issues: ⢠Issue 1. Conclusion 1 suggests that for a given negative sample isuperscript x^iitalic_xitalic_i, which contains some low-reward combinations, this alone does not imply that unlearning isuperscript x^iitalic_xitalic_i will necessarily promote PA. The effectiveness of unlearning also depends on the proportion of low-reward components within the sample. This indicates that not all negative samples need to be unlearned. ⢠Issue 2. Conclusion 2 indicates that even if different negative samples (e.g., isuperscript x^iitalic_xitalic_i and jsuperscript x^jitalic_xitalic_j) can both promote PA, the degree of promotion may vary. This difference can be controlled by adjusting the unlearning weight Ďitalic_Ď. Problem setup. To address these two issues, we propose a framework called Unlearning to Align (U2A) based on a sample-weighting approach. This framework achieves the maximization of PA performance by assigning higher weights to samples that contribute more significantly to performance improvement during the unlearning process. Specifically, when the weight Ďitalic_Ď is set to 0, it indicates that the corresponding sample is not selected for unlearning. For ease of analysis and discussion, we assume that the weight vector =[1,2,âŚ,n]subscript1subscript2âŚsubscript Ď=[ Ď_1, Ď_2,âŚ,% Ď_n]italic_Ď = [ italic_Ď1 , italic_Ď2 , ⌠, italic_Ďitalic_n ] lies on an nnn-dimensional simplex, and we denote the unlearning loss of each sample isuperscript x^iitalic_xitalic_i as âiâ˘()subscriptâ _i( θ)âitalic_i ( italic_θ ). The U2A framework can be formalized as solving the following optimization problem: minâÎnââ˘(ââ˘())+βâ˘Lpâ˘()subscriptsubscriptÎsuperscriptsubscriptL _ Ďâ _n -J(% θ^*( Ď))+ _p( % Ď)minbold_italic_Ď â Î start_POSTSUBSCRIPT n end_POSTSUBSCRIPT - J ( italic_θâ ( italic_Ď ) ) + β Litalic_p ( italic_Ď ) s.t.ââ˘()=argâ˘minâ˘âi=1niâ˘âiâ˘()+Îťâ˘âregâ˘(),s.t.superscriptsubscriptargminsuperscriptsubscript1subscriptsubscriptâsubscriptâreg .t. θ^*( Ď)=% *arg\,min_ θ _i=1^n % Ď_i _i( θ)+ _reg(% θ),s.t. italic_θâ ( italic_Ď ) = start_OPERATOR arg min end_OPERATORitalic_θ âi = 1n italic_Ďitalic_i âitalic_i ( italic_θ ) + Îť Lroman_reg ( italic_θ ) , (9) where Lpâ˘()subscriptLL_p( Ď)Litalic_p ( italic_Ď ) represents an introduced LpsubscriptLL_pLitalic_p-norm sparsity-inducing regularization term to ensure that the number of selected samples for unlearning is as small as possible, and β denotes the weight coefficient of the regularization term. Further analysis shows that when p=11p=1p = 1, the sparsity regularization has relatively weak compressive effects on small values. On the other hand, when p=00p=0p = 0, it can effectively control the sparsity of weights (i.e., the number of non-zero weights). However, in this case, the regularization term Lqâ˘()subscriptLL_q( Ď)Litalic_q ( italic_Ď ) becomes a non-continuous and non-convex function, which significantly increases the difficulty of optimization. Considering these factors, when p=1212p= 12p = divide start_ARG 1 end_ARG start_ARG 2 end_ARG, the regularization term Lpâ˘()subscriptLL_p( Ď)Litalic_p ( italic_Ď ) is both a strictly convex function and exhibits good smoothness. Therefore, in this paper, we set p=1212p= 12p = divide start_ARG 1 end_ARG start_ARG 2 end_ARG, making Lpâ˘()=âi=1nisubscriptLsuperscriptsubscript1subscriptL_p( Ď)= _i=1^n Ď_% iLitalic_p ( italic_Ď ) = âi = 1n square-root start_ARG italic_Ďitalic_i end_ARG. Solving Eq. (9) yields the selected unlearning set SS as well as the unlearning weight Ďitalic_Ď for each sample. U2A framework. To enhance clarity, we denote the outer objective function as gâ˘()g( Ď)g ( italic_Ď ) and the inner objective function as fâ˘(,)f( θ, Ď)f ( italic_θ , italic_Ď ). If fâ˘(,)f( θ, Ď)f ( italic_θ , italic_Ď ) is twice differentiable w.r.t. θ, the constraint ââ˘()=argâĄminâĄfâ˘(,)superscriptsubscript θ^*( Ď)= _ θf(% θ, Ď)italic_θâ ( italic_Ď ) = arg minbold_italic_θ f ( italic_θ , italic_Ď ) can be relaxed into âfâ˘(,)â|=ââ˘()=0evaluated-atsuperscript0 â f( θ, Ď)â % θ|_ θ= θ^*( Ď)=0divide start_ARG â f ( italic_θ , italic_Ď ) end_ARG start_ARG â italic_θ end_ARG |italic_θ = italic_θâ ( italic_Ď ) = 0. When fâ˘(,)f( θ, Ď)f ( italic_θ , italic_Ď ) is strictly convex w.r.t. θitalic_θ, this relaxation becomes tight (Borsos et al., 2024). Assumption 4.1 ensures this property, enabling the use of first-order optimization methods (Pedregosa, 2016; Finn et al., 2017; Liu et al., 2019) to solve Eq. (6) and avoiding computationally expensive naive greedy algorithms. Considering the computation efficiency, we adopt a variant of the cone-constrained generalized matching pursuit algorithm (Locatello et al., 2017), which performs incremental optimization. This approach iteratively constructs the unlearning set SS, thereby significantly reducing computational complexity. Algorithm 1 U2A Algorithm 1: Input: Dataset =ii=1nsuperscriptsubscriptsuperscript1D=\ x^i\_i=1^nD = italic_xitalic_i i = 1n, initial model parameter âsuperscript θ^*italic_θâ, maximum number of iterations T, early stopping threshold δ, regularization coefficient Îť and β. 2: Output: unlearning set finalsuperscriptfinalS^finalSroman_final and weights final,âsuperscriptfinal Ď^final,*italic_Ďroman_final , â. 3: Initialization: Initialize weights 1,â=[0,âŚ,0]superscript10âŚ0 Ď^1,*=[0,âŚ,0]italic_Ď1 , â = [ 0 , ⌠, 0 ], randomly select one point to initialize the unlearning set 1=isuperscript1S^1=\i\S1 = i , and set i1,â=1subscriptsuperscript11 Ď^1,*_i=1italic_Ď1 , âi = 1. 4: for t=22t=2t = 2 to T do 5: Gradient descent to solve the inner problem of Eq. (9) to obtain ââ˘(tâ1,â)superscriptsuperscript1 θ^*( Ď^t-1,*)italic_θâ ( italic_Ďitalic_t - 1 , â ). 6: Fix current model parameter ââ˘(tâ1,â)superscriptsuperscript1 θ^*( Ď^t-1,*)italic_θâ ( italic_Ďitalic_t - 1 , â ), and optimize the weights t,âsuperscript Ď^t,*italic_Ďitalic_t , â according to Eq. (10). 7: Select point kâsuperscriptk^*kâ with the maximum Îâ˘gâ˘(k)Î g(k)Î g ( k ) using Eq. (12). 8: Update the unlearning set t=tâ1âŞkâsuperscriptsuperscript1superscriptS^t=S^t-1âŞ\k^*\Sitalic_t = Sitalic_t - 1 ⪠kâ and set kt,â=1subscriptsuperscript1 Ď^t,*_k=1italic_Ďitalic_t , âk = 1. 9: if gâ˘(tâ1,â)âgâ˘(t,â)â¤Î´superscript1superscriptg( Ď^t-1,*)-g( Ď^t,*)⤠( italic_Ďitalic_t - 1 , â ) - g ( italic_Ďitalic_t , â ) ⤠δ then 10: Break. 11: end if 12: end for 13: Re-optimize the weights final,âsuperscriptfinal Ď^final,*italic_Ďroman_final , â on the final unlearning set finalsuperscriptfinalS^finalSroman_final. Specifically, in each iteration, we first solve the inner optimization problem using the gradient descent method to obtain the model parameters ââ˘()superscript θ^*( Ď)italic_θâ ( italic_Ď ) with optimal unlearning performance. Subsequently, we fix the model parameters to solve the outer optimization problem to obtain the solution t,âsuperscript Ď^t,*italic_Ďitalic_t , â, which can be formalized as: t,â=argâ˘minâÎng()s.t.supp()=tâ1, Ď^t,*= *arg\,min_ Ďâ% _ng( Ď) .t. (% Ď)=S_t-1,italic_Ďitalic_t , â = start_OPERATOR arg min end_OPERATORitalic_Ď â Î start_POSTSUBSCRIPT n end_POSTSUBSCRIPT g ( italic_Ď ) s . t . supp ( italic_Ď ) = Sitalic_t - 1 , (10) where the constraint is imposed to restrict the support set of the weight vector Ďitalic_Ď to be identical to the current unlearning set tâ1subscript1S_t-1Sitalic_t - 1. In other words, the non-zero components of Ďitalic_Ď are confined to elements within the current unlearning set, thereby preventing the introduction of new sample points. It is important to note that the support set suppâ˘()=iâŁiâ 0suppconditional-setsubscript0supp( Ď)=\i Ď_iâ 0\supp ( italic_Ď ) = i ⣠italic_Ďitalic_i â 0 represents the index set of the non-zero elements in Ďitalic_Ď. This can be solved by using the projected gradient descent method. According to the implicit function theorem, the gradient of gâ˘()g( Ď)g ( italic_Ď ) w.r.t. Ďitalic_Ď can be expressed as: âgâ˘()=ââ˘(ââ˘())â˘(â2fâ2)â1â˘âi=1nââiâ˘(ââ˘())+β2â˘â12,subscriptâsubscriptâsuperscriptsuperscriptsuperscript2superscript21superscriptsubscript1subscriptâsubscriptâsuperscript2superscript12 _ Ďg( Ď)= _ % θJ( θ^*( Ď)) ( % â^2fâ θ^2 )^-1 _i=1^n% _ θ _i( θ^*( % Ď))+ β2 Ď^- 12,âitalic_Ď g ( italic_Ď ) = âitalic_θ J ( italic_θâ ( italic_Ď ) ) ( divide start_ARG â2 f end_ARG start_ARG â italic_θ2 end_ARG )- 1 âi = 1n âitalic_θ âitalic_i ( italic_θâ ( italic_Ď ) ) + divide start_ARG β end_ARG start_ARG 2 end_ARG italic_Ď- divide start_ARG 1 end_ARG start_ARG 2 end_ARG , (11) where â2fâ2=âi=1niâ˘â2âiâ˘(ââ˘())+2â˘Îťâ˘Isuperscript2superscript2superscriptsubscript1subscriptsuperscriptsubscriptâ2subscriptâsuperscript2 â^2fâ θ^2= _i=1^n% Ď_i _ θ^2 _i( % θ^*( Ď))+2Îť Idivide start_ARG â2 f end_ARG start_ARG â italic_θ2 end_ARG = âi = 1n italic_Ďitalic_i âitalic_θ2 âitalic_i ( italic_θâ ( italic_Ď ) ) + 2 Îť I, denoting the Hessian matrix of the inner optimization problem (details are provided in Appendix B.2). Given that explicitly computing the inverse of the Hessian matrix is computationally prohibitive in LLM applications, directly solving the problem is impractical. Therefore, we adopt the conjugate gradient method (Nocedal & Wright, 2006), which iteratively computes the product of the Hessian matrix and gradient vector, thereby reducing the computational complexity. After completing the outer optimization, we identify a new sample point k to add to the unlearning set based on the marginal gain of the outer objective function gâ˘()g( Ď)g ( italic_Ď ), with the goal of maximizing the marginal gain. The marginal gain is calculated as Îâ˘gâ˘(k)=âgâ˘()kÎsubscript g(k)= â g( Ď) Ď_kÎ g ( k ) = divide start_ARG â g ( italic_Ď ) end_ARG start_ARG italic_Ďitalic_k end_ARG. According to Eq. (11), its expression can be derived as follows: Îâ˘gâ˘(k)=ââ˘(ââ˘())â˘(â2fâ2)â1â˘ââkâ˘(ââ˘())+β2â˘kâ12.Îsubscriptâsuperscriptsuperscriptsuperscript2superscript21subscriptâsubscriptâsuperscript2superscriptsubscript12 g(k)= _ θJ( θ^*(% Ď)) ( â^2fâ θ^2% )^-1 _ θ _k( θ^*(% Ď))+ β2 Ď_k^- 12.Î g ( k ) = âitalic_θ J ( italic_θâ ( italic_Ď ) ) ( divide start_ARG â2 f end_ARG start_ARG â italic_θ2 end_ARG )- 1 âitalic_θ âitalic_k ( italic_θâ ( italic_Ď ) ) + divide start_ARG β end_ARG start_ARG 2 end_ARG italic_Ďitalic_k- divide start_ARG 1 end_ARG start_ARG 2 end_ARG . (12) After computing the marginal gain, we select the sample point with the maximum gain kâ=argâ˘maxkâ[1,n]âĄÎâ˘gâ˘(k)superscriptsubscriptargmax1Îk^*= *arg\,max_kâ[1,n] g(k)kâ = start_OPERATOR arg max end_OPERATORk â [ 1 , n ] Î g ( k ), add it to the unlearning set tâ1subscript1S_t-1Sitalic_t - 1. The detailed implementation of the algorithm is provided in Algorithm 1. Convergence analysis. Lemma 4.3 indicates that as the number of iterations t increases, the solution obtained by our U2A algorithm gradually approaches the optimal solution, and the error decreases at â˘(1/t)1O(1/t)O ( 1 / t ). Theorem 4.4 demonstrates that as the size of the unlearning set m increases, the approximation error gradually diminishes. This implies that it is unnecessary to unlearn all negative examples, selecting a subset is sufficient to make the value of the objective function very close to the optimal value of the original problem. Lemma 4.3. Suboptimality Bound (cf. Theorem 2 of Locatello et al. (2017)). Assume gâ˘()g( Ď)g ( italic_Ď ) is L-smooth, and let the initial suboptimality be denoted as Îľ1=gâ˘(1,â)âgâ˘(â)subscriptÎľ1gsuperscript1gsuperscript _1=g( Ď^1,*)-g( Ď^*)Îľ1 = g ( italic_Ď1 , â ) - g ( italic_Ďâ ). After t iterations, the suboptimality bound of the U2A algorithm can be expressed as: gâ˘(t,â)âgâ˘(â)â¤8â˘L+4â˘Îľ1t+3,superscriptsuperscript84subscript13g( Ď^t,*)-g( Ď^*)⤠8L+4% _1t+3,g ( italic_Ďitalic_t , â ) - g ( italic_Ďâ ) ⤠divide start_ARG 8 L + 4 Îľ1 end_ARG start_ARG t + 3 end_ARG , where gâ˘(â)superscriptg( Ď^*)g ( italic_Ďâ ) represents the global optimal value. In the case of a non-convex objective function, gâ˘(â)superscriptg( Ď^*)g ( italic_Ďâ ) is approximated as a certain local optimal value. Theorem 4.4. Size of Unlearning Set. Under the condition that the suboptimality error does not exceed Îľ Îľ, the size m of the final unlearning set satisfies: mââ˘((L+Îľ1)â˘Îľâ1).subscript1superscript1m ((L+ _1) ^-1).m â O ( ( L + Îľ1 ) Îľ- 1 ) . That is, the size of the final unlearning set is proportional to the smoothness of the objective function and the initial suboptimality Îľ1subscript1 _1Îľ1, while being inversely proportional to the target precision Îľ Îľ. Proof. The proof can be found in Appendix B.3. â Complexity analysis. The inner optimization problem must be solved in each iteration to determine the optimal model parameter. Assuming tfsubscriptt_ftitalic_f gradient descent iterations are required, with each iteration computing gradients for all data points, and the gradient computation complexity for a single data point is c, the total complexity of the inner optimization is â˘(tfâ nâ c)â subscriptO(t_f¡ n¡ c)O ( titalic_f â n â c ). For the outer problem, given an unlearning set tsuperscriptS^tSitalic_t with t samples, and tsubscriptt_ Ďtbold_italic_Ď updates required per optimization, the complexity of solving t,âsuperscript Ď^t,*italic_Ďitalic_t , â is â˘(tâ tâ d)â subscriptO(t¡ t_ Ď¡ d)O ( t â tbold_italic_Ď â d ), where d is the model parameter dimension. Marginal gain computation involves implicit gradient calculations. Using the conjugate gradient method with tgsubscriptt_gtitalic_g iterations, where each iteration requires a Hessian-vector product computation of complexity â˘(tgâ nâ c)â subscriptO(t_g¡ n¡ c)O ( titalic_g â n â c ), and computing the gradients of all data points w.r.t. θitalic_θ contributes an additional complexity of â˘(nâ c)â O(n¡ c)O ( n â c ). Thus, the total complexity for marginal gain computation is â˘((tg+1)â nâ c)â subscript1O((t_g+1)¡ n¡ c)O ( ( titalic_g + 1 ) â n â c ). Finally, if the final unlearning set contains m samples, the overall algorithm complexity can be expressed as: â˘(mâ ((tf+tg+1)â nâ c+nâ d+mâ tâ d)).â subscriptsubscript1â subscriptO(m¡((t_f+t_g+1)¡n¡ c+n¡ d+m¡ t_% Ď¡ d)).O ( m â ( ( titalic_f + titalic_g + 1 ) â n â c + n â d + m â tbold_italic_Ď â d ) ) . This demonstrates that our U2A algorithm is computationally efficient and well-suited for high-dimensional applications, such as LLMs. 5 Experiment 5.1 Experiment Setups Datasets. In our experiments, we evaluate across three mainstream PA tasks and datasets: (i) reducing harmfulness PKU SafeRLHF (Dai et al., 2023), (i) enhancing usefulness UltraFeedback (Cui et al., 2023; Tunstall et al., 2023), (i) eliminating hallucinations HaluEval (Li et al., 2023). For each dataset, we randomly sample 80% of the examples to construct the fine-tuning set FINsubscriptFIND_FINDroman_FIN, while the remaining examples PAsubscriptPAD_PADroman_PA are reserved for evaluating the modelâs PA performance post-unlearning. From FINsubscriptFIND_FINDroman_FIN, we further extract 12.5% negative samples to construct a subset SELsubscriptSELD_SELDroman_SEL, representing selectively forgettable negative examples. Details of this partitioning are provided in Appendix C.1. Base and preference reward models. Following the configurations in prior study (Jia et al., 2024a; Zhou et al., 2024), we select the widely used Llama-2-7B-Chat (Touvron et al., 2023) and Llama-3.1-8B-Instruct (Dubey et al., 2024) as base models for each dataset. The base models are first fine-tuned on FINsubscriptFIND_FINDroman_FIN to obtain the original models requiring unlearning. Additionally, we fine-tune the base models on FINsubscriptFIND_FINDroman_FIN excluding the negative samples SELsubscriptSELD_SELDroman_SEL. For PA evaluation, we employ the Beaver-7B-v3.0-Reward model (Dai et al., 2023; Ji et al., 2024a). Evaluation metrics. We evaluate our proposed method along two dimensions: PA performance and unlearning performance. For PA performance, in the PKU SafeRLHF dataset, we utilize two metrics, Reward-value (Chakraborty et al., 2024; Yao et al., 2024) and ASR (Xu et al., 2024), where ASR can be further divided into four dimensions: ASR-keyword, ASR-answer, ASR-useful, and ASR-summary. In the UltraFeedback Binarized dataset, we evaluate PA performance using Win-rate (Xiao et al., 2024; Rafailov et al., 2024) and Coherence (Chakraborty et al., 2024; Khanov et al., 2024; Kong et al., 2024), where the Win-rate includes Length-control Win Rate and Win Rate vs. GPT-4. In the HaluEval dataset, Hallucination-rate (Yao et al., 2024) is adopted as the evaluation metric, including F1, Precision and Recall. For unlearning performance, we evaluate unlearning effectiveness and model utility. Unlearning effectiveness for PKU SafeRLHF, UltraFeedback and HaluEval is measured using Membership Inference Attack (MIA) (Jia et al., 2024a). Model utility is evaluated with Perplexity (PPL) (Yao et al., 2024; Doshi & Stickland, 2024). Details are provided in Appendix C.2. Baselines. We evaluate our proposed method U2A against widely acknowledged baselines, including unlearning methods (i.e., Retrain, GA (Maini et al., 2024), GradDiff (Liu et al., 2022; Yao et al., 2024), and NPO (Zhang et al., 2024)), as well as PA methods (i.e., PPO (Schulman et al., 2017) and DPO (Rafailov et al., 2024)). The effectiveness of our method is validated by comparing the U2A-improved unlearning baseline with the original baseline and existing PA baselines. Training setup. We use the AdamW (Loshchilov, 2017) optimizer with a learning rate of 4â˘eâ6464e-64 e - 6 for training, and a learning rate of 3â˘eâ2323e-23 e - 2 for updating the unlearning weights. Both optimizers utilize a cosine annealing scheduler for learning rate scheduling. The hyperparameters of baselines are kept as reported in their original papers. For our method, the regularization coefficient is set to Îť=1.01.0Îť=1.0Îť = 1.0, the scaling coefficient to β=0.50.5β=0.5β = 0.5, the early stopping threshold δ to 0.01, and the maximum iterations to 100. All experiments were conducted on NVIDIA A800 GPUs. For the PKU SafeRLHF dataset and the HaluEval dataset, the number of iterations was set to 50, with the number of update epochs set to 5. For the UltraFeedback Binarized dataset, the number of iterations was set to 25, with the number of update epochs set to 10. 5.2 Experiment Results (a) PKU SafeRLHF (b) UltraFeedback (c) HaluEval Figure 1: Effect of unlearning individual data samples on PA performance of Llama-2-7B-Chat model. Each point represents PA performance change after unlearning a specific data sample. The angle of each point follows a uniform distribution, while the radial distance indicates the magnitude of PA performance change. Red points represent negative effects (i.e., unlearning this sample led to worse PA), whereas blue points represent positive effects (i.e., unlearning this sample improved PA). Note that larger distances from the origin correspond to stronger impacts on PA performance. (a) PKU SafeRLHF (b) UltraFeedback (c) HaluEval Figure 2: Analysis of how unlearning data samples affects PA performance. Each point represents the change in PA performance (Î ÎPA) after unlearning a group of samples. The x-axis denotes the proportion of low-reward tokens in the unlearned sample groups, and the y-axis represents the corresponding change in PA performance. Points are colored based on Î ÎPA: blue indicates a positive change, while red indicates a negative change. The shapes further differentiate the groups: squares represent sample groups with a low proportion of low-reward tokens (i.e., high-reward samples), whereas circles represent sample groups with a high proportion of low-reward tokens (i.e., low-reward samples). Unlearning affects PA. We assess the impact of unlearning individual samples on PA performance using the Llama-2-7B-Chat model across three datasets. Given the nearly negligible effect of unlearning a single sample on model parameters, we randomly select 150 groups, each with 32 negative samples, from a pool of eligible negative samples. PA performance changes after unlearning each group are compared, with parameter Ďitalic_Ď set to 1. Figure 1 show that unlearning can have both positive and negative effects, suggesting that removing negative samples does not consistently improve PA performance. Additionally, the degree of improvement varies significantly across different samples. To better understand this, we decompose reward values for each token. Tokens with reward values below the average reward across all tokens are classified as âlow-rewardâ, while those above the average are categorized as âhigh-rewardâ. The average reward values for each dataset are as follows: -1.7463 for PKU SafeRLHF, 0.9001 for UltraFeedback, and -0.7839 for HaluEval. To distinguish the impact of different sample groups, we apply a threshold on the proportion of low-reward tokens. Specifically, samples with a low-reward token proportion below the threshold (0.60 for PKU SafeRLHF, 0.575 for UltraFeedback, and 0.575 for HaluEval) are marked in red, while those exceeding the threshold are marked in blue. Figure 2 illustrates the impact of unlearning these samples on PA performance. Taking the PKU SafeRLHF dataset as an example, when the proportion of low-reward tokens in the unlearned dataset exceeds the threshold (dashed vertical line at 0.6), most changes value of PA performance are positive, indicating an improvement in PA. Conversely, when the proportion of low-reward tokens is below the threshold, most changes value of PA performance are negative, suggesting that unlearning such samples tends to degrade PA performance. Overall, red samples, with more dispersed rewards and fewer low-reward tokens, tend to hinder PA performance improvement when unlearned. In contrast, unlearning blue samples, characterized by a higher proportion of low-reward tokens, significantly boost PA performance. These findings align with our theoretical analysis in Section 4.1. Effectiveness of U2A. To validate the effectiveness of our proposed U2A framework, we conduct experiments using the Llama-2-7B-Chat and Llama-3.1-8B-Instruct models on three datasets. We first apply existing unlearning baseline methods to all eligible negative samples. Next, we integrate the U2A framework with these baselines using a sample-weighted unlearning approach. Finally, we employ existing PA baselines to perform direct PA on subsets of the alignment datasets PAsubscriptPAD_PADroman_PA. We report the comparison of PA and unlearning performance across different methods in Table 1. The results show that improving unlearning baselines with the U2A framework yields significant PA performance improvements, while maintaining comparable unlearning performance. Additionally, the improved unlearning methods outperform PA baselines in PA performance to a certain extent. These results highlight the potential of leveraging unlearning mechanisms to enhance alignment, further validating the effectiveness of our proposed method. Results for other tasks are reported in Appendix D. Table 1: Comparison of the U2A framework with the current PA and unlearning baseline methods on the PKU SafeRLHF dataset. For the same baseline before and after improvement, consistent experimental settings are ensured. Optimal results are highlighted in bold. Models Methods PA Performance MU Performance Reward-value (â â) ASR-keyword (â â) ASR-answer (â â) ASR-useful (â â) ASR-summary (â â) MIA (â â) PPL (â â) Llama-2-7B-Chat Original -5.84 78.65 54.42 30.19 61.54 0.4892 76.49 Retrain -4.23 73.08 62.69 24.23 59.42 0.4866 104.36 PPO -0.59 74.42 58.65 29.62 52.50 0.4884 103.39 DPO -2.30 72.27 56.15 27.31 52.69 0.4892 76.28 GA -4.58 84.04 56.92 29.23 54.42 0.4862 71.46 GradDiff -4.76 82.35 58.17 25.40 56.95 0.4912 60.11 NPO -5.96 77.69 54.30 30.05 68.82 0.4891 76.50 GA + U2A 1.49 74.13 53.19 21.19 48.74 0.4770 56.31 GradDiff + U2A 2.63 73.46 57.00 24.75 50.20 0.4992 51.28 NPO + U2A -3.65 77.12 52.51 23.65 56.26 0.4892 67.74 Llama-3.1-8B-Instruct Original -3.82 99.23 91.73 13.65 90.19 0.4946 2.01 Retrain -2.11 99.81 90.58 14.04 87.69 0.4963 2.07 PPO -1.07 96.73 83.65 10.19 79.81 0.4881 2.01 DPO -1.33 95.33 79.01 11.77 82.59 0.4919 2.08 GA -2.56 96.17 75.11 11.45 70.33 0.4978 2.03 GradDiff -1.87 85.34 63.55 15.97 52.55 0.5127 2.06 NPO -3.77 98.65 91.57 13.90 90.37 0.3924 2.11 GA + U2A 0.03 92.31 71.35 10.15 62.48 0.5563 2.01 GradDiff + U2A 0.95 83.63 62.28 9.65 49.50 0.5489 1.96 NPO + U2A -0.21 96.68 89.74 11.62 88.56 0.4723 2.05 Efficiency of U2A. We assess the efficiency of the U2A-improved unlearning baseline against existing PA methods on the PKU SafeRLHF dataset using the Llama-2-7B-Chat model. With identical hyperparameters and early stopping conditions (training halts when the PA score surpasses 0.745), we compare the number of update iterations and per-iteration time costs. Table 2 summarizes the results, showing that the U2A-enhanced method significantly reduces update iterations needed to reach the target PA score. Moreover, although it introduces additional computation, leading to an increase in the average per-iteration time, the significant reduction in the number of iterations results in a training time reduction of approximately 90% compared to PA baselines such as PPO and DPO. These findings confirm the U2A frameworkâs efficiency and practicality under resource-limited settings. Table 2: Comparison of the efficiency of different methods. We set an early stopping condition, where PA reaches a fixed value 0.745, and compare the number of epochs (update rounds) and the time costs of different methods. The experimental setups remain consistent before and after the improvement using U2A. Optimal results are highlighted in bold. Methods Update Rounds Time Costs(s) Methods Update Rounds Time Costs(s) Methods Update Rounds Time Costs(s) Retrain 197 241.2498 GA 142 167.1139 GA + U2A 46 248.3760 PPO 282 911.7341 GradDiff 764 995.9192 GradDiff + U2A 19 70.8349 DPO 1353 3619.9515 NPO 751 967.1019 NPO + U2A 29 132.1398 6 Conclusion The mainstream PA approach, RLHF, faces significant challenges in low-resource settings, including (1) reliance on numerous positive preference samples, which are costly to obtain, and (2) instability during training, resulting in high computational and management costs. To address these issues, we propose a MU-based method that reduces dependence on positive samples by mitigating the influence of negative samples to achieve PA. Our method achieves computational efficiency comparable to standard fine-tuning while showing strong potential. We first develop a bi-level optimization framework to evaluate the impact of unlearning individual samples on PA performance. Through this analysis, we observe that negative samples contribute unevenly to PA, with many offering limited benefits. This observation leads to a key question: how can we selectively weight and unlearn negative samples to optimize alignment? To this end, we formally define the problem and introduce U2A, a framework leveraging bi-level optimization to efficiently select and weighted unlearn samples for improved alignment. Experiments demonstrate that U2A significantly enhances alignment efficiency and effectiveness, underscoring its value in resource-constrained scenarios. By linking PA with MU, this work provides a novel perspective on PA for LLMs and suggests new directions for optimizing PA algorithms. References Azar et al. (2024) Azar, M. G., Guo, Z. D., Piot, B., Munos, R., Rowland, M., Valko, M., and Calandriello, D. A general theoretical paradigm to understand learning from human preferences. In International Conference on Artificial Intelligence and Statistics, p. 4447â4455. PMLR, 2024. Bai et al. (2022) Bai, Y., Jones, A., Ndousse, K., Askell, A., Chen, A., DasSarma, N., Drain, D., Fort, S., Ganguli, D., Henighan, T., et al. Training a helpful and harmless assistant with reinforcement learning from human feedback. arXiv preprint arXiv:2204.05862, 2022. Beirami et al. (2024) Beirami, A., Agarwal, A., Berant, J., DâAmour, A., Eisenstein, J., Nagpal, C., and Suresh, A. T. Theoretical guarantees on the best-of-n alignment policy. arXiv preprint arXiv:2401.01879, 2024. Borsos et al. (2024) Borsos, Z., Mutnáťł, M., Tagliasacchi, M., and Krause, A. Data summarization via bilevel optimization. Journal of Machine Learning Research, 25(73):1â53, 2024. Bradley & Terry (1952) Bradley, R. A. and Terry, M. E. Rank analysis of incomplete block designs: I. the method of paired comparisons. Biometrika, 39(3/4):324â345, 1952. Casper et al. (2023) Casper, S., Davies, X., Shi, C., Gilbert, T. K., Scheurer, J., Rando, J., Freedman, R., Korbak, T., Lindner, D., Freire, P., et al. Open problems and fundamental limitations of reinforcement learning from human feedback. arXiv preprint arXiv:2307.15217, 2023. Chakraborty et al. (2024) Chakraborty, S., Ghosal, S. S., Yin, M., Manocha, D., Wang, M., Bedi, A. S., and Huang, F. Transfer q star: Principled decoding for llm alignment. arXiv preprint arXiv:2405.20495, 2024. Christiano et al. (2017) Christiano, P. F., Leike, J., Brown, T., Martic, M., Legg, S., and Amodei, D. Deep reinforcement learning from human preferences. Advances in neural information processing systems, 30, 2017. Cui et al. (2023) Cui, G., Yuan, L., Ding, N., Yao, G., Zhu, W., Ni, Y., Xie, G., Liu, Z., and Sun, M. Ultrafeedback: Boosting language models with high-quality feedback. 2023. Dai et al. (2023) Dai, J., Pan, X., Sun, R., Ji, J., Xu, X., Liu, M., Wang, Y., and Yang, Y. Safe rlhf: Safe reinforcement learning from human feedback. arXiv preprint arXiv:2310.12773, 2023. Dige et al. (2024) Dige, O., Arneja, D., Yau, T. F., Zhang, Q., Bolandraftar, M., Zhu, X., and Khattak, F. Can machine unlearning reduce social bias in language models? In Proceedings of the 2024 Conference on Empirical Methods in Natural Language Processing: Industry Track, p. 954â969, 2024. Doshi & Stickland (2024) Doshi, J. and Stickland, A. C. Does unlearning truly unlearn? a black box evaluation of llm unlearning methods. arXiv preprint arXiv:2411.12103, 2024. Dubey et al. (2024) Dubey, A., Jauhri, A., Pandey, A., Kadian, A., Al-Dahle, A., Letman, A., Mathur, A., Schelten, A., Yang, A., Fan, A., et al. The llama 3 herd of models. arXiv preprint arXiv:2407.21783, 2024. Fan et al. (2024) Fan, C., Liu, J., Lin, L., Jia, J., Zhang, R., Mei, S., and Liu, S. Simplicity prevails: Rethinking negative preference optimization for llm unlearning. arXiv preprint arXiv:2410.07163, 2024. Feng et al. (2024) Feng, X., Chen, C., Li, Y., and Lin, Z. Fine-grained pluggable gradient ascent for knowledge unlearning in language models. In Proceedings of the 2024 Conference on Empirical Methods in Natural Language Processing, p. 10141â10155, 2024. Finn et al. (2017) Finn, C., Abbeel, P., and Levine, S. Model-agnostic meta-learning for fast adaptation of deep networks. In International conference on machine learning, p. 1126â1135. PMLR, 2017. Gao et al. (2023) Gao, L., Schulman, J., and Hilton, J. Scaling laws for reward model overoptimization. In International Conference on Machine Learning, p. 10835â10866. PMLR, 2023. Huang et al. (2024) Huang, J. Y., Sengupta, S., Bonadiman, D., Lai, Y.-a., Gupta, A., Pappas, N., Mansour, S., Kirchhoff, K., and Roth, D. Deal: Decoding-time alignment for large language models. arXiv preprint arXiv:2402.06147, 2024. Jang et al. (2023) Jang, J., Yoon, D., Yang, S., Cha, S., Lee, M., Logeswaran, L., and Seo, M. Knowledge unlearning for mitigating privacy risks in language models. In Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), p. 14389â14408, 2023. Ji et al. (2024a) Ji, J., Liu, M., Dai, J., Pan, X., Zhang, C., Bian, C., Chen, B., Sun, R., Wang, Y., and Yang, Y. Beavertails: Towards improved safety alignment of llm via a human-preference dataset. Advances in Neural Information Processing Systems, 36, 2024a. Ji et al. (2024b) Ji, J., Liu, Y., Zhang, Y., Liu, G., Kompella, R. R., Liu, S., and Chang, S. Reversing the forget-retain objectives: An efficient llm unlearning framework from logit difference. In Annual Conference on Neural Information Processing Systems, 2024b. Jia et al. (2024a) Jia, J., Liu, J., Zhang, Y., Ram, P., Baracaldo, N., and Liu, S. Wagle: Strategic weight attribution for effective and modular unlearning in large language models. arXiv preprint arXiv:2410.17509, 2024a. Jia et al. (2024b) Jia, J., Liu, J., Zhang, Y., Ram, P., Baracaldo, N., and Liu, S. Wagle: Strategic weight attribution for effective and modular unlearning in large language models. In The Thirty-eighth Annual Conference on Neural Information Processing Systems, 2024b. Khanov et al. (2024) Khanov, M., Burapacheep, J., and Li, Y. Args: Alignment as reward-guided search. arXiv preprint arXiv:2402.01694, 2024. Kim et al. (2023) Kim, M., Lee, H., Yoo, K. M., Park, J., Lee, H., and Jung, K. Critic-guided decoding for controlled text generation. In Findings of the Association for Computational Linguistics: ACL 2023, p. 4598â4612, 2023. Kong et al. (2024) Kong, L., Wang, H., Mu, W., Du, Y., Zhuang, Y., Zhou, Y., Song, Y., Zhang, R., Wang, K., and Zhang, C. Aligning large language models with representation editing: A control perspective. arXiv preprint arXiv:2406.05954, 2024. Korbak et al. (2023) Korbak, T., Shi, K., Chen, A., Bhalerao, R. V., Buckley, C., Phang, J., Bowman, S. R., and Perez, E. Pretraining language models with human preferences. In International Conference on Machine Learning, p. 17506â17533. PMLR, 2023. Langley (2000) Langley, P. Crafting papers on machine learning. In Langley, P. (ed.), Proceedings of the 17th International Conference on Machine Learning (ICML 2000), p. 1207â1216, Stanford, CA, 2000. Morgan Kaufmann. Li et al. (2023) Li, J., Cheng, X., Zhao, W. X., Nie, J.-Y., and Wen, J.-R. Halueval: A large-scale hallucination evaluation benchmark for large language models. arXiv preprint arXiv:2305.11747, 2023. Li et al. (2024) Li, N., Pan, A., Gopal, A., Yue, S., Berrios, D., Gatti, A., Li, J. D., Dombrowski, A.-K., Goel, S., Mukobi, G., et al. The wmdp benchmark: Measuring and reducing malicious use with unlearning. In Forty-first International Conference on Machine Learning, 2024. Liu et al. (2022) Liu, B., Liu, Q., and Stone, P. Continual learning and private unlearning. In Conference on Lifelong Learning Agents, p. 243â254. PMLR, 2022. Liu et al. (2019) Liu, H., Simonyan, K., and Yang, Y. Darts: Differentiable architecture search. In International Conference on Learning Representations, 2019. Liu et al. (2023) Liu, J., Cohen, A., Pasunuru, R., Choi, Y., Hajishirzi, H., and Celikyilmaz, A. Making ppo even better: Value-guided monte-carlo tree search decoding. arXiv preprint arXiv:2309.15028, 2023. Liu et al. (2024a) Liu, S., Yao, Y., Jia, J., Casper, S., Baracaldo, N., Hase, P., Yao, Y., Liu, C. Y., Xu, X., Li, H., et al. Rethinking machine unlearning for large language models. In Annual Conference on Neural Information Processing Systems, 2024a. Liu et al. (2024b) Liu, T., Guo, S., Bianco, L., Calandriello, D., Berthet, Q., Llinares, F., Hoffmann, J., Dixon, L., Valko, M., and Blondel, M. Decoding-time realignment of language models. arXiv preprint arXiv:2402.02992, 2024b. Liu et al. (2024c) Liu, Z., Dou, G., Tan, Z., Tian, Y., and Jiang, M. Towards safer large language models through machine unlearning. arXiv preprint arXiv:2402.10058, 2024c. Locatello et al. (2017) Locatello, F., Tschannen, M., Rätsch, G., and Jaggi, M. Greedy algorithms for cone constrained optimization with convergence guarantees. Advances in Neural Information Processing Systems, 30, 2017. Loshchilov (2017) Loshchilov, I. Decoupled weight decay regularization. arXiv preprint arXiv:1711.05101, 2017. Lu et al. (2022) Lu, X., Welleck, S., Hessel, J., Jiang, L., Qin, L., West, P., Ammanabrolu, P., and Choi, Y. Quark: Controllable text generation with reinforced unlearning. Advances in neural information processing systems, 35:27591â27609, 2022. Maini et al. (2024) Maini, P., Feng, Z., Schwarzschild, A., Lipton, Z. C., and Kolter, J. Z. Tofu: A task of fictitious unlearning for llms. In ICLR 2024 Workshop on Navigating and Addressing Data Problems for Foundation Models, 2024. Mitchell et al. (2024) Mitchell, E., Rafailov, R., Sharma, A., Finn, C., and Manning, C. D. An emulator for fine-tuning large language models using small language models. In The Twelfth International Conference on Learning Representations, 2024. Mudgal et al. (2024) Mudgal, S., Lee, J., Ganapathy, H., Li, Y., Wang, T., Huang, Y., Chen, Z., Cheng, H.-T., Collins, M., Strohman, T., et al. Controlled decoding from language models. In Forty-first International Conference on Machine Learning, 2024. Nocedal & Wright (2006) Nocedal, J. and Wright, S. J. Conjugate gradient methods. Numerical optimization, p. 101â134, 2006. Ouyang et al. (2022) Ouyang, L., Wu, J., Jiang, X., Almeida, D., Wainwright, C., Mishkin, P., Zhang, C., Agarwal, S., Slama, K., Ray, A., et al. Training language models to follow instructions with human feedback. Advances in neural information processing systems, 35:27730â27744, 2022. Pedregosa (2016) Pedregosa, F. Hyperparameter optimization with approximate gradient. In International conference on machine learning, p. 737â746. PMLR, 2016. Rafailov et al. (2024) Rafailov, R., Sharma, A., Mitchell, E., Manning, C. D., Ermon, S., and Finn, C. Direct preference optimization: Your language model is secretly a reward model. Advances in Neural Information Processing Systems, 36, 2024. Schulman et al. (2017) Schulman, J., Wolski, F., Dhariwal, P., Radford, A., and Klimov, O. Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347, 2017. Shi et al. (2023) Shi, W., Ajith, A., Xia, M., Huang, Y., Liu, D., Blevins, T., Chen, D., and Zettlemoyer, L. Detecting pretraining data from large language models. arXiv preprint arXiv:2310.16789, 2023. Stiennon et al. (2020) Stiennon, N., Ouyang, L., Wu, J., Ziegler, D., Lowe, R., Voss, C., Radford, A., Amodei, D., and Christiano, P. F. Learning to summarize with human feedback. Advances in Neural Information Processing Systems, 33:3008â3021, 2020. Su et al. (2022) Su, Y., Lan, T., Wang, Y., Yogatama, D., Kong, L., and Collier, N. A contrastive framework for neural text generation. Advances in Neural Information Processing Systems, 35:21548â21561, 2022. Tian et al. (2024) Tian, B., Liang, X., Cheng, S., Liu, Q., Wang, M., Sui, D., Chen, X., Chen, H., and Zhang, N. To forget or not? towards practical knowledge unlearning for large language models. In Findings of the Association for Computational Linguistics: EMNLP 2024, p. 1524â1537, 2024. Touvron et al. (2023) Touvron, H., Martin, L., Stone, K., Albert, P., Almahairi, A., Babaei, Y., Bashlykov, N., Batra, S., Bhargava, P., Bhosale, S., et al. Llama 2: Open foundation and fine-tuned chat models. arXiv preprint arXiv:2307.09288, 2023. Tunstall et al. (2023) Tunstall, L., Beeching, E., Lambert, N., Rajani, N., Rasul, K., Belkada, Y., Huang, S., von Werra, L., Fourrier, C., Habib, N., et al. Zephyr: Direct distillation of lm alignment. arXiv preprint arXiv:2310.16944, 2023. Wan et al. (2024) Wan, Z., Feng, X., Wen, M., McAleer, S. M., Wen, Y., Zhang, W., and Wang, J. Alphazero-like tree-search can guide large language model decoding and training. In Forty-first International Conference on Machine Learning, 2024. Wang et al. (2023) Wang, L., Chen, T., Yuan, W., Zeng, X., Wong, K.-F., and Yin, H. Kga: A general machine unlearning framework based on knowledge gap alignment. In Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), p. 13264â13276, 2023. Wang et al. (2024) Wang, Y., Wei, J., Liu, C. Y., Pang, J., Liu, Q., Shah, A. P., Bao, Y., Liu, Y., and Wei, W. Llm unlearning via loss adjustment with only forget data. arXiv preprint arXiv:2410.11143, 2024. Wu et al. (2024) Wu, Y., Sun, Z., Yuan, H., Ji, K., Yang, Y., and Gu, Q. Self-play preference optimization for language model alignment. arXiv preprint arXiv:2405.00675, 2024. Xiao et al. (2024) Xiao, T., Yuan, Y., Zhu, H., Li, M., and Honavar, V. G. Cal-dpo: Calibrated direct preference optimization for language model alignment. arXiv preprint arXiv:2412.14516, 2024. Xu et al. (2024) Xu, Z., Huang, R., Chen, C., and Wang, X. Uncovering safety risks of large language models through concept activation vector. In The Thirty-eighth Annual Conference on Neural Information Processing Systems, 2024. Yao et al. (2024) Yao, Y., Xu, X., and Liu, Y. Large language model unlearning. In Annual Conference on Neural Information Processing Systems, 2024. Zhang et al. (2024) Zhang, R., Lin, L., Bai, Y., and Mei, S. Negative preference optimization: From catastrophic collapse to effective unlearning. arXiv preprint arXiv:2404.05868, 2024. Zhou et al. (2024) Zhou, Z., Liu, Z., Liu, J., Dong, Z., Yang, C., and Qiao, Y. Weak-to-strong search: Align large language models via searching over small language models. arXiv preprint arXiv:2405.19262, 2024. Ziegler et al. (2019) Ziegler, D. M., Stiennon, N., Wu, J., Brown, T. B., Radford, A., Amodei, D., Christiano, P., and Irving, G. Fine-tuning language models from human preferences. arXiv preprint arXiv:1909.08593, 2019. Zou et al. (2023) Zou, A., Wang, Z., Carlini, N., Nasr, M., Kolter, J. Z., and Fredrikson, M. Universal and transferable adversarial attacks on aligned language models. arXiv preprint arXiv:2307.15043, 2023. Appendix A Discussion on the Definition of Unlearning in LLMs In this section, we review and summarize the definitions of existing unlearning methods for LLMs and attempt to incorporate these methods into a unified theoretical framework. Assume the training dataset is denoted as t=fâŞrsubscriptsubscriptsubscriptD_t=D_f _rDitalic_t = Ditalic_f ⪠Ditalic_r, where fsubscriptD_fDitalic_f represents the set of samples to be unlearned, and rsubscriptD_rDitalic_r represents the remaining samples. The core objective of LLM unlearning is to remove the knowledge learned from fsubscriptD_fDitalic_f while preserving the modelâs other capabilities as much as possible. To achieve this goal, existing methods can be broadly categorized into two main classes: (i) gradient-based methods and (i) preference optimization-based methods. Gradient-based methods. Gradient-based methods include gradient ascent and its various extensions. Below, we will review the definitions of these methods sequentially. Gradient ascent. Gradient ascent (Jang et al., 2023; Feng et al., 2024) is a traditional and straightforward baseline method that removes the modelâs memory of the samples in fsubscriptD_fDitalic_f by maximizing the loss on fsubscriptD_fDitalic_f, effectively reversing the gradient descent process. It is defined as: âGA=1|f|â˘âi=1|f|ât=1nilogâĄpâ˘(xtâŁ<t;)ââforgetâ˘(f;),subscriptâGAsubscriptâ1subscriptsuperscriptsubscript1subscriptsuperscriptsubscript1subscriptconditionalsubscriptsubscriptabsentsubscriptâforgetsubscriptL_GA= 1|D_f| _i=1^|% D_f| _t=1^n_i p(x_t x_<t;% θ)_L_forget(D_f;% θ),Lroman_GA = underâ start_ARG divide start_ARG 1 end_ARG start_ARG | Ditalic_f | end_ARG âi = 1| Ditalic_f | ât = 1nitalic_i log p ( xitalic_t ⣠italic_x< t ; italic_θ ) end_ARGL start_POSTSUBSCRIPT forget ( Ditalic_f ; italic_θ ) end_POSTSUBSCRIPT , where nisubscriptn_initalic_i denotes the number of tokens in the sample isuperscript x^iitalic_xitalic_i, and θitalic_θ represents the parameters of the model. Variants of gradient ascent. However, naive gradient ascent significantly degrades the modelâs other capabilities. To address this issue, recent studies (Wang et al., 2023; Li et al., 2024; Maini et al., 2024; Ji et al., 2024b; Jia et al., 2024b; Liu et al., 2024a; Wang et al., 2024) have introduced various regularization terms, primarily including loss-based regularization and divergence-based regularization, as described below: ⢠Loss-based regularization. Loss-based regularization (Li et al., 2024; Maini et al., 2024; Jia et al., 2024b) maintains the modelâs other capabilities by sampling a dataset râ˛subscriptâ˛D_r Ditalic_rⲠthat shares the same distribution as rsubscriptD_rDitalic_r and minimizing the modelâs loss on râ˛subscriptâ˛D_r Ditalic_râ˛. The formal expression is: âGA+LR=âGAââforgetâ˘(f;)âÎťâ˘1|râ˛|â˘âi=1|râ˛|ât=1nilogâĄpâ˘(xtâŁ<t;)ââregâ˘().subscriptâGALRsubscriptâsubscriptâGAsubscriptâforgetsubscriptsubscriptâ1superscriptsubscriptâ˛subscript1superscriptsubscriptâ˛subscript1subscriptconditionalsubscriptsubscriptabsentsubscriptâregL_GA+LR= L_GA_% L_forget(D_f; θ)-Îť % 1|D_r | _i=1^|D_r |% _t=1^n_i p(x_t x_<t; θ)_% L_reg( θ).Lroman_GA + LR = underâ start_ARG Lroman_GA end_ARGL start_POSTSUBSCRIPT forget ( Ditalic_f ; italic_θ ) end_POSTSUBSCRIPT - Îť underâ start_ARG divide start_ARG 1 end_ARG start_ARG | Ditalic_rⲠ| end_ARG âi = 1| Ditalic_r start_POSTSUPERSCRIPT Ⲡ| end_POSTSUPERSCRIPT ât = 1nitalic_i log p ( xitalic_t ⣠italic_x< t ; italic_θ ) end_ARGL start_POSTSUBSCRIPT reg ( italic_θ ) end_POSTSUBSCRIPT . ⢠Divergence-based regularization. Similar to loss-based regularization, divergence-based regularization (Wang et al., 2023; Tian et al., 2024; Maini et al., 2024; Ji et al., 2024b; Wang et al., 2024) preserves model performance by constraining the output distribution of the model on a dataset râ˛subscriptâ˛D_r Ditalic_râ˛. Specifically, this method minimizes the distributional distance Dis(¡âŁÂˇ)Dis( )D i s ( ¡ ⣠⣠¡ ) between the output distribution of the unlearned model on râ˛subscriptâ˛D_r Ditalic_rⲠand that of the original model on râ˛subscriptâ˛D_r Ditalic_râ˛. Depending on the metric used to measure the distributional distance, this method can further be categorized into regularizations based on KL divergence (Wang et al., 2023; Maini et al., 2024) and f-divergence (Wang et al., 2024). The formal definition is: âGA+DR=âGAââforgetâ˘(f;)+Îťâ˘1|râ˛|âi=1|râ˛|ât=1niDis(P(¡âŁ<t;)âŁP(¡âŁ<t;â))ââregâ˘().L_GA+DR= L_GA_% L_forget(D_f; θ)+Îť % 1|D_r | _i=1^|D_r |% _t=1^n_iDis(P( x_<t;% θ) P( x_<% t; θ^*))_L_reg( θ).Lroman_GA + DR = underâ start_ARG Lroman_GA end_ARGL start_POSTSUBSCRIPT forget ( Ditalic_f ; italic_θ ) end_POSTSUBSCRIPT + Îť underâ start_ARG divide start_ARG 1 end_ARG start_ARG | Ditalic_rⲠ| end_ARG âi = 1| Ditalic_r start_POSTSUPERSCRIPT Ⲡ| end_POSTSUPERSCRIPT ât = 1nitalic_i D i s ( P ( ¡ ⣠italic_x< t ; italic_θ ) ⣠⣠P ( ¡ ⣠italic_x< t ; italic_θâ ) ) end_ARGL start_POSTSUBSCRIPT reg ( italic_θ ) end_POSTSUBSCRIPT . Both loss regularization and divergence regularization can essentially be regarded as forms of parameter regularization, which constrain the norm of the difference between model parameters before and after unlearning to be less than a threshold δ. By restricting the parameter changes within a δ-norm ball, this technique ensures the preservation of the modelâs other capabilities. However, parameter regularization is difficult to handle directly as a constraint, so its relaxed form is often utilized and incorporated into the objective function instead. Formally, this can be expressed as: âGA+PR=âGAââforgetâ˘(f;)+Îťâ˘ââââp2ââregâ˘().subscriptâGAPRsubscriptâsubscriptâGAsubscriptâforgetsubscriptsubscriptâsubscriptsuperscriptnormsuperscript2subscriptâregL_GA+PR= L_GA_% L_forget(D_f; θ)+Îť % \| θ- θ^*\|^2_p_L_% reg( θ).Lroman_GA + PR = underâ start_ARG Lroman_GA end_ARGL start_POSTSUBSCRIPT forget ( Ditalic_f ; italic_θ ) end_POSTSUBSCRIPT + Îť underâ start_ARG ⼠italic_θ - italic_θâ âĽ2p end_ARGL start_POSTSUBSCRIPT reg ( italic_θ ) end_POSTSUBSCRIPT . In addition, while several recent methods (i.e., Mismatch and LLMU) (Yao et al., 2024) differ in their definitions of unlearning objectives, they are fundamentally variants of gradient ascent methods. These methods further refine gradient ascent by extending the formulation of unlearning objectives, constructing a random combination of text sequences YransubscriptranY_ranYroman_ran. Specifically, their definitions are given as: âMIS=â1|f|â˘âi=1|f|ât=1ni1|Yran|â˘âj=1|Yran|logâĄpâ˘(yranjâŁ<t;)ââforgetâ˘(f;)âÎťâ˘1|râ˛|â˘âi=1|râ˛|ât=1nilogâĄpâ˘(xtâŁ<t;)ââregâ˘().subscriptâMISsubscriptâ1subscriptsuperscriptsubscript1subscriptsuperscriptsubscript1subscript1subscriptransuperscriptsubscript1subscriptranconditionalsuperscriptsubscriptransubscriptabsentsubscriptâforgetsubscriptsubscriptâ1superscriptsubscriptâ˛subscript1superscriptsubscriptâ˛subscript1subscriptconditionalsubscriptsubscriptabsentsubscriptâregL_MIS= - 1|D_f| _i=1^% |D_f| _t=1^n_i 1|Y_ran| _j=1^|% Y_ran| p(y_ran^j x_<t;% θ)_L_forget(D_f;% θ)-Îť 1|D_r |% _i=1^|D_r | _t=1^n_i p(x_t % x_<t; θ)_L_reg(% θ).Lroman_MIS = underâ start_ARG - divide start_ARG 1 end_ARG start_ARG | Ditalic_f | end_ARG âi = 1| Ditalic_f | ât = 1nitalic_i divide start_ARG 1 end_ARG start_ARG | Yroman_ran | end_ARG âj = 1| Yroman_ran | log p ( yroman_ranitalic_j ⣠italic_x< t ; italic_θ ) end_ARGL start_POSTSUBSCRIPT forget ( Ditalic_f ; italic_θ ) end_POSTSUBSCRIPT - Îť underâ start_ARG divide start_ARG 1 end_ARG start_ARG | Ditalic_rⲠ| end_ARG âi = 1| Ditalic_r start_POSTSUPERSCRIPT Ⲡ| end_POSTSUPERSCRIPT ât = 1nitalic_i log p ( xitalic_t ⣠italic_x< t ; italic_θ ) end_ARGL start_POSTSUBSCRIPT reg ( italic_θ ) end_POSTSUBSCRIPT . âLLMU=âGAâ1|f|â˘âi=1|f|ât=1ni1|Yran|â˘âj=1|Yran|logâĄpâ˘(yranjâŁ<t;)ââforgetâ˘(f;)+Îťâ˘1|râ˛|âi=1|râ˛|ât=1niDis(P(¡âŁ<t;)âŁP(¡âŁ<t;â))ââregâ˘().L_LLMU= L_GA- 1|% D_f| _i=1^|D_f| _t=1^n_i 1|Y_% ran| _j=1^|Y_ran| p(y_ran^j % x_<t; θ)_L_forget(% D_f; θ)+Îť 1|D% _r | _i=1^|D_r | _t=1^n_iDis(P(% x_<t; θ) P% ( x_<t; θ^*))_% L_reg( θ).Lroman_LLMU = underâ start_ARG Lroman_GA - divide start_ARG 1 end_ARG start_ARG | Ditalic_f | end_ARG âi = 1| Ditalic_f | ât = 1nitalic_i divide start_ARG 1 end_ARG start_ARG | Yroman_ran | end_ARG âj = 1| Yroman_ran | log p ( yroman_ranitalic_j ⣠italic_x< t ; italic_θ ) end_ARGL start_POSTSUBSCRIPT forget ( Ditalic_f ; italic_θ ) end_POSTSUBSCRIPT + Îť underâ start_ARG divide start_ARG 1 end_ARG start_ARG | Ditalic_rⲠ| end_ARG âi = 1| Ditalic_r start_POSTSUPERSCRIPT Ⲡ| end_POSTSUPERSCRIPT ât = 1nitalic_i D i s ( P ( ¡ ⣠italic_x< t ; italic_θ ) ⣠⣠P ( ¡ ⣠italic_x< t ; italic_θâ ) ) end_ARGL start_POSTSUBSCRIPT reg ( italic_θ ) end_POSTSUBSCRIPT . Preference optimization-based methods. Preference optimization-based unlearning methods for LLMs primarily include DPO (Lu et al., 2022; Maini et al., 2024; Dige et al., 2024) and its variants, as well as Negative Preference Optimization (NPO) (Zhang et al., 2024; Fan et al., 2024). These methods achieve unlearning by constructing additional preference data pairs and leveraging existing preference optimization algorithms to guide the model. DPO method. The DPO method constructs preference data pairs based on the unlearning sample set (Lu et al., 2022; Maini et al., 2024; Dige et al., 2024). For example, given a sample isuperscript x^iitalic_xitalic_i containing nisubscriptn_initalic_i combinations, for any combination pair (<ti,xt)subscriptsuperscriptabsentsubscript( x^i_<t,x_t)( italic_xitalic_i< t , xitalic_t ), where xtsubscriptx_txitalic_t is the truthful response, DPO sets xtâ˛subscriptâ˛x_t xitalic_tⲠas ârefuse to answerâ and treats it as the preferred response. By optimizing this preference pair, DPO employs preference optimization algorithms to achieve unlearning. It is formally defined as: âDPO=â2βâ˘iâfâ˘[logâĄĎâ˘(âβâ˘âi=1nilogâĄpâ˘(xtâŁ<t;)ââforgetâ˘(f;)+βâ˘âi=1nilogâĄpâ˘(xtâ˛âŁ<t;)âMrefââregâ˘())].subscriptâDPO2subscriptsuperscriptsubscriptdelimited-[]subscriptâsuperscriptsubscript1subscriptconditionalsubscriptsubscriptabsentsubscriptâforgetsubscriptsubscriptâsuperscriptsubscript1subscriptconditionalsuperscriptsubscriptâ˛subscriptabsentsubscriptrefsubscriptâregL_DPO=- 2βE_ x^iâ% D_f [ Ď ( -β _i=1^n_i p% (x_t x_<t; θ)_L_% forget(D_f; θ)+ β _i=1^n_% i p(x_t x_<t; θ)-M_% ref_L_reg( θ) ) ].Lroman_DPO = - divide start_ARG 2 end_ARG start_ARG β end_ARG blackboard_Eitalic_xitalic_i â D start_POSTSUBSCRIPT f end_POSTSUBSCRIPT [ log Ď ( underâ start_ARG - β âi = 1nitalic_i log p ( xitalic_t ⣠italic_x< t ; italic_θ ) end_ARGL start_POSTSUBSCRIPT forget ( Ditalic_f ; italic_θ ) end_POSTSUBSCRIPT + underâ start_ARG β âi = 1nitalic_i log p ( xitalic_tⲠ⣠italic_x< t ; italic_θ ) - Mroman_ref end_ARGL start_POSTSUBSCRIPT reg ( italic_θ ) end_POSTSUBSCRIPT ) ] . NPO method. The NPO method directly treats the unlearning samples as negative samples and penalizes the modelâs responses on the unlearning set fsubscriptD_fDitalic_f (Zhang et al., 2024; Fan et al., 2024). The formal definition is: âNPO=â2βâ˘iâfâ˘[logâĄĎâ˘(âβâ˘Pâ˘(xtâŁ<ti;â)ââforgetâ˘(forget;)+βâ˘logâĄPâ˘(xtâŁ<ti;)ââregâ˘())]subscriptâNPO2subscriptsuperscriptsubscriptdelimited-[]subscriptâconditionalsubscriptsubscriptsuperscriptabsentsuperscriptsubscriptâforgetforgetsubscriptâconditionalsubscriptsubscriptsuperscriptabsentsubscriptâregL_NPO=- 2βE_ x^iâ% D_f [ Ď ( -β P(x_t % x^i_<t; θ^*)_L_forget% (forget; θ)+ β P(x_t % x^i_<t; θ)_L_reg(% θ) ) ]Lroman_NPO = - divide start_ARG 2 end_ARG start_ARG β end_ARG blackboard_Eitalic_xitalic_i â D start_POSTSUBSCRIPT f end_POSTSUBSCRIPT [ log Ď ( underâ start_ARG - β P ( xitalic_t ⣠italic_xitalic_i< t ; italic_θâ ) end_ARGL start_POSTSUBSCRIPT forget ( forget ; italic_θ ) end_POSTSUBSCRIPT + underâ start_ARG β log P ( xitalic_t ⣠italic_xitalic_i< t ; italic_θ ) end_ARGL start_POSTSUBSCRIPT reg ( italic_θ ) end_POSTSUBSCRIPT ) ] In summary, both gradient-based methods and preference optimization-based methods can be viewed as combinations of unlearning loss and regularization loss. Appendix B Theoretical Analysis B.1 Proof of Proposition 7 To analyze the variation of â˘(ââ˘(Ďľ))superscriptitalic-ĎľJ( θ^*(Îľ))J ( italic_θâ ( Ďľ ) ), we perform a Taylor expansion of Eq. (6) around Ďľ=0italic-Ďľ0Îľ=0Ďľ = 0. Here, since we are more concerned with the description of the magnitude of the effect rather than the exact values, we expand it only to the first-order term, yielding: â˘(ââ˘(Ďľ))ââ˘(ââ˘(0))+Ďľâ˘ââ˘(ââ˘(Ďľ))âĎľ|Ďľ=0,superscriptitalic-Ďľsuperscript0evaluated-atitalic-Ďľsuperscriptitalic-Ďľitalic-Ďľitalic-Ďľ0J( θ^*(Îľ)) ( % θ^*(0))+Îľ ( θ^*(% Îľ))âÎľ|_Îľ=0,J ( italic_θâ ( Ďľ ) ) â J ( italic_θâ ( 0 ) ) + Ďľ divide start_ARG â J ( italic_θâ ( Ďľ ) ) end_ARG start_ARG â Ďľ end_ARG |Ďľ = 0 , where â˘(ââ˘(0))superscript0J( θ^*(0))J ( italic_θâ ( 0 ) ) represents the preference alignment performance of the model at Ďľ=0italic-Ďľ0Îľ=0Ďľ = 0 (i.e., without unlearning), while ââ˘(ââ˘(Ďľ))âĎľsuperscriptitalic-Ďľitalic-Ďľ ( θ^*(Îľ))âÎľdivide start_ARG â J ( italic_θâ ( Ďľ ) ) end_ARG start_ARG â Ďľ end_ARG denotes the rate of change in the PA performance w.r.t. the unlearning weight control parameter Ďľitalic-ϾξϾ. According to the chain rule, the partial derivative can be decomposed as: ââ˘(ââ˘(Ďľ))âĎľ=ââ˘(ââ˘(Ďľ))â¤â˘âââ˘(Ďľ)âĎľ.superscriptitalic-Ďľitalic-Ďľsubscriptâsuperscriptsuperscriptitalic-Ďľtopsuperscriptitalic-Ďľitalic-Ďľ ( θ^*(Îľ))âÎľ% = _ θJ( θ^*(Îľ))^% â θ^*(Îľ)âÎľ.divide start_ARG â J ( italic_θâ ( Ďľ ) ) end_ARG start_ARG â Ďľ end_ARG = âitalic_θ J ( italic_θâ ( Ďľ ) )⤠divide start_ARG â italic_θâ ( Ďľ ) end_ARG start_ARG â Ďľ end_ARG . Since the optimal solution ââ˘(Ďľ)superscriptitalic-Ďľ θ^*(Îľ)italic_θâ ( Ďľ ) of the lower-level problem satisfies the first-order optimality condition: â(Ďľâ˘âforgetâ˘(;)+âregâ˘())|=ââ˘(Ďľ)=0.evaluated-atsubscriptâitalic-Ďľsubscriptâforgetsubscriptâregsuperscriptitalic-Ďľ0 _ θ ( _forget(% x; θ)+L_reg( % θ) )|_ θ= θ^*(Îľ)=0.âitalic_θ ( Ďľ Lroman_forget ( italic_x ; italic_θ ) + Lroman_reg ( italic_θ ) ) |italic_θ = italic_θâ ( Ďľ ) = 0 . By differentiating the above optimality condition w.r.t Ďľitalic-ϾξϾ, we obtain: Ďľâ˘â2âforgetâ˘(;ââ˘(Ďľ))â˘âââ˘(Ďľ)âĎľ+ââforgetâ˘(;ââ˘(Ďľ))+â2âregâ˘(ââ˘(Ďľ))â˘âââ˘(Ďľ)âĎľ=0.italic-Ďľsuperscriptsubscriptâ2subscriptâforgetsuperscriptitalic-Ďľsuperscriptitalic-Ďľitalic-Ďľsubscriptâsubscriptâforgetsuperscriptitalic-Ďľsuperscriptsubscriptâ2subscriptâregsuperscriptitalic-Ďľsuperscriptitalic-Ďľitalic-Ďľ0Îľ _ θ^2L_forget(% x; θ^*(Îľ)) â % θ^*(Îľ)âÎľ+ _ θ% L_forget( x; θ^*(Îľ))+ _% θ^2L_reg( θ^*(% Îľ)) â θ^*(Îľ)âÎľ=0.Ďľ âitalic_θ2 Lroman_forget ( italic_x ; italic_θâ ( Ďľ ) ) divide start_ARG â italic_θâ ( Ďľ ) end_ARG start_ARG â Ďľ end_ARG + âitalic_θ Lroman_forget ( italic_x ; italic_θâ ( Ďľ ) ) + âitalic_θ2 Lroman_reg ( italic_θâ ( Ďľ ) ) divide start_ARG â italic_θâ ( Ďľ ) end_ARG start_ARG â Ďľ end_ARG = 0 . Substituting âregâ˘()=ââââ2subscriptâregsuperscriptnormsuperscript2L_reg( θ)=\| θ-% θ^*\|^2Lroman_reg ( italic_θ ) = ⼠italic_θ - italic_θâ âĽ2, we have: ââregâ˘(ââ˘(Ďľ))=2â˘(ââ˘(Ďľ)ââ),â2âregâ˘(ââ˘(Ďľ))=2â˘I.formulae-sequencesubscriptâsubscriptâregsuperscriptitalic-Ďľ2superscriptitalic-Ďľsuperscriptsuperscriptsubscriptâ2subscriptâregsuperscriptitalic-Ďľ2 _ θL_reg( θ^*% (Îľ))=2( θ^*(Îľ)- θ^*), % _ θ^2L_reg( θ% ^*(Îľ))=2I.âitalic_θ Lroman_reg ( italic_θâ ( Ďľ ) ) = 2 ( italic_θâ ( Ďľ ) - italic_θâ ) , âitalic_θ2 Lroman_reg ( italic_θâ ( Ďľ ) ) = 2 I . Therefore, the implicit gradient formula is given by: âââ˘(Ďľ)âĎľ=â[Ďľâ˘â2âforgetâ˘(;ââ˘(Ďľ))+2â˘I]â1â˘ââforgetâ˘(;ââ˘(Ďľ)).superscriptitalic-Ďľitalic-Ďľsuperscriptdelimited-[]italic-Ďľsuperscriptsubscriptâ2subscriptâforgetsuperscriptitalic-Ďľ21subscriptâsubscriptâforgetsuperscriptitalic-Ďľ â θ^*(Îľ)âÎľ=- [% Îľ _ θ^2L_forget(% x; θ^*(Îľ))+2I ]^-1 _% θL_forget( x; % θ^*(Îľ)).divide start_ARG â italic_θâ ( Ďľ ) end_ARG start_ARG â Ďľ end_ARG = - [ Ďľ âitalic_θ2 Lroman_forget ( italic_x ; italic_θâ ( Ďľ ) ) + 2 I ]- 1 âitalic_θ Lroman_forget ( italic_x ; italic_θâ ( Ďľ ) ) . When Ďľ=0italic-Ďľ0Îľ=0Ďľ = 0, the formula simplifies to: âââ˘(Ďľ)âĎľ|Ďľ=0=â[2â˘I]â1â˘ââforgetâ˘(;ââ˘(0))=â12â˘ââforgetâ˘(;â).evaluated-atsuperscriptitalic-Ďľitalic-Ďľitalic-Ďľ0superscriptdelimited-[]21subscriptâsubscriptâforgetsuperscript012subscriptâsubscriptâforgetsuperscript â θ^*(Îľ)âÎľ|_Îľ=% 0=- [2I ]^-1 _ θL_% forget( x; θ^*(0))=- 12 _% θL_forget( x; % θ^*).divide start_ARG â italic_θâ ( Ďľ ) end_ARG start_ARG â Ďľ end_ARG |Ďľ = 0 = - [ 2 I ]- 1 âitalic_θ Lroman_forget ( italic_x ; italic_θâ ( 0 ) ) = - divide start_ARG 1 end_ARG start_ARG 2 end_ARG âitalic_θ Lroman_forget ( italic_x ; italic_θâ ) . Substituting âââ˘(Ďľ)âĎľsuperscriptitalic-Ďľitalic-Ďľ â θ^*(Îľ)âÎľdivide start_ARG â italic_θâ ( Ďľ ) end_ARG start_ARG â Ďľ end_ARG into the chain rule formula: ââ˘(ââ˘(Ďľ))âĎľ|Ďľ=0=ââ˘(â)â¤â˘(â12â˘ââforgetâ˘(;â)).evaluated-atsuperscriptitalic-Ďľitalic-Ďľitalic-Ďľ0subscriptâsuperscriptsuperscripttop12subscriptâsubscriptâforgetsuperscript ( θ^*(Îľ))âÎľ% |_Îľ=0= _ θJ( θ^*% ) (- 12 _ θL_% forget( x; θ^*) ).divide start_ARG â J ( italic_θâ ( Ďľ ) ) end_ARG start_ARG â Ďľ end_ARG |Ďľ = 0 = âitalic_θ J ( italic_θâ )⤠( - divide start_ARG 1 end_ARG start_ARG 2 end_ARG âitalic_θ Lroman_forget ( italic_x ; italic_θâ ) ) . Therefore, the variation in preference alignment performance is: â˘(ââ˘(Ďľ))ââ˘(ââ˘(0))ââĎľ2â˘ââ˘(â)â¤â˘ââforgetâ˘(;â).superscriptitalic-Ďľsuperscript0italic-Ďľ2subscriptâsuperscriptsuperscripttopsubscriptâsubscriptâforgetsuperscriptJ( θ^*(Îľ))-J( θ% ^*(0))â- Îľ2 _ θJ(% θ^*) _ θL_% forget( x; θ^*).J ( italic_θâ ( Ďľ ) ) - J ( italic_θâ ( 0 ) ) â - divide start_ARG Ďľ end_ARG start_ARG 2 end_ARG âitalic_θ J ( italic_θâ )⤠âitalic_θ Lroman_forget ( italic_x ; italic_θâ ) . B.2 Derivation of Marginal Gain To optimize the outer problem, we need to compute the gradient of the objective function w.r.t. the weight vector Ďitalic_Ď: âgâ˘()subscriptâ _ Ďg( Ď)âitalic_Ď g ( italic_Ď ) =âââ˘(ââ˘())+βâ˘âi=1nabsentsubscriptâsuperscriptsuperscriptsubscript1 =- _ ĎJ( θ^*% ( Ď))+β _i=1^n Ď= - âitalic_Ď J ( italic_θâ ( italic_Ď ) ) + β âi = 1n square-root start_ARG italic_Ď end_ARG =âââ˘(ââ˘())ââ˘âââ˘()â+[β2â˘1,β2â˘2,âŚ,β2â˘n]â¤.absentsuperscriptsuperscriptsuperscript2subscript12subscript2âŚ2subscripttop =- ( θ^*( % Ď))â θ â θ^*(% Ď)â Ď+ [ β2 % Ď_1, β2 Ď_2,âŚ% , β2 Ď_n ] .= - divide start_ARG â J ( italic_θâ ( italic_Ď ) ) end_ARG start_ARG â italic_θ end_ARG divide start_ARG â italic_θâ ( italic_Ď ) end_ARG start_ARG â italic_Ď end_ARG + [ divide start_ARG β end_ARG start_ARG 2 square-root start_ARG italic_Ď1 end_ARG end_ARG , divide start_ARG β end_ARG start_ARG 2 square-root start_ARG italic_Ď2 end_ARG end_ARG , ⌠, divide start_ARG β end_ARG start_ARG 2 square-root start_ARG italic_Ďitalic_n end_ARG end_ARG ]⤠. (13) Since the solution of the inner optimization problem ââ˘()superscript θ^*( Ď)italic_θâ ( italic_Ď ) satisfies the first-order necessary condition: âfâ˘(ââ˘(),)=0,subscriptâsuperscript0 _ θf( θ^*( Ď),% Ď)=0,âitalic_θ f ( italic_θâ ( italic_Ď ) , italic_Ď ) = 0 , which is equivalent to â(âi=1niâ˘âiâ˘(ââ˘())+Îťâ˘âââ˘()âââ2)=0.subscriptâsuperscriptsubscript1subscriptsubscriptâsuperscriptsuperscriptnormsuperscriptsuperscript20 _ θ ( _i=1^n Ď_i _% i( θ^*( Ď))+Îť\| θ% ^*( Ď)- θ^*\|^2 )=0.âitalic_θ ( âi = 1n italic_Ďitalic_i âitalic_i ( italic_θâ ( italic_Ď ) ) + Îť ⼠italic_θâ ( italic_Ď ) - italic_θâ âĽ2 ) = 0 . Taking the derivative w.r.t. Ďitalic_Ď, and using the implicit function theorem, we obtain: âââ˘()âsuperscript â θ^*( Ď)% â Ďdivide start_ARG â italic_θâ ( italic_Ď ) end_ARG start_ARG â italic_Ď end_ARG =â(â2fâ2)â1â˘â2fââ˘âabsentsuperscriptsuperscript2superscript21superscript2 =- ( â^2fâ θ^2% )^-1 â^2fâ θâ% Ď= - ( divide start_ARG â2 f end_ARG start_ARG â italic_θ2 end_ARG )- 1 divide start_ARG â2 f end_ARG start_ARG â italic_θ â italic_Ď end_ARG =â(â2fâ2)â1â˘ââ˘[âi=1niâ˘ââiâ˘()â+2â˘Îťâ˘(ââ)],absentsuperscriptsuperscript2superscript21delimited-[]superscriptsubscript1subscriptsubscriptâ2superscript =- ( â^2fâ θ^2% )^-1 â Ď [ _i=1^n% Ď_i â _i( θ)â% θ+2Îť( θ- θ^*)% ],= - ( divide start_ARG â2 f end_ARG start_ARG â italic_θ2 end_ARG )- 1 divide start_ARG â end_ARG start_ARG â italic_Ď end_ARG [ âi = 1n italic_Ďitalic_i divide start_ARG â âitalic_i ( italic_θ ) end_ARG start_ARG â italic_θ end_ARG + 2 Îť ( italic_θ - italic_θâ ) ] , (14) where â2fâ2=âi=1ntâ1,iââ˘â2âiâ˘(ââ˘())+2â˘Îťâ˘Isuperscript2superscript2superscriptsubscript1superscriptsubscriptsubscript1superscriptsubscriptâ2subscriptâsuperscript2 â^2fâ θ^2= _i=1^n% Ď_S_t-1,i^* _ θ^2% _i( θ^*( Ď))+2Îť Idivide start_ARG â2 f end_ARG start_ARG â italic_θ2 end_ARG = âi = 1n italic_Ďcaligraphic_S start_POSTSUBSCRIPT t - 1 , i end_POSTSUBSCRIPTâ âitalic_θ2 âitalic_i ( italic_θâ ( italic_Ď ) ) + 2 Îť I denotes the Hessian matrix of the inner optimization problem. Substituting Eq. (14) into Eq. (13): âgâ˘()=ââ˘(ââ˘())ââ˘(â2fâ2)â1â˘ââ˘[âi=1niâ˘ââiâ˘()â+2â˘Îťâ˘(ââ)]+[β2â˘1,β2â˘2,âŚ,β2â˘n]â¤.subscriptâsuperscriptsuperscriptsuperscript2superscript21delimited-[]superscriptsubscript1subscriptsubscriptâ2superscriptsuperscript2subscript12subscript2âŚ2subscripttop _ Ďg( Ď)= (% θ^*( Ď))â θ% ( â^2fâ θ^2 )^-1 % â Ď [ _i=1^n Ď% _i â _i( θ)â θ% +2Îť( θ- θ^*) ]+ [ % β2 Ď_1, β2 Ď% _2,âŚ, β2 Ď_n ] .âitalic_Ď g ( italic_Ď ) = divide start_ARG â J ( italic_θâ ( italic_Ď ) ) end_ARG start_ARG â italic_θ end_ARG ( divide start_ARG â2 f end_ARG start_ARG â italic_θ2 end_ARG )- 1 divide start_ARG â end_ARG start_ARG â italic_Ď end_ARG [ âi = 1n italic_Ďitalic_i divide start_ARG â âitalic_i ( italic_θ ) end_ARG start_ARG â italic_θ end_ARG + 2 Îť ( italic_θ - italic_θâ ) ] + [ divide start_ARG β end_ARG start_ARG 2 square-root start_ARG italic_Ď1 end_ARG end_ARG , divide start_ARG β end_ARG start_ARG 2 square-root start_ARG italic_Ď2 end_ARG end_ARG , ⌠, divide start_ARG β end_ARG start_ARG 2 square-root start_ARG italic_Ďitalic_n end_ARG end_ARG ]⤠. Now, consider the contribution of the k-th component of the weight vector Ďitalic_Ď to gâ˘()g( Ď)g ( italic_Ď ), i.e., computing âgâ˘()ksubscript â g( Ď) Ď_kdivide start_ARG â g ( italic_Ď ) end_ARG start_ARG italic_Ďitalic_k end_ARG. Since only when i=ki=ki = k, the term corresponding to ksubscript Ď_kitalic_Ďitalic_k contributes, we derive: Îâ˘gâ˘(k)=âgâ˘()k=ââ˘(ââ˘())â˘(â2fâ2)â1â˘ââkâ˘(ââ˘())+β2â˘kâ12.Îsubscriptsubscriptâsuperscriptsuperscriptsuperscript2superscript21subscriptâsubscriptâsuperscript2superscriptsubscript12 g(k)= â g( Ď) Ď_k=% _ θJ( θ^*( % Ď)) ( â^2fâ θ^2 )^-% 1 _ θ _k( θ^*( % Ď))+ β2 Ď_k^- 12.Î g ( k ) = divide start_ARG â g ( italic_Ď ) end_ARG start_ARG italic_Ďitalic_k end_ARG = âitalic_θ J ( italic_θâ ( italic_Ď ) ) ( divide start_ARG â2 f end_ARG start_ARG â italic_θ2 end_ARG )- 1 âitalic_θ âitalic_k ( italic_θâ ( italic_Ď ) ) + divide start_ARG β end_ARG start_ARG 2 end_ARG italic_Ďitalic_k- divide start_ARG 1 end_ARG start_ARG 2 end_ARG . B.3 Derivation of Set Size The suboptimality bound provided by Theorem 4.3 is given as: gâ˘(tâ)âgâ˘(â)â¤8â˘L+4â˘Îľ1t+3.subscriptsuperscriptsubscriptsuperscript84subscript13g( Ď^*_S_t)-g( Ď^*)â¤% 8L+4 _1t+3.g ( italic_Ďâcaligraphic_S start_POSTSUBSCRIPT t end_POSTSUBSCRIPT ) - g ( italic_Ďâ ) ⤠divide start_ARG 8 L + 4 Îľ1 end_ARG start_ARG t + 3 end_ARG . To satisfy the suboptimality error constraint, i.e., gâ˘(tâ)âgâ˘(â)â¤Îľsubscriptsuperscriptsubscriptsuperscriptg( Ď^*_S_t)-g( Ď^*)⤠( italic_Ďâcaligraphic_S start_POSTSUBSCRIPT t end_POSTSUBSCRIPT ) - g ( italic_Ďâ ) ⤠ξ, it suffices to ensure that the right-hand side of the suboptimality bound is less than or equal to Îľ Îľ, which gives: 8â˘L+4â˘Îľ1t+3â¤Îľ84subscript13 8L+4 _1t+3⤠start_ARG 8 L + 4 Îľ1 end_ARG start_ARG t + 3 end_ARG ⤠ξ. By moving t+33t+3t + 3 to the right-hand side and expanding the terms on the right, we obtain: Îľâ˘tâĽ8â˘L+4â˘Îľ1â3â˘Îľ84subscript13 t⼠8L+4 _1-3 Îľ t ⼠8 L + 4 Îľ1 - 3 Îľ. Neglecting â3â˘Îľ3-3 - 3 Îľ (as its impact diminishes with increasing t), the expression is further simplified to: Îľâ˘tâĽ8â˘L+4â˘Îľ184subscript1 t⼠8L+4 _1Îľ t ⼠8 L + 4 Îľ1. Moving Îľ Îľ to the right-hand side yields: tâĽ8â˘L+4â˘Îľ1Îľ84subscript1t⼠8L+4 _1 t ⼠divide start_ARG 8 L + 4 Îľ1 end_ARG start_ARG Îľ end_ARG. This indicates that, to satisfy the suboptimality error constraint gâ˘(tâ)âgâ˘(â)â¤Îľsubscriptsuperscriptsubscriptsuperscriptg( Ď^*_S_t)-g( Ď^*)⤠( italic_Ďâcaligraphic_S start_POSTSUBSCRIPT t end_POSTSUBSCRIPT ) - g ( italic_Ďâ ) ⤠ξ, the number of iterations t must be at least: t=â˘(L+Îľ1Îľ)subscript1t=O( L+ _1 )t = O ( divide start_ARG L + Îľ1 end_ARG start_ARG Îľ end_ARG ). Appendix C Additional Experimental Details C.1 Dataset Configurations The detailed partitioning for each dataset is as follows: ⢠For the PKU SafeRLHF, samples of type harmful or risk-inducing across at least one of the 19 harm categories are defined as negative examples. ⢠For the UltraFeedback Binarized, samples of type low ratings in instruction following, truthfulness, honesty, or helpfulness annotations are considered negative examples. ⢠For the HaluEval, samples meeting the unverifiable, non-factual, or irrelevant hallucination annotations condition are categorized as negative examples. C.2 Evaluation Configurations In this section, we provide a detailed explanation of each evaluation metric. For the performance of PA, we utilize the following four evaluation metrics: ⢠Reward-value (Chakraborty et al., 2024; Yao et al., 2024). Reward-value assesses the quality of the modelâs outputs based on reward scores assigned by the reward model. Higher values for these two metrics indicate better PA performance of the model after unlearning. ⢠ASR (Xu et al., 2024). ASR measures the modelâs tendency to generate potentially harmful content. In our experiments, ASR is further divided into four sub-dimensions (Xu et al., 2024; Zou et al., 2023): ASR-keyword, ASR-answer, ASR-useful, and ASR-summary. Smaller values for these metrics indicate better PA performance of the model after unlearning. ⢠Coherence (Chakraborty et al., 2024; Khanov et al., 2024; Kong et al., 2024). Coherence is evaluated by calculating the cosine similarity between the SimCSE (Su et al., 2022) embeddings of each prompt and its generated response, assessing their semantic proximity (Chakraborty et al., 2024). Higher coherence indicates better PA performance. ⢠Win-rate (Xiao et al., 2024; Rafailov et al., 2024). Win-rate measures the proportion of instances where the modelâs outputs are preferred over those of the baseline model (GPT-4). ⢠Hallucination-rate (Yao et al., 2024). Hallucination-rate measures the frequency of false or factually incorrect information in the outputs. A lower hallucination-rate indicates better PA performance. For the performance of unlearning, we utilize the following three evaluation metrics: ⢠Membership Inference Attack (MIA) (Jia et al., 2024a). We employ the Min-k%percentk\%k % Prob (Shi et al., 2023) method to calculate the likelihood of a given text belonging to the training data. The specific metric used is the area under the ROC curve (AUC). A higher AUC value indicates that the model is better at distinguishing between training and non-training data, thereby demonstrating greater unlearning effectiveness. ⢠Perplexity (PPL) (Yao et al., 2024; Doshi & Stickland, 2024). Lower PPL values indicate higher quality of the generated text, with outputs being more fluent and consistent with natural language expression norms. Appendix D Additional Experiments We validated the effectiveness of U2A on the UltraFeedback Binarized and HaluEval datasets. The experimental results are shown in the table below. Table 3: Comparison of the U2A framework with the current PA and unlearning baseline methods on the UltraFeedback Binarized dataset. Optimal results are highlighted in bold. Models Methods PA Performance MU Performance Length-control Win Rate (â â) Win Rate vs. GPT-4 (â â) Coherence (â â) MIA (â â) PPL (â â) Llama-2-7B-Chat Original 0.0818 0.0534 0.7519 0.5287 9.3005 Retrain 0.0770 0.0309 0.7571 0.5058 9.3588 PPO 0.0916 0.0586 0.7643 0.5618 11.3477 DPO 0.0886 0.0620 0.7618 0.5410 10.1612 GA 0.0792 0.0523 0.7516 0.5337 8.4104 GradDiff 0.0822 0.0653 0.7632 0.5735 9.0017 NPO 0.0808 0.0581 0.7574 0.5288 10.1905 GA + U2A 0.0985 0.0697 0.7632 0.5244 8.3768 GradDiff + U2A 0.1002 0.0711 0.7678 0.5845 8.8979 NPO + U2A 0.0992 0.0724 0.7603 0.5505 9.4683 Llama-3.1-8B-Instruct Original 0.2330 0.2281 0.7508 0.5358 2.6358 Retrain 0.2411 0.2363 0.7521 0.5401 2.6408 PPO 0.2453 0.2325 0.7588 0.5327 2.8744 DPO 0.2597 0.2447 0.7603 0.5358 2.9620 GA 0.2374 0.2338 0.7498 0.5313 2.6286 GradDiff 0.2493 0.2456 0.7513 0.5364 2.6357 NPO 0.2042 0.1751 0.7492 0.3812 3.1217 GA + U2A 0.2522 0.2579 0.7612 0.5596 2.3941 GradDiff + U2A 0.2515 0.2585 0.7572 0.5458 1.6617 NPO + U2A 0.2391 0.2293 0.7601 0.5192 2.9896 Table 4: Comparison of the U2A framework with the current PA and unlearning baseline methods on the HaluEval dataset. Optimal results are highlighted in bold. Models Methods PA Performance MU Performance Hallucination Rate MIA (â â) PPL (â â) F1 (â â) Precision (â â) Recall (â â) Llama-2-7B-Chat Original 65.05 72.50 53.70 0.3945 118.0564 Retrain 52.45 59.45 41.95 0.4006 98.8235 PPO 55.35 61.80 44.85 0.3489 140.6214 DPO 54.40 61.40 43.55 0.3985 116.9673 GA 60.80 61.75 49.40 0.3938 70.1965 GradDiff 59.34 62.45 45.77 0.3929 72.5341 NPO 65.15 61.95 43.90 0.3988 104.3602 GA + U2A 50.45 60.75 41.35 0.4061 66.2969 GradDiff + U2A 49.90 60.65 41.25 0.4165 64.1484 NPO + U2A 48.45 58.70 40.05 0.4065 67.8125 Llama-3.1-8B-Instruct Original 57.05 65.45 46.00 0.3903 7.1921 Retrain 52.90 58.20 47.45 0.3978 7.5665 PPO 55.85 62.95 45.70 0.3908 6.8384 DPO 56.55 64.80 45.65 0.4083 7.1947 GA 53.40 65.20 44.60 0.4345 8.9799 GradDiff 58.35 70.55 48.10 0.4565 7.4564 NPO 58.05 65.35 46.70 0.3908 12.4844 GA + U2A 50.65 58.10 40.95 0.4422 6.7682 GradDiff + U2A 49.75 56.35 42.70 0.4571 7.8976 NPO + U2A 48.15 55.40 43.05 0.4220 9.9792