On Large Language Model Continual Unlearning

## Abstract

Abstract While large language models (LLMs) have demonstrated impressive performance across various domains and tasks, their security issues have become increasingly severe. Machine unlearning (MU) has emerged as a promising solution to address these issues by aiming to remove the influence of undesired data on the target model without compromising its utility in other aspects. Traditional MU typically assumes full access to the original training data to preserve utility, which is difficult to achieve in LLM unlearning due to the vastness of the original training data.
Therefore, existing LLM unlearning methods often assume access to data most affected by undesired data unlearning. However, this assumption underestimates the entanglement among various LLM capabilities and ignores data access limitations due to privacy concerns, copyright protection, and the potential rarity of the tasks. Moreover, these LLM unlearning methods do not sufficiently consider that unlearning requests in real-world scenarios are continuously emerging, which may lead to accumulated model utility loss that eventually becomes unacceptable.
To overcome these challenges and achieve practical LLM unlearning, we propose the O 3 framework. The O 3 framework includes an O ut- O f-Distribution (OOD) detector to measure the similarity between input and unlearning data, and an O rthogonal low-rank adapter (LoRA) for continuously unlearning requested data. The OOD detector is trained with a novel contrastive entropy loss and utilizes a local-global layer-aggregated scoring mechanism. The orthogonal LoRA achieves parameter disentanglement among continual unlearning requests. During inference, our O 3 framework can smartly decide whether and to what extent to load the unlearning LoRA based on the OOD detector’s predictions. Notably, O 3 ’s effectiveness does not rely on any retained data. Along with the LoRA design at the model level, this also makes O 3 more computationally efficient. We conducted extensive experiments on O 3 and state-of-the-art LLM unlearning methods across three tasks and seven datasets. The results indicate that O 3 consistently achieves the best trade-off between unlearning effectiveness and utility preservation, especially when facing continuous unlearning requests.

## I Introduction

Recently, bolstered by scaling laws [], the size of language models has grown tremendously, demonstrating unexpectedly excellent performance across a variety of tasks []. However, concerns about large language models (LLMs) have also increased, particularly regarding safety alignment [], hallucination output [], and privacy violations []. To address these issues, more research focuses on applying different techniques [] in LLMs to mitigate dangerous behaviors, eliminate incorrect knowledge, and remove private, toxic, or illegal data.
Among these techniques, one of the most representative approaches is *machine unlearning* []. Current methods for LLM unlearning can be primarily categorized into parameter optimization [, , , , , , ], parameter merging [, , , ], and in-context learning [, ]. The parameter optimization methods involve directly fine-tuning the LLM, with the objective typically being to maximize the task loss on the data that needs to be unlearned or to minimize the random label loss on the unlearning data. Parameter merging for unlearning often requires identifying and localizing the model parameters related to the unlearning data and then making appropriate modifications to these parameters. Finally, in-context learning-based methods modify the LLM input prompts to make the LLM refuse to output content related to the unlearning data. In terms of unlearning effectiveness, parameter optimization and parameter merging methods are typically much more effective than in-context learning. However, parameter optimization and merging often poorly maintain the model utility outside the unlearning knowledge scope.

Despite the above efforts, existing LLM unlearning studies still face the following challenges and struggle to be employed practically. First, in addition to the data that needs to be unlearned, existing unlearning methods also require a large dataset called the *retained dataset* to maintain the model utility. This retained dataset often consists of the original training dataset [] or a portion of it. However, as LLMs are trained on massive datasets [], assuming access to the complete training data to maintain model utility is typically unrealistic for LLM unlearning []. Moreover, as time goes on, the original training data of LLMs may become inaccessible due to data privacy protection, expired access authorization, and intellectual property protection []. If the retained dataset only contains incomplete training data distribution, the corresponding model utility for the missing parts will significantly decline during unlearning. Although some studies shrink the range of the retained data to the distribution most susceptible to unlearning, this distribution itself is hard to characterize and its corresponding data may be limited due to intrinsic rarity and privacy protection [, , ]. The second challenge is that LLM unlearning is often not a one-off operation but a continual process, as unlearning requests continuously emerge in the real world []. This is similar to LLM continual learning [], except that LLM unlearning requires continuously unlearning outdated, incorrect, or user-requested information. As the number of unlearning operations increases, the aforementioned decline in model utility will also have a cumulative effect, meaning that the model’s general capabilities will significantly decrease [, ] over time. Existing LLM unlearning methods, however, only consider single operations and cannot perform effective continual unlearning.

In this work, to achieve practical unlearning in LLMs, we propose the O^3 framework. The O^3 framework can balance unlearning effectiveness and model utility preservation in continuous scenarios without using any retained data. At a high level, the O^3 framework mainly includes an Out-Of-Distribution (OOD) detection module to assess the similarity between input data and unlearning data, and an Orthogonal Low-rank adapter (LoRA) [] for continuously unlearning requested data. Specifically, the OOD detector in O^3 is trained with a novel contrastive entropy loss as its backbone. When supplemented with our local-global layer-aggregated scoring, this backbone can achieve truly unsupervised OOD detection, meaning that the available in-distribution training data is unlabeled and may be few-shot. The orthogonal LoRA in O^3 enables the disentanglement of parameter space across different unlearning requests, ensuring that the unlearning effectiveness of different requests does not interfere with each other. The O^3 framework can balance unlearning effectiveness and model utility because it smartly leverages the data similarity determined by the OOD detector to decide whether and to what extent to load the unlearning LoRA during inference. In summary, the main contributions of this work include:

- •
We tackle important challenges for LLM unlearning in pratice: the continuous arrival of unlearning requests makes it hard to balance unlearning effectiveness and model utility preservation, and this is even harder when there is insufficient retained data.
- •
We propose a novel O^3 framework that includes an OOD detector and an orthogonal unlearning LoRA. The OOD detector measures the similarity between input and unlearning data, allowing O^3 to decide whether and to what extent to load the unlearning LoRA during inference. The orthogonal design of LoRA prevents interference among different unlearning requests, achieving better unlearning effectiveness in continuous scenarios.
- •
We conduct extensive experiments on three benchmark tasks that comprehensively test LLM’s discriminative, generative, and reasoning capabilities. The experiment results demonstrate that O^3 consistently achieves the best trade-off between unlearning effectiveness and utility preservation without using any retained data, compared with many state-of-the-art baseline methods when facing continuous unlearning requests. Moreover, thanks to the design of LoRA and the elimination of the need for any retained data, O^3 also provides improved computation efficiency.

## II Background

### II-A Machine Unlearning

Standard machine unlearning [] ensures the “right to be forgotten” [, ] and allows individuals to request the deletion of their data from the machine learning service provider. Formally speaking, we assume the data that needs to be unlearned is termed as $\mathcal{D}^{\mathrm{U}}\!=\!\{(\bm{x}_{i},y_{i})\|\bm{x}_{i}\!\sim\!\mathcal{
P}_{\mathcal{X}}^{\mathrm{U}},y_{i}\!\sim\!\mathcal{P}_{\mathcal{Y}}^{\mathrm{
U}}\}_{i=1}^{N^{\mathrm{U}}}$ ($N^{\mathrm{U}}$ is the sample quantity). $\mathcal{P}_{\mathcal{X}}^{\mathrm{U}}$ and $\mathcal{P}_{\mathcal{Y}}^{\mathrm{U}}$ are the input and label marginal distributions of the unlearning set, respectively. Note that $\mathcal{D}^{\mathrm{U}}$ naturally comes from the original training dataset of the target model $M_{\Theta}$ that is parameterized on $\Theta$. Moreover, we denote the retained training dataset without $\mathcal{D}^{\mathrm{U}}$ as $\mathcal{D}^{\mathrm{R}}=\{(\bm{x}_{i},y_{i})\|\bm{x}_{i}\!\sim\!\mathcal{P}_{
\mathcal{X}}^{\mathrm{R}},y_{i}\!\sim\!\mathcal{P}_{\mathcal{Y}}^{\mathrm{R}}
\}_{i=1}^{N^{\mathrm{R}}}$. To achieve effective unlearning, the most direct way is to retrain another randomly initialized model from scratch with the retained dataset $\mathcal{D}^{\mathrm{R}}$. However, when the target model becomes larger and requires more training data, such training from scratch consumes a large volume of computation resources. Many approximation approaches have been proposed to reduce such high computational overhead, which we will discuss in Section VII. These approaches share the same objective, which is to remove the memorization about $\mathcal{D}^{\mathrm{U}}$ from the target model $M_{\Theta}$ while retaining the performance on $\mathcal{D}^{\mathrm{R}}$,

$$ $\displaystyle\min_{\Theta^{\prime}}\mathbf{I}(M_{\bm{x}\in\mathcal{D}^{\mathrm {U}}}(\bm{x},\Theta);M^{\prime}_{\bm{x}\in\mathcal{D}^{\mathrm{U}}}(\bm{x}, \Theta^{\prime}))$ (1) $\displaystyle\max_{\Theta^{\prime}}\mathbf{I}(M_{\bm{x}\in\mathcal{D}^{\mathrm {R}}}(\bm{x},\Theta);M^{\prime}_{\bm{x}\in\mathcal{D}^{\mathrm{R}}}(\bm{x}, \Theta^{\prime})),$ $$

where $\mathbf{I}(\cdot;\cdot)$ calculates the mutual information between two random variables and $M^{\prime}$ parameterized on $\Theta^{\prime}$ denotes the target model during and after unlearning.

### II-B Large Language Models

Large Language Models (LLMs) have revolutionized the field of natural language processing (NLP) by achieving unprecedented performance on a wide range of tasks [, ]. Among the mainstream LLMs, models such as Google’s Gemini [] and Meta’s LLaMA-3 [] have set new benchmarks in various applications. These models are built with well-crafted architectures and have been trained on vast amounts of data, enabling them to understand and generate human-like text with remarkable quality.

The training data for LLMs is vast and diverse. For instance, GPT-3 was trained on 45 TB of text data [], which includes content from Wikipedia, Common Crawl, and various repositories. Such massive data allows the models to capture the intricacies of human language, covering a wide range of topics. The scale of training data ensures that LLMs are exposed to diverse linguistic patterns and contextual nuances, which are critical for their performance on various tasks, including translation, sentiment analysis, and question-answering. Their ability to generate coherent and contextually relevant text makes them valuable tools for applications like content creation, customer support, and educational tools.

The underlying architecture of LLMs is predominantly based on the transformer model. Introduced by Vaswani et al. [], the transformer architecture is characterized by using self-attention mechanisms and parallel processing capabilities. The basic components of the transformer model include an encoder and a decoder, each comprising multiple layers of attention and feed-forward neural networks. The self-attention mechanism enables the model to weigh the importance of different words in a sentence relative to each other, capturing long-range dependencies and contextual relationships effectively. In recent years, the decoder-only architecture (GPT [], LLaMA [, ]) has become more popular than the encoder-decoder (T5 [], BART []) or encoder-only (BERT []) design, thus being adopted by the mainstream LLMs.

## III Problem Setting and Motivation

### III-A System Goals

#### III-A 1 Unlearning Scenarios

This work considers three application scenarios of unlearning for LLMs.

- •
There are some malicious, toxic, and harmful samples in the training data of the target model. Such data can incur model performance degradation, implant harmful backdoors, and disclose model and data privacy. This scenario happens when encountering errors during data collection and labeling as well as adversarial attacks during model training and tuning. In this case, unlearning can be leveraged to remove these malicious samples to mitigate their impact on the model and legal data.
- •
LLMs may provide various services including question-answering, personal dialog, artistic creation, etc. The performance of LLMs on these tasks relies on a large volume of data that is often highly related to individual privacy and intellectual property. Although people may not initially know how their data was included in the LLM training, once they become aware, they may request the data to be deleted from the LLM through unlearning. For example, writers can request data deletion if they find ChatGPT has learned their literature without authorization, and daily users can request the removal of their dialog history with ChatGPT.
- •
As time goes on, the knowledge that has been learned by an LLM may become incorrect, outdated, or biased, which hurts the model performance. This is unavoidable as new knowledge and information evolve. In this case, unlearning can be used to correct and update such information to make sure that the LLM evolves accordingly as well.

**TABLE I: The examples and information of the used Question Answering datasets in the empirical study.**
| Unlearning Dataset | Utility Dataset |  |  |  |  |
| --- | --- | --- | --- | --- | --- |
| Name | Example | Continual Unlearning Setup | Name | Example | Quantity |
| ScienceQA | C: A baby wants to know what<br>is inside of a cabinet. Her hand<br>applies a force to the door, and<br>the door opens.<br>Q: Which type of force from the<br>baby’s hand opens the cabinet?<br>O: (A) pull (B) push<br>A: The answer is A | Data: biology - physics -<br>chemistry - economics<br>Quantity: 1192 - 595 -<br>403 - 237 | CommonsenseQA | Q: Where can I stand on a river to see<br>water falling without getting wet?<br>O: (A) waterfall (B) bridge (C) valley (D) stream (E) bottom<br>A: The answer is B | 1140 |
|  | OpenbookQA | Q: Poison causes harm to which of the following?<br>O: (A) a tree (B) a robot (C) a house (D) a car<br>A: The answer is A | 500 |  |  |

#### III-A 2 Practicality

This work addresses the practicality of LLM unlearning in the following aspects.

- •
Data Availability. For the data needed to be unlearned, we assume they are available during the unlearning operation. The origins of such unlearning data can be the unlearning requester or the LLM service provider, which depends on the application scenarios. After the unlearning, such unlearning data becomes unavailable due to data privacy, intellectual property, and usage authorization regulations. Similarly, the retained training dataset of the target LLM cannot be assumed to be entirely available during unlearning due to these regulations. In addition to the raw data, we assume there is no task label for the unlearning and retained datasets, though there might be some in practice.
- •
Continual Unlearning. In real-world applications, the LLM unlearning requests emerge continuously over time. For instance, attackers launch adversarial attacks when LLM continuously learns new data; daily users periodically want to delete dialog history; the knowledge becomes outdated and incorrect over time. To deal with these continuous unlearning requests, the LLM unlearning should be operated effectively and, more importantly, alleviate the cumulative catastrophic utility loss. The utility implies that the LLM’s performance on other tasks that are disjoint from the unlearning requests.
- •
Computation Efficiency. Although existing LLM unlearning methods may adopt various approximation approaches rather than retraining to reduce the computation overhead, there are further efforts that can enhance efficiency. Given that LLMs are typically built upon large-scale transformers, unlearning does not have to be conducted across the entire model. Instead, a better choice is to adopt some parameter-efficient fine-tuning (PEFT) strategies [, ] to reduce the computation cost. Moreover, reducing or eliminating the use of the retained dataset also improves efficiency, especially considering the challenges in accessing the entire retained training data due to various regulations mentioned above. Adopting the PEFT strategy at the model level and minimizing the use of the retained dataset at the data level is particularly beneficial for efficiency, given the cumulative computation overhead in responding to continual unlearning requests.

### III-B Problem Formulation

Let us extend the standard machine unlearning setups to our problem, especially considering the above practicality requirements. Here, we consider a sequence of continually arriving unlearning requests with corresponding datasets with $N^{\mathrm{U},t}$ samples, i.e., $\{\mathcal{D}^{\mathrm{U},t}\}_{t=1}^{T}$ where $\mathcal{D}^{\mathrm{U},t}=\{\bm{x}_{i}\|\bm{x}_{i}\sim\mathcal{P}_{\mathcal{X
}}^{\mathrm{U},t}\}_{i=1}^{N^{\mathrm{U},t}}$ and $\mathcal{P}_{\mathcal{X}}^{\mathrm{U},t}$ is the input marginal distribution. Note that we don’t require the task labels for the unlearning set. In addition, considering the unavailability of the retained training set, especially assuming the target model $M_{\Theta}$ is LLM, we assume there is no dataset available for retaining the model performance on the original training distribution. Moreover, we believe the unlearning should be conducted at a more general distribution level. In this case, the objective of practical unlearning for LLM is

$$ $\displaystyle\sum_{t=1}^{T}\min_{\Theta^{t}}\mathbf{I}(M_{\bm{x}\sim\mathcal{P }_{\mathcal{X}}^{\mathrm{U},t}}(\bm{x},\Theta);M^{t}_{\bm{x}\sim\mathcal{P}_{ \mathcal{X}}^{\mathrm{U},t}}(\bm{x},\Theta^{t}))$ (2) $\displaystyle\sum_{t=1}^{T}\max_{\Theta^{t}}\mathbf{I}(M_{\bm{x}\sim\mathcal{P }_{\mathcal{X}}^{\mathrm{R},t}}(\bm{x},\Theta);M^{t}_{\bm{x}\sim\mathcal{P}_{ \mathcal{X}}^{\mathrm{R},t}}(\bm{x},\Theta^{t})),$ $$

where $M^{t}$ parameterized on $\Theta^{t}$ represents the target model during and after unlearning on the $t$-th unlearning set $\mathcal{D}^{\mathrm{U},t}$. $\mathcal{P}_{\mathcal{X}}^{\mathrm{R},t}$ here is the input marginal distribution of the retained training dataset though it is unavailable during unlearning, and it is disjoint with previous unlearning requests and includes the marginal distribution of future unlearning requests, i.e., $\forall i\in[1,t],\mathrm{supp}(\mathcal{P}_{\mathcal{X}}^{\mathrm{U},i})\cap
\mathrm{supp}(\mathcal{P}_{\mathcal{X}}^{\mathrm{R},t})=\emptyset$ and $\forall i\in(t,T],\mathrm{supp}(\mathcal{P}_{\mathcal{X}}^{\mathrm{U},i})
\subset\mathrm{supp}(\mathcal{P}_{\mathcal{X}}^{\mathrm{R},t})$ where $\mathrm{supp}(\cdot)$ denotes the support set of a distribution.

### III-C Motivating Empirical Study

In this section, we use a motivating empirical study to present the challenges posed by the practicality requirements of data availability and continual unlearning. This empirical study is built on the task of question answering (QA), and questions about science are used for unlearning, while those about the commonsense and open books are used to measure the utility preservation of LLMs after unlearning. Specifically, the setups of the empirical study are as follows,

- •
*Datasets.* ScienceQA [] is collected from elementary and high school curricula containing 21,208 multimodal multiple-choice sentence questions. We focus on textual inputs and gather text-only samples to form a training and testing set with 6,508 and 2,224 samples, respectively. CommonsenseQA [] contains 9,740 training samples and 1,221, validation samples. This dataset is designed to evaluate the commonsense reasoning capability of LLMs. OpenbookQA [] can assess the book reading and comprehension ability of LLMs. It consists of 5,957 multiple-choice elementary-level questions with 4,957 training, 500 validation, and 500 testing samples. To simulate the continual unlearning scenarios, we choose four domains in ScienceQA as four unlearning requests, i.e., biology $\rightarrow$ physics $\rightarrow$ chemistry $\rightarrow$ economics. We provide some examples and more information of these datasets in Table I.
- •
*Baseline Approaches.* We implement a comprehensive set of state-of-the-art language model unlearning approaches: Efficient Unlearning (EUL) [], Preference Optimization (PO) [], Second Order Gradient Difference (SOGD) [], and Preference Optimization (SOPO) []. The performance of the original model without any unlearning is denoted as ‘Base’. Note that we don’t include the basic unlearning approaches like Gradient Ascent (GradAsc) [] and Gradient Difference (GradDif) [] as they have been proven much more unpractical than the above approaches in terms of unlearning effectiveness and utility preservation. Besides, we also find that Negative Preference Optimization (NPO) [], another recent LLM unlearning approach, cannot achieve effective unlearning in continuous scenarios, thus omitting it in the empirical study.

Figure: Figure 1: The performance of state-of-the-art unlearning approaches on the testing data from the retained distribution after unlearning the last request of ScienceQA when they are allowed to access the retained dataset with varying quantities.
Refer to caption: x1.png

Figure: Figure 2: The performance of state-of-the-art unlearning approaches on the testing data from the retained distribution after unlearning the last request of ScienceQA when they are allowed to access the retained dataset containing varying ratios of samples from the retained and irrelevant distributions.
Refer to caption: x2.png

#### III-C 1 Impact of Retained Dataset Availability

As mentioned in the practicality of Data Availability, full access to the entire retained training dataset of LLM is often impossible. Following existing LLM unlearning studies, we view the data drawn from similar and relevant input and task distributions to the unlearning datasets as the retained dataset, which receives the most direct and profound influence from the unlearning. In the empirical study, for example, the retained dataset is the residual samples of ScienceQA except for the biology at the 1st unlearning request. To demonstrate the importance of the retained dataset, we conduct experiments in terms of data quantity and distribution as follows.

Retained Data Quantity.
We randomly select 100%, 80%, 60%, 40%, 20%, 10%, 5%, 1%, and 1 sample(s) from the original retained dataset to construct the new retained datasets. Then, baseline unlearning approaches use these retained datasets for continual unlearning requests. Figure 1 presents the QA accuracy on the testing data drawn from the same distribution of the original retained dataset after the last unlearning request. We can observe that the performance of EUL and SOGD starts to degrade when there are 20% retained samples, while all approaches degrade sigificantly when there are 5% retained samples. Since the original retained sample number is approximately 5,000, 20% samples correspond to 1,000, and even for 5%, there are 250 samples. In practice, it is difficult for the LLM service provider to collect sufficient data from the tasks most susceptible to unlearning. The difficulties lie in several facets. First, characterizing and localizing the tasks susceptible to unlearning is difficult (please refer to Section VI-B for more discussion). Second, their corresponding data may be limited. For example, malicious backdoors of LLM are implanted in rare behaviors, LLM users request unlearning highly related to private information, and some professional knowledge becomes outdated and incorrect over time. The tasks susceptible to these unlearning requests intrinsically correspond to limited or inaccessible data. Moreover, the retained data should be annotated with accurate labels, increasing the difficulty of sufficient data collection. In conclusion, the existing language model unlearning approaches cannot work effectively with limited retained data, which is common in practical LLM unlearning applications.

Retained Data Distribution.
As the data from similar distributions to the unlearning requests is hard to acquire, one of the possible solutions is to leverage the data from other irrelevant distributions. We substitute 20%, 40%, 60%, 80%, 90%, 95%, 99%, and 100% original retained data of ScienceQA with equal numbers of samples from CommonsenseQA to conduct the experiments. Figure 2 depicts the QA accuracy on the testing retained dataset of ScienceQA after unlearning the last request. It is easy to observe that all baseline approaches drop significantly when 90% retained samples come from non-ScienceQA. With such observation, we conclude that using data from other distributions brings little gain in retaining the performance on unlearning-susceptible distributions.
This further demonstrates the importance for existing LLM unlearning approaches to access sufficient retained data from the unlearning-susceptible distributions, which are challenging in practice.

Figure: Figure 3: The performance of state-of-the-art unlearning approaches on the testing data of CommonsenseQA, after unlearning each request of ScienceQA.
Refer to caption: x3.png

Figure: Figure 4: The performance of state-of-the-art unlearning approaches on the testing data of OpenbookQA, after unlearning each request of ScienceQA.
Refer to caption: x4.png

#### III-C 2 Cumulative Catastrophic Utility Forgetting

In addition to the tasks most susceptible to unlearning, the model utility on all other tasks and distribution encounters catastrophic forgetting in varying degrees. With the continuously arriving unlearning requests, catastrophic forgetting is accumulating. Therefore, even if the utility loss of a single unlearning operation may be marginal, the cumulative loss from multiple unlearning requests could be significant. In our empirical study, we investigate the performance change of CommonsenseQA and OpenbookQA when unlearning the requests from ScienceQA, as shown in Figures 3 and 4, respectively. We can observe a sharp accuracy drop for EUL and SOGD on both CommonsenseQA and OpenbookQA, even after unlearning the first request. Although the performance degrading trend of PO and SOPO is slower, their cumulative accuracy reduction at the fourth request achieves 20% on CommonsenseQA and 30% on OpenbookQA. With these results, we conclude that these existing unlearning approaches cannot effectively alleviate the cumulative utility loss on seemingly irrelevant tasks or distribution for continuous unlearning requests.

## IV Methodology

Figure: Figure 5: The overview of our O^3 framework to achieve practical LLM unlearning including two major components: an Out-Of-Distribution (OOD) module is used to detect whether the input contains the unlearning knowledge and an Orthogonal optimization process for unlearning requested knowledge. The OOD module is trained by a novel contrastive entropy loss ($\mathcal{L}_{\mathrm{CEL}}$) and works with a layer-aggregated scoring mechanism that leverages cosine similarity ($\mathrm{d}_{\mathrm{Cos}}$) and Mahalanobis distance ($\mathrm{d}_{\mathrm{Maha}}$). The unlearning knowledge optimization uses the orthogonal loss ($\mathcal{L}_{\mathrm{Orth}}$) to prevent interference among different unlearning requests. In the inference phase, the OOD module decides whether and to what extent to load the unlearning LoRA.
Refer to caption: x5.png

Overview. To achieve practical unlearning for LLM, we propose a framework called O^3 that contains two major modules: an OOD detector-like module to detect unlearning knowledge and an Orthogonal LoRA module to unlearn requested knowledge continually, detailed in Sections IV-A and  IV-B, respectively. O^3 obtains the unlearning knowledge detection module by the contrastive entropy minimization and local-global layer-aggregated scoring techniques, which can predict the probability that the input data sample belongs to the unlearning distribution $\mathcal{P}^{\mathrm{U},t}_{\mathcal{X}}$. O^3 continuously unlearns the requested data using LoRA with an orthogonal regularization loss that can maintain continuous unlearning performance. These two major modules only use the unlearning dataset of each unlearning request and do not require any other data. Notably, only the LoRA is optimized during unlearning. Above all, O^3 framework meets all practicality requirements as outlined in Section III-A2: 1) it eliminates the need for retained data, 2) supports continual unlearning, and 3) enhances computational efficiency. We also supplement O^3 with an effective inference mechanism (Section IV-C), in which O^3 loads the unlearning LoRA with soft weights originating from the probability predicted by the OOD module.

### IV-A Unlearning Knowledge Detection

In regular setups of unlearning, especially assuming that the retained dataset $\mathcal{D}^{\mathrm{R}}$ is available, it is easy to train some binary classifiers with supervised learning to distinguish $\mathcal{P}_{\mathcal{X}}^{\mathrm{U}}$ and $\mathcal{P}_{\mathcal{X}}^{\mathrm{R}}$. However, such binary classifiers are highly specific and over-fitted to training data and cannot be generalized to detect all data distributions different from the unlearning one. Besides, as introduced previously in Section III-A2, accessing the entire retained training dataset during unlearning is usually impossible, especially assuming $\mathcal{D}^{\mathrm{R}}$ is huge for LLM. Therefore, we should try to develop an unlearning knowledge detection module with only the unlearning dataset $\mathcal{D}^{\mathrm{U}}$. Fortunately, by viewing the unlearning dataset as in-distribution (ID) data, our task of unlearning knowledge detection becomes an OOD detection problem []. However, nearly all existing OOD detection works are built upon the classification problem, which is not the mainstream task of language models. Besides, their representation learning and scoring mechanisms rely on semantic category labels that are inaccessible in our problem. To tackle these shortcomings, we propose new designs for the representation learning and scoring mechanism to achieve unsupervised OOD detection for LLM practical unlearning.

#### IV-A 1 Contrastive Entropy Minimization

In unsupervised scenarios, self-supervised learning (SSL) is the most prevalent approach for learning meaningful semantic representations. For example, contrastive learning, such as SimCLR [] and MoCo [], as a representative SSL approach, has been demonstrated effectively to learn representations for OOD detection on visual data [, ]. However, regular contrastive learning is not suitable for learning representations of language OOD detection. The reason is that SimCLR needs stochastic data augmentation to build positive and negative pairs, but such data augmentation is hard to achieve on text data. As for MoCo, it manages a key feature memory bank to achieve contrastive comparison. It should be enlarged quite a lot for text data, as each token of a text sequence has a representation. Such a high storage cost disobeys our wish for efficiency improvement. Considering these issues, we propose a novel contrastive entropy loss for learning text representations.

The first step for our contrastive entropy is to generate the augmentation views. Inspired by Masked Language Modeling (MLM), we leverage random masking to generate the first view type. Specifically, for a particular text instance $\bm{x}$ with the token length $n$, we randomly select $p\%$ ($p\!=\!15$ in our implementation) tokens and replace them with the token of $[\mathrm{MASK}]$. The instance with the random masking is denoted as $\bm{x}^{*}$. Before introducing the other type of augmentation view, let us first talk about the OOD detector backbone, which is a small pre-trained model $F$ parameterized on $\Omega$ (Roberta [] is used in our implementation). $F$ is assumed to be a transformer model consisting of $L$ attention layers, i.e., $F:=f_{\omega_{1}}\circ\cdots f_{\omega_{l}}\circ\cdots f_{\omega_{L}}$. Then, for the second type of contrastive view, we follow MoCo to maintain a key encoder $F_{\Omega^{\mathrm{key}}}$ initialized from $F_{\Omega}$, which is updated in momentum,

$$ $\Omega^{\mathrm{key}}=\beta\Omega+(1-\beta)\Omega,$ (3) $$

where $\beta=0.999$ controls the updating speed. The second contrastive view is generated from $F_{\Omega^{\mathrm{key}}}$ by forwarding the original text instance $\bm{x}$.
Our contrastive entropy loss shares similar intuition with the standard contrastive learning, i.e., aligning positive pairs as close as possible while pushing negative pairs far away, but converges much faster owing to weighting by cosine similarity-based Softmax probability and being conducted at every model layer. In the mini-batch training, our contrastive entropy loss shapes like

$$ $\displaystyle\mathcal{L}_{\mathrm{CEL}}\!=\!-\sum_{i=1}^{N^{B}}\sum_{l=1}^{L} \sum_{j=1}^{N^{B}}\Delta(i,l,j)\log(\Delta(i,l,j))$ (4) $\displaystyle\text{where}\,\Delta(i,l,j)\!=\!\frac{\exp(f_{\omega_{[1:l]}}(\bm {x}_{i}^{*})\cdot f_{\omega^{\mathrm{key}}_{[1:l]}}(\bm{x}_{j}))}{\sum_{k=1}^{ N^{B}}\exp(f_{\omega_{[1:l]}}(\bm{x}_{i}^{*})\cdot f_{\omega^{\mathrm{key}}_{[ 1:l]}}(\bm{x}_{k}))}.$ $$

where $f_{\omega_{[1:l]}}(\bm{x}_{i}^{*})$ means the outputted representation of the $l$-th layer, and more precisely, we use the token averaging representation. $N^{B}$ is the sample quantity of a mini-batch. The convergence condition of entropy loss is known to be that one dimension holds the probability of 1, corresponding to the state that the maximum similarity between positive pairs ($f_{\omega_{[1:l]}}(\bm{x}_{i}^{*}),f_{\omega^{\mathrm{key}}_{[1:l]}}(\bm{x}_{i})$). At this moment, the similarity among negative pairs ($f_{\omega_{[1:l]}}(\bm{x}_{i}^{*}),f_{\omega^{\mathrm{key}}_{[1:l]}}(\bm{x}_{j
})\,\text{where}\,i\!\neq\!j$) is minimized. Considering the forgetting of the pre-trained knowledge, we also supplement $\mathcal{L}_{\mathrm{CEL}}^{t}$ with the MLM loss,

$$ $\displaystyle\mathcal{L}_{\mathrm{MLM}}=-\frac{1}{N^{B}}\sum_{i=1}^{N^{B}}y_{i }^{*}\log F_{\Omega}(\bm{x}_{i}^{*}),$ (5) $\displaystyle\mathcal{L}_{\mathrm{OOD}}=\mathcal{L}_{\mathrm{CEL}}+\mathcal{L} _{\mathrm{MLM}},$ $$

where $y^{*}$ is the random token masking label and $\mathcal{L}_{\mathrm{OOD}}$ is the total loss for OOD detector representation learning.

When dealing with the continually arriving unlearning requests, we first randomly divide the unlearning dataset $\mathcal{D}^{\mathrm{U},t}$ into two subsets $\mathcal{D}^{\mathrm{U},t}_{\mathrm{used}}$ and $\mathcal{D}^{\mathrm{U},t}_{\mathrm{rest}}$ with $\alpha N^{\mathrm{U},t}$ and $(1-\alpha)N^{\mathrm{U},t}$ samples ($\alpha=80\%$ in our implementation), respectively. Then $\mathcal{D}^{\mathrm{U},t}_{\mathrm{used}}$ is used to compute $\mathcal{L}_{\mathrm{OOD}}^{t}$ and train the OOD detector backbone $F_{\Omega}$. To reduce the storage and computation cost, we adopt a Low-rank adapter (LoRA) [] $r_{F}^{t}$ to be optimized with $\mathcal{L}_{\mathrm{OOD}}^{t}$ for each unlearning request.

#### IV-A 2 Local-Global Layer-Aggregated Scoring

We design a layer-aggregated scoring mechanism to leverage the representation learned by our contrastive entropy loss fully. For the high-level picture of this mechanism, on the one hand, we assume the representations of all ID data form a global Gaussian distribution at each model layer and leverage Mahalanobis Distance [] to quantify the chance of outliers. On the other hand, the assumption of Gaussian distribution may not be accurate, especially when the available ID data is few-shot or biased, thus we emphasize each ID data instance and compute instance-wise cosine similarity locally. Then let us introduce this mechanism in detail. Specifically, at each unlearning request $t$ (we omit $t$ below), for each model layer $f_{\omega_{l}}$, we calculate the empirical mean and covariance approximations on the representations of the subset $\mathcal{D}^{\mathrm{U}}_{\mathrm{used}}$,

$$ $\displaystyle\mu_{l}\!=\!\frac{1}{\alpha N^{\mathrm{U}}}\!\sum_{i=1}^{\alpha N ^{\mathrm{U}}}f_{\omega_{[1:l]}}(\bm{x}_{i}^{\mathrm{U}})$ (6) $\displaystyle\Sigma_{l}\!=\!\frac{1}{\alpha N^{\mathrm{U}}}\!\sum_{i=1}^{ \alpha N^{\mathrm{U}}}(f_{\omega_{[1:l]}}(\bm{x}_{i}^{\mathrm{U}})\!-\!\mu_{l} )(f_{\omega_{[1:l]}}(\bm{x}_{i}^{\mathrm{U}})\!-\!\mu_{l})^{\top}.$ $$

With the empirical estimations, we can calculate the Mahalanobis Distance for each testing sample $\bm{x}$ at the $l$-th layer,

$$ $\mathrm{d}_{\mathrm{Maha}}(\bm{x})_{l}=(f_{\omega_{[1:l]}}(\bm{x})-\mu_{l})^{ \top}\Sigma_{l}^{-1}(f_{\omega_{[1:l]}}(\bm{x})-\mu_{l}),$ (7) $$

where $\Sigma_{l}^{-1}$ is the inverse of $\Sigma_{l}$. The Mahalanobis Distance measures the probability density of $f_{\omega_{[1:l]}}(\bm{x})$ in the estimated Gaussian distribution of the $l$-th layer.

As aforementioned, assuming Gaussian distributions for all layers are arbitrary, thus we leverage instance-wise cosine similarity to enhance each ID instance’s role in the scoring mechanism. Moreover, using cosine similarity takes advantage of the preceding representation learning as $\mathcal{L}_{\mathrm{CEL}}$ is also based on cosine similarity. To do so, we have another score as the maximum cosine similarity of a testing sample $\bm{x}$ to all ID instances in $\mathcal{D}^{\mathrm{U}}_{\mathrm{used}}$ in the representation space of each layer,

$$ $\mathrm{d}_{\mathrm{Cos}}(\bm{x})_{l}\!=\!-\max_{i=1}^{\alpha N^{\mathrm{U}}} \left\{\frac{f_{\omega_{[1:l]}}(\bm{x})\cdot f_{\omega_{[1:l]}}(\bm{x}_{i}^{ \mathrm{U}})}{|f_{\omega_{[1:l]}}(\bm{x})||f_{\omega_{[1:l]}}(\bm{x}_{i}^{ \mathrm{U}})|}\right\}.$ (8) $$

Then, we combine these two types of distance,

$$ $s(\bm{x})_{l}=\mathrm{d}_{\mathrm{Maha}}(\bm{x})_{l}+\gamma\cdot\mathrm{d}_{ \mathrm{Cos}}(\bm{x})_{l},$ (9) $$

where $\gamma\!=\!1000$ is a scaling factor that unifies the order of magnitude. In the end, to achieve effective OOD detection, a module is needed that allows us to determine the score range of ID and OOD data. Inspired by Yu and Darrin, et al. [, ], we leverage one-class SVM (OCSVM) based on the layer-aggregated score vector $\bm{s}(\bm{x})=[s(\bm{x})_{1},\cdots,s(\bm{x})_{l},\cdots,s(\bm{x})_{L}]$ to detect OOD data. In OOD detection, OCSVM specifies a hypersphere instead of a hyperplane to characterize the ID data. As the score of each model layer is a scalar, the concatenated score vector conforms to hypersphere distribution. Besides, OCSVM cannot work in high-dimensional space such as the representation space of deep models, thus our scoring mechanism can be interpreted as an effective dimension reduction technique to prepare a discriminatory feature space for OCSVM.

When dealing with each unlearning request, after conducting representation learning in Section IV-A1, we calculate the layer-aggregated score vector $\bm{s}(\bm{x})$ for all samples in $\mathcal{D}^{\mathrm{U},t}_{\mathrm{used}}$. Then use these score vectors to fit an OCSVM with the fitted hypersphere $\mathcal{H}^{t}(\bm{c}^{t},R^{t})$ characterized by a center vector $\bm{c}^{t}$ and the radius $R^{t}$. The OCSVM then can provide a hard label implying whether the input belongs to the unlearning distribution. As for how to leverage this OCSVM to predict the probability of the input belonging to the unlearning distribution, please refer to Section IV-C. Note that in addition to the score vectors of $\mathcal{D}^{\mathrm{U},t}_{\mathrm{used}}$, we also need to calculate the score vectors of $\mathcal{D}^{\mathrm{U},t}_{\mathrm{rest}}$, and store all these vectors somewhere as we cannot access the unlearning data after the unlearning (the practicality requirement about data availability in Section III-A2).

### IV-B Unlearning Knowledge Optimization

As the model size of LLM is usually quite large, the associated costs of fine-tuning are extremely massive. Moreover, the continuously appearing unlearning requests further escalate such costs. Besides, continual fine-tuning of the entire LLM also poses challenges of preserving the model’s general capabilities and sustaining the efficacy of previous unlearning efforts []. To address these issues, we use the LoRA technique, which can effectively reduce the cumulative cost of practical unlearning for LLM. Additionally, we incorporate an orthogonal regularization to separate LoRA updates of each unlearning request. This regularization ensures that previously focused parameters are less updated in future unlearning requests, thereby preserving the integrity and effectiveness of earlier unlearning efforts.

#### IV-B 1 Unlearning with LoRA

Before delving into the unlearning process, we briefly introduce LoRA. It employs low-rank matrix decomposition to reduce the number of parameters required for fine-tuning. The attention or linear layer in a transformer, for instance, the target LLM $M_{\Theta}$ in our problem, is parameterized on one or multiple weight matrices. For each weight matrix $W\!\in\!\mathbb{R}^{U\times V}$, LoRA introduces two low-rank trainable matrices $r:=\{A,B\}$ where $A\in\mathbb{R}^{U\times K}$ and $B\in\mathbb{R}^{K\times V}$. This ensures that the dimension of $AB\bm{h}$ matches that of $W\bm{h}$ where $\bm{h}$ is the input of the weight matrix,

$$ $\bm{h}^{\prime}=W\bm{h}+\triangle W\bm{h}=W\bm{h}+AB\bm{h},$ (10) $$

where $\bm{h}^{\prime}$ is the output of the weight matrix. The matrix $A$ is initialized with a random Gaussian distribution $\mathcal{N}(0,1)$, while matrix $B$ is initialized as zeros. By setting $K\ll\min(U,V)$, the total number of parameters in matrices $A$ and $B$ combined is significantly fewer than those in matrix $W$. During LoRA fine-tuning, $W$ is frozen, and only $A$ and $B$ are updated. This technique updates much fewer parameters than fine-tuning the entire LLM, yet still presents reasonable performance.

To achieve effective unlearning, we leverage preference optimization to update the model for random task labels or reject-based or irrelevant answers such as ‘I don’t know’, termed as $\hat{y}$. We adopt CrossEntropy Loss computed on the unlearning set $\mathcal{D}^{\mathrm{U},t}$ for each stage to update the LoRA $r$ while freezing the target model $M_{\Theta}$,

$$ $\mathcal{L}_{\mathrm{CE}}^{t}=-\frac{1}{N^{\mathrm{U},t}}\sum_{i=1}^{N^{ \mathrm{U},t}}\hat{y}_{i}^{\mathrm{U},t}\log M_{\Theta}(\bm{x}_{i}^{\mathrm{U} ,t})$ (11) $$

#### IV-B 2 Orthogonal Regularization

To further reduce the cost during unlearning, we leverage a single LoRA for all unlearning tasks rather than employing multiple LoRAs. However, using only a single LoRA compromises the model’s general capability and degrades the performance of previously unlearned requests due to task entanglement. To address such issues, inspired by Wang, et al. [], we propose to adopt an orthogonal regularization loss to disentangle different unlearning tasks in the LoRA parameter space. Such parameter disentanglement guides the LoRA tuning to focus more on the parameters that were previously overlooked, striking a balance among different unlearning tasks. Let us introduce it in detail.

At the $t$-th unlearning request, we initialize the LoRA $r^{t}:=\{A^{t},B^{t}\}$ with the LoRA parameters of the lastest request $r^{t-1}:=\{A^{t-1},B^{t-1}\}$. These matrix $A$ can be further denoted as $A_{t-1}=[\bm{a}^{t-1,1},\cdots,\bm{a}^{t-1,K}]$ where each $\bm{a}^{t-1,k}$ is a column vector with $U$ dimensions. Note that the matrix $B$ can be regarded as the linear weights of matrix $A$. Thus, we don’t consider its interference among different requests. We view the spanned space that consists of column vectors in $A^{t}$ as the $t$-th task parameter space $\mathcal{U}^{t}$. In this case, if the LoRA parameter space of different requests achieves orthogonal, their spanned space will be

$$ $\forall\bm{u}\in\mathcal{U}^{t},\forall\bm{v}\in\mathcal{U}^{t-1},\bm{u}\cdot \bm{v}=0.$ (12) $$

Therefore, we can approximate this correlation with the following orthogonal loss,

$$ $\mathcal{L}_{\mathrm{Orth}}^{t}=\big{\|}(A^{t-1})^{\top}A^{t}\big{\|}^{2}.$ (13) $$

Initially, when $t=1$, there is no need to apply the orthogonal regularization, allowing the LoRA to update freely without constraint. As the unlearning continues, the orthogonal loss is incorporated. The total loss for the unlearning knowledge optimization at the $t$-th request is as follows:

$$ $\mathcal{L}_{\mathrm{LoRA}}^{t}=\mathcal{L}_{\mathrm{CE}}^{t}+\lambda\mathcal{ L}_{\mathrm{Orth}}^{t},$ (14) $$

where $\lambda=0.1$ is a factor used to balance the optimization guidance from $\mathcal{L}_{\mathrm{CE}}^{t}$ and $\mathcal{L}_{\mathrm{Orth}}^{t}$, and please refer to its sensitivity analysis in Section V-C.

**TABLE II: The examples and information of the used Fictitious Knowledge Generation and Intent Classification datasets.**
| Dataset Usage | Unlearning Dataset | Utility Dataset |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- |
| Name | Example | Continual Unlearning Setup | Name | Example | Quantity |  |
| Fictitious Knowledge<br>Generation | TOFU<br>-forget | Q: What is a common theme<br>in Anara Yusifova’s work?<br>A: Interpersonal relationships<br>& growth | Data: forget01 - forget05<br>- forget10<br>Quantity: 40 - 200 - 400 | TOFU<br>-Real Authors | Q: Which writer is known for<br>‘The Chronicles of Narnia’?<br>A: C.S. Lewis | 100 |
| TOFU<br>-World Facts | Q: Which Country gifted the<br>Statue of Liberty to the US?<br>A: France | 117 |  |  |  |  |
| Intent Classification | CLINC150 | Query: Move 100 dollars from<br>my savings to my checking<br>Intent: TRANSFER | Data: Domain work-travel-home<br>Quantity: 400 each request | MRPC | S1: The DVD-CCA then appealed<br>to the state Supreme Court.<br>S2: The DVD-CCA appealed that<br>decision to the U.S. Supreme Court.<br>Label: 1, equivalent | 1730 |
| RTE | S1: Oil prices fall back as Yukos<br>oil threat lifted. S2: Oil prices rise.<br>Label: 1, not entailment | 3000 |  |  |  |  |

### IV-C Soft-weighted Inference

Assuming the training of O^3 framework stops temporarily when finishing the $T$-th unlearning request, let us introduce how to leverage it during inference. Specifically, for each testing instance $\bm{x}$, it should be fed into all OOD detector backbone $\{F^{1},\cdots,F^{T}\}$ where each $F^{t}\!:=\!F\circ r^{t}_{F}$ consists of the original $F$ and the LoRA adapter $r^{t}_{F}$ of the $t$-th request. Then the layer-aggregated score vector of $\bm{x}$ for each $F^{t}$ can be computed as $\bm{s}(\bm{x})^{t}=[s(\bm{x})_{1}^{t},\cdots,s(\bm{x})_{l}^{t},\cdots,s(\bm{x}
)_{L}^{t}]$ where each $s(\bm{x})_{l}$ is calculated by Eq. 9. The score vector is forwarded to the corresponding OCSVM to obtain the distance from $\bm{x}$ to the boundary of the hypersphere $\mathcal{H}^{t}(\bm{c}^{t},R^{t})$,

$$ $\mathrm{d}_{\mathcal{H}^{t}}(\bm{x})=|\bm{s}(\bm{x})^{t}-\bm{c}^{t}|-R^{t}.$ (15) $$

As aforementioned, for the provided unlearning dataset $\mathcal{D}^{\mathrm{U},t}$ at each stage, we randomly split 80% samples into $\mathcal{D}^{\mathrm{U},t}_{\mathrm{used}}$ to train the OOD detector backbone and fit the OCSVM, while the rest $\mathcal{D}^{\mathrm{U},t}_{\mathrm{rest}}$ is used for the following soft weighting. First, for all samples of $\mathcal{D}^{\mathrm{U},t}_{\mathrm{used}}$ and $\mathcal{D}^{\mathrm{U},t}_{\mathrm{rest}}$, we calculate their $\mathrm{d}_{\mathcal{H}^{t}}$ with their layer-aggregated score vectors (that have been stored when finishing the $t$-th unlearning request) via Eq. 15 and fit two Gaussian distributions as $\mathcal{N}(\mu[\mathrm{d}_{\mathcal{H}^{t}}(\mathcal{D}^{\mathrm{U},t}_{
\mathrm{used}})],\sigma^{2}[\mathrm{d}_{\mathcal{H}^{t}}(\mathcal{D}^{\mathrm{
U},t}_{\mathrm{used}})])$ and $\mathcal{N}(\mu[\mathrm{d}_{\mathcal{H}^{t}}(\mathcal{D}^{\mathrm{U},t}_{
\mathrm{rest}})],\sigma^{2}[\mathrm{d}_{\mathcal{H}^{t}}(\mathcal{D}^{\mathrm{
U},t}_{\mathrm{rest}})])$, respectively. Then we mix these two Gaussian distributions with equal weights and denote the cumulative distribution function (CDF) as $\mathcal{P}_{\mathrm{mix}}^{t}$. Next, the probability center of the mixed Gaussian distribution can be determined as $\mathrm{d}^{0}_{\mathcal{H}^{t}}$ where $\mathcal{P}_{\mathrm{mix}}^{t}(\mathrm{d}^{0}_{\mathcal{H}^{t}})=0.5$. In the end, for each testing instance $\bm{x}$, we have the following weight that reflects how much content of $\bm{x}$ belongs to the unlearning distribution of the $t$-th request,

$$ $\displaystyle w(\bm{x})^{t}\!=\!\delta\{\zeta[1-\max(p,p^{\prime})+\min(p,p^{ \prime})]\},$ (16) $\displaystyle p\!=\!\mathcal{P}_{\mathrm{mix}}^{t}(\mathrm{d}_{\mathcal{H}^{t} }(\bm{x})),p^{\prime}\!=\!\mathcal{P}_{\mathrm{mix}}^{t}(2\mathrm{d}_{\mathcal {H}^{t}}^{0}-\mathrm{d}_{\mathcal{H}^{t}}(\bm{x})),$ $$

where $\delta$ is a Sigmoid function that scales the weight into $(0,1)$, and $\zeta=10$ is a scaling factor for more fine-grained sensitivity. After getting the weights from all OOD detectors, we adopt the maximum weight $w(\bm{x})=\max\{w(\bm{x})^{1},\cdots,w(\bm{x})^{T}\}$ to load the unlearning LoRA by modifying Eq. 10 into

$$ $\bm{h}^{\prime}=W\bm{h}+w(\bm{x})\cdot AB\bm{h}.$ (17) $$

In this case, the input $\bm{x}$ is sequentially forwarded to all attention layers of the target LLM to obtain the final inference results. A higher weight $w(\bm{x})$ implies that $\bm{x}$ is close to at least one unlearning distribution, thus we should load the unlearning LoRA. In contrast, if the weight $w(\bm{x})$ is relatively low, detaching the LoRA while using the original target model makes more sense. With this soft-weighted inference mechanism, O^3 achieves a good balance between unlearning effectiveness and utility preservation.

## V Experiments

### V-A Experimental Setups

The datasets of unlearning tasks, experimental settings, evaluation metrics, and comparison baselines are introduced below. More implementation details and additional experiment results are provided in the Appendix.

#### V-A 1 Datasets

To comprehensively evaluate the O^3 framework when facing various unlearning requests, we conduct experiments on three tasks: Question Answering, Fictitious Knowledge Generation, and Intent Classification, which directly reflect the reasoning, generative, and discriminative ability of LLM, respectively. Let us introduce the used datasets for each task below and Table II provides some examples.

- •
Question Answering. Please refer to Section III-C and Table I for detailed information on the used ScienceQA, CommonsenseQA, and OpenbookQA.
- •
Fictitious Knowledge Generation. *TOFU* [] is a recent benchmark dataset for LLM unlearning, which consists of textual information about fake authors synthesized by GPT-4. To evaluate the unlearning performance, there are three forget-sets in TOFU: ‘forget01’, ‘forget05’, and ‘forget10’, corresponding to 1%, 5%, and 10% randomly selected authors. Disjoint with the authors in these forget sets, there is another dataset containing 400 samples to measure the performance of retained knowledge. Besides, TOFU includes two datasets related to Real-world Authors and World Facts from various fields, respectively, to test the utility preservation after LLM unlearning. We naturally use these three forget-sets as three continual unlearning requests.
- •
Intent Classification. *CLINC150* [] is designed for intent classification, which comprises 150 classes across five domains, and each includes 200 training samples, 40 validation samples, and 60 testing samples. For the unlearning settings, we choose three domains most related to privacy (‘work’, ‘travel’, and ‘home’) and assume they continuously arrive as unlearning requests. To evaluate the utility preservation during the unlearning, we leverage the other two datasets – *MRPC* [] and *RTE* []. The MRPC dataset is used for paraphrase identification, which involves determining whether two sentences are semantically equivalent. The RTE is employed for textual entailment, which requires determining if one sentence logically follows from another.

#### V-A 2 Experimental Settings

Following TOFU [] and SOPO [], we use LLaMA2-7b-chat [] as the target model for TOFU and LLaMA2-7b for other datasets. To equip the target model with all knowledge of fictitious knowledge generation, we fine-tune LLaMA2-7b-chat on the entire dataset of TOFU. As for intent classification and question answering, we conduct instruct tuning with the combined datasets CLINC150-MRPC-RTE and ScienceQA-CommonsenseQA-OpenbookQA, respectively. The used OOD detector backbone model is the pre-trained Roberta-large []. All experiments are run repeatedly with three random seeds (seed 0, 1, 2), and we report the mean and standard deviation. We use the AdamW optimizer with 3e-4 as the learning rate and 128 as the batch size for combined datasets. The epochs are 10 and 20 for ScienceQA-CommonsenseQA-OpenbookQA and CLINC150-MRPC-RTE, respectively. We set the LoRA rank for all experiments to 8 and the alpha to 16.

Figure: Figure 6: Comparison between ours and other baseline approaches on U^2 Ratio that measures the trade-off between unlearning effectiveness and utility preservation.
Refer to caption: x6.png

Figure: TABLE III: Comparison between ours and other baselines on used training data quantity and trainable parameters.
Refer to caption: x7.png

Figure: (a) Retained Distribution
Refer to caption: x9.png

#### V-A 3 Evaluation Metrics

To evaluate the unlearning effectiveness, we test the model performance at every unlearning request on the unlearning data and the disjoint data drawn from the unlearning distribution, denoted as Sample-level Unlearning (S.U.) and Distribution-level Unlearning (D.U.). As for measuring the utility preservation, we consider the model performance on three distributions. The first is the distribution most susceptible to unlearning requests, which we term Retained Distribution (R.D.). Besides, there are two seemingly irrelevant data distributions for each task (question answering: CommonsenseQA and OpenbookQA; fictitious knowledge generation: TOFU-Real Authors and Word Facts; intent classification: MRPC and RTE), and we view the model performance on them as the other two measurements of utility preservation (U.1. and U.2.).
In addition, to evaluate the trade-off between unlearning effectiveness and utility preservation, we design a metric called the unlearning-utility (U^2) Ratio,

$$ $\small\text{U}^{2}\!=\!\frac{\mathrm{Acc}^{0}_{\text{S.U.}}+\mathrm{Acc}^{0}_{ \text{D.U.}}-\mathrm{Acc}^{T}_{\text{S.U.}}-\mathrm{Acc}^{T}_{\text{D.U.}}}{ \mathrm{Acc}^{0}_{\text{R.D.}}\!+\!\mathrm{Acc}^{0}_{\text{U.1.}}\!+\!\mathrm{ Acc}^{0}_{\text{U.2.}}\!-\!\mathrm{Acc}^{T}_{\text{R.D.}}\!-\!\mathrm{Acc}^{T} _{\text{U.1.}}\!-\!\mathrm{Acc}^{T}_{\text{U.2.}}},$ $$

where Acc means the accuracy, while U.1. and U.2. denote the first and the second dataset for the utility measurement. The higher the U^2 Ratio, the better the trade-off between unlearning effectiveness and utility preservation.

**TABLE IV: Performance Comparison between our O^3 and other baselines when continually unlearning TOFU-forget01, -forget05, and -forget10 in Fictitious Knowledge Generation. The unlearning effectiveness is measured by the generation accuracy of the unlearning training data and unlearning testing data, denoted as Sample-level Unlearning (S.U.) and Distribution-level Unlearning (D.U.). Utility preservation is evaluated by the generation accuracy of the data from Retained Distribution (R.D.), TOFU-Real Authors (R.A.), and World Facts (W.F.). We provide sufficient retained data for these baselines, while ours does not need any.**
| Method | Unlearning Request 1 | Unlearning Request 2 | Unlearning Request 3 |  |  |  |  |  |  |  |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| S.U.$\downarrow$ | D.U.$\downarrow$ | R.D.$\uparrow$ | R.A.$\uparrow$ | W.F.$\uparrow$ | S.U.$\downarrow$ | D.U.$\downarrow$ | R.D.$\uparrow$ | R.A.$\uparrow$ | W.F.$\uparrow$ | S.U.$\downarrow$ | D.U.$\downarrow$ | R.D.$\uparrow$ | R.A.$\uparrow$ | W.F.$\uparrow$ |  |
| Base | $85.0_{\pm 0}$ | $90.0_{\pm 0}$ | $85.8_{\pm 0}$ | $89.0_{\pm 0}$ | $86.3_{\pm 0}$ | $87.3_{\pm 0}$ | $89.3_{\pm 0}$ | $85.8_{\pm 0}$ | $89.0_{\pm 0}$ | $86.3_{\pm 0}$ | $85.3_{\pm 0}$ | $90.0_{\pm 0}$ | $85.8_{\pm 0}$ | $89.0_{\pm 0}$ | $86.3_{\pm 0}$ |
| GradAsc | $75.0_{\pm 0}$ | $85.0_{\pm 0}$ | $81.0_{\pm 0}$ | $86.0_{\pm 0}$ | $82.1_{\pm 0}$ | $17.6_{\pm 0.2}$ | $23.1_{\pm 1.1}$ | $19.0_{\pm 0}$ | $0_{\pm 0}$ | $0_{\pm 0}$ | $17.1_{\pm 0.9}$ | $14.2_{\pm 5.0}$ | $19.0_{\pm 0}$ | $0_{\pm 0}$ | $0_{\pm 0}$ |
| GradDif | $78.1_{\pm 0}$ | $84.0_{\pm 1.7}$ | $81.9_{\pm 1.6}$ | $86.7_{\pm 0.6}$ | $83.5_{\pm 0.5}$ | $62.5_{\pm 5.4}$ | $70.0_{\pm 8.7}$ | $70.4_{\pm 3.7}$ | $65.7_{\pm 7.2}$ | $77.9_{\pm 1.7}$ | $16.5_{\pm 0.3}$ | $15.2_{\pm 4.5}$ | $19.0_{\pm 0}$ | $0_{\pm 0}$ | $0_{\pm 0}$ |
| EUL | $84.1_{\pm 0.2}$ | $86.3_{\pm 0.6}$ | $86.1_{\pm 0.2}$ | $86.7_{\pm 1.5}$ | $87.1_{\pm 0.1}$ | $84.4_{\pm 0.6}$ | $90.3_{\pm 3.8}$ | $85.8_{\pm 0.3}$ | $88.0_{\pm 0}$ | $85.5_{\pm 0}$ | $80.1_{\pm 0.2}$ | $83.5_{\pm 0.5}$ | $83.4_{\pm 0.1}$ | $86.3_{\pm 1.2}$ | $83.5_{\pm 0.5}$ |
| PO | $12.5_{\pm 0}$ | $16.0_{\pm 1.3}$ | $78.4_{\pm 0.2}$ | $86.7_{\pm 2.3}$ | $83.8_{\pm 0}$ | $30.5_{\pm 2.9}$ | $48.8_{\pm 1.3}$ | $82.5_{\pm 1.2}$ | $87.3_{\pm 1.2}$ | $83.2_{\pm 0.5}$ | $38.2_{\pm 0.2}$ | $47.1_{\pm 7.3}$ | $81.4_{\pm 0.4}$ | $86.3_{\pm 0.6}$ | $84.4_{\pm 0.2}$ |
| NPO | $68.8_{\pm 3.2}$ | $75.0_{\pm 0}$ | $83.6_{\pm 0.4}$ | $89.0_{\pm 0}$ | $81.8_{\pm 0.5}$ | $76.3_{\pm 2.2}$ | $84.2_{\pm 3.8}$ | $83.2_{\pm 1.6}$ | $87.7_{\pm 0.6}$ | $84.1_{\pm 0.5}$ | $77.6_{\pm 3.9}$ | $79.2_{\pm 3.1}$ | $81.4_{\pm 0.6}$ | $87.3_{\pm 0.6}$ | $82.9_{\pm 1.7}$ |
| SOGD | $43.7_{\pm 0.1}$ | $76.0_{\pm 1.7}$ | $80.3_{\pm 0.6}$ | $85.3_{\pm 1.2}$ | $83.4_{\pm 0.7}$ | $22.8_{\pm 6.9}$ | $24.0_{\pm 3.6}$ | $79.0_{\pm 3.8}$ | $81.3_{\pm 2.1}$ | $82.6_{\pm 1.0}$ | $17.4_{\pm 0.5}$ | $21.7_{\pm 6.4}$ | $82.3_{\pm 0.3}$ | $77.0_{\pm 6.6}$ | $82.1_{\pm 1.0}$ |
| SOPO | $25.6_{\pm 1.0}$ | $38.0_{\pm 0.9}$ | $83.7_{\pm 0.3}$ | $85.3_{\pm 1.2}$ | $83.7_{\pm 1.6}$ | $34.1_{\pm 3.0}$ | $37.5_{\pm 2.6}$ | $81.5_{\pm 1.6}$ | $87.3_{\pm 1.5}$ | $83.2_{\pm 1.0}$ | $34.5_{\pm 3.0}$ | $40.0_{\pm 1.3}$ | $80.2_{\pm 1.7}$ | $86.7_{\pm 0.6}$ | $84.2_{\pm 0.8}$ |
| Ours | $12.5_{\pm 0.5}$ | $14.4_{\pm 0.5}$ | $85.1_{\pm 0.1}$ | $89.0_{\pm 0}$ | $86.3_{\pm 0}$ | $15.8_{\pm 0.3}$ | $20.3_{\pm 0.8}$ | $85.0_{\pm 0}$ | $89.0_{\pm 0}$ | $86.3_{\pm 0}$ | $15.5_{\pm 0.7}$ | $19.7_{\pm 0.7}$ | $84.9_{\pm 0.2}$ | $88.8_{\pm 0.2}$ | $86.1_{\pm 0.2}$ |

**TABLE V: Performance Comparison between our O^3 and other baselines when continually unlearning domain ‘work’, ‘travel’, and ‘home’ of CLINC150 in Intent Classification. The unlearning effectiveness is measured by the classification accuracy of the unlearning training data and unlearning testing data, which we denote as Sample-level Unlearning (S.U.) and Distribution-level Unlearning (D.U.). Utility preservation is evaluated by the accuracy of answer generation on the data from Retained Distribution (R.D.), MRPC, and RTE. We provide sufficient retained data for these baselines, while ours does not need any.**
| Method | Unlearning Request 1 | Unlearning Request 2 | Unlearning Request 3 |  |  |  |  |  |  |  |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| S.U.$\downarrow$ | D.U.$\downarrow$ | R.D.$\uparrow$ | MRPC$\uparrow$ | RTE$\uparrow$ | S.U.$\downarrow$ | D.U.$\downarrow$ | R.D.$\uparrow$ | MRPC$\uparrow$ | RTE$\uparrow$ | S.U.$\downarrow$ | D.U.$\downarrow$ | R.D.$\uparrow$ | MRPC$\uparrow$ | RTE$\uparrow$ |  |
| Base | $100.0_{\pm 0}$ | $99.9_{\pm 0}$ | $99.8_{\pm 0}$ | $88.0_{\pm 0}$ | $88.7_{\pm 0}$ | $100.0_{\pm 0}$ | $99.9_{\pm 0}$ | $99.8_{\pm 0}$ | $88.0_{\pm 0}$ | $88.7_{\pm 0}$ | $99.9_{\pm 0}$ | $99.9_{\pm 0}$ | $99.8_{\pm 0}$ | $88.0_{\pm 0}$ | $88.7_{\pm 0}$ |
| GradDif | $0.1_{\pm 0.2}$ | $0_{\pm 0}$ | $90.8_{\pm 3.4}$ | $39.9_{\pm 3.4}$ | $31.6_{\pm 5.3}$ | $0_{\pm 0}$ | $0_{\pm 0}$ | $12.7_{\pm 3.6}$ | $9.0_{\pm 3.8}$ | $0.8_{\pm 0.8}$ | $0_{\pm 0}$ | $0_{\pm 0}$ | $75.5_{\pm 4.8}$ | $12.9_{\pm 6.0}$ | $1.7_{\pm 2.1}$ |
| EUL | $0.1_{\pm 0.2}$ | $0_{\pm 0}$ | $98.3_{\pm 0.4}$ | $87.2_{\pm 0.1}$ | $88.1_{\pm 0}$ | $0.1_{\pm 0.2}$ | $0_{\pm 0}$ | $87.6_{\pm 3.3}$ | $80.3_{\pm 3.1}$ | $82.9_{\pm 3.1}$ | $0_{\pm 0}$ | $0_{\pm 0}$ | $92.3_{\pm 5.2}$ | $81.3_{\pm 2.1}$ | $76.3_{\pm 4.0}$ |
| PO | $26.3_{\pm 15.1}$ | $26.7_{\pm 14.0}$ | $99.3_{\pm 0.3}$ | $84.1_{\pm 0.2}$ | $86.3_{\pm 1.1}$ | $59.6_{\pm 3.0}$ | $59.8_{\pm 3.0}$ | $99.4_{\pm 0.2}$ | $87.3_{\pm 0.1}$ | $88.0_{\pm 0.2}$ | $56.2_{\pm 5.4}$ | $56.7_{\pm 4.8}$ | $99.0_{\pm 0.4}$ | $86.3_{\pm 0.2}$ | $87.0_{\pm 0.4}$ |
| NPO | $99.9_{\pm 0.1}$ | $99.0_{\pm 0}$ | $99.2_{\pm 0.2}$ | $87.3_{\pm 0.3}$ | $88.4_{\pm 0.4}$ | $99.9_{\pm 0.1}$ | $99.3_{\pm 0.3}$ | $99.2_{\pm 0.3}$ | $87.2_{\pm 0.7}$ | $88.9_{\pm 0.6}$ | $99.9_{\pm 0.1}$ | $99.2_{\pm 0.2}$ | $99.3_{\pm 0.1}$ | $87.0_{\pm 0.4}$ | $88.9_{\pm 0.2}$ |
| SOGD | $0_{\pm 0}$ | $0_{\pm 0}$ | $92.3_{\pm 0.9}$ | $6.1_{\pm 3.6}$ | $17.9_{\pm 6.4}$ | $0_{\pm 0}$ | $0_{\pm 0}$ | $93.1_{\pm 2.0}$ | $3.3_{\pm 3.8}$ | $19.5_{\pm 9.0}$ | $0_{\pm 0}$ | $0.1_{\pm 0.1}$ | $94.0_{\pm 1.8}$ | $2.9_{\pm 0.6}$ | $23.7_{\pm 9.9}$ |
| SOPO | $24.9_{\pm 15.6}$ | $26.3_{\pm 15.0}$ | $99.6_{\pm 0.1}$ | $85.5_{\pm 0.6}$ | $87.1_{\pm 1.1}$ | $62.3_{\pm 1.4}$ | $60.3_{\pm 1.3}$ | $99.6_{\pm 0.2}$ | $87.1_{\pm 0.2}$ | $87.7_{\pm 1.1}$ | $58.8_{\pm 15.5}$ | $59.7_{\pm 14.8}$ | $99.6_{\pm 0.3}$ | $86.6_{\pm 1.2}$ | $86.0_{\pm 1.4}$ |
| Ours | $10.3_{\pm 8.1}$ | $14.3_{\pm 0.3}$ | $98.9_{\pm 0.1}$ | $84.8_{\pm 0.1}$ | $87.5_{\pm 0.2}$ | $50.5_{\pm 0.3}$ | $55.6_{\pm 0.6}$ | $94.1_{\pm 0.8}$ | $87.0_{\pm 0.2}$ | $89.3_{\pm 0.2}$ | $40.6_{\pm 4.0}$ | $42.4_{\pm 3.8}$ | $97.8_{\pm 0.8}$ | $86.6_{\pm 1}$ | $89.0_{\pm 0.2}$ |

#### V-A 4 Comparison Baselines

To better demonstrate the effectiveness of our proposed methods, we implement a series of state-of-the-art language model unlearning approaches: GradAsc [], GradDif [], EUL [], PO [], NPO [], SOGD [] and SOPO []. We follow the default setups of these works and only conduct reasonable modifications to customize them in our practical unlearning settings.

**TABLE VI: Out-of-distribution detection performance comparison and ablation study between ours and other baseline approaches on Fictitious Knowledge Generation and Question Answering. The measurement is AUROC.**
| Task | Fictitious Knowledge Generation | Question Answering |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| ID | TOFU-forget01 | TOFU-forget02 | TOFU-forget10 | biology | physics | chemistry | economics |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
| OOD | R.D. | R.A. | W.F. | R.D. | R.A. | W.F. | R.D. | R.A. | W.F. | R.D. | C.QA | O.QA | R.D. | C.QA | O.QA | R.D. | C.QA | O.QA | R.D. | C.QA | O.QA |
| MDF | $90.5$ | $96.6$ | $97.6$ | $80.3$ | $92.7$ | $98.3$ | $91.3$ | $97.8$ | $98.8$ | $91.0$ | $94.4$ | $95.7$ | $92.8$ | $96.0$ | $97.4$ | $92.0$ | $94.3$ | $98.1$ | $94.0$ | $94.7$ | $95.5$ |
| Agg | $94.4$ | $98.0$ | $98.0$ | $81.9$ | $94.0$ | $98.5$ | $85.0$ | $97.5$ | $99.0$ | $91.1$ | $96.0$ | $95.4$ | $92.2$ | $94.5$ | $95.7$ | $91.0$ | $94.8$ | $95.0$ | $94.5$ | $96.0$ | $97.6$ |
| Ours w/ SimCLR | $96.0$ | $97.2$ | $99.0$ | $70.2$ | $76.2$ | $86.9$ | $87.9$ | $95.1$ | $99.0$ | $92.5$ | $96.0$ | $96.5$ | $93.1$ | $96.6$ | $97.6$ | $93.0$ | $95.5$ | $96.4$ | $94.2$ | $95.9$ | $96.6$ |
| Ours w/ MoCo | $95.8$ | $98.0$ | $99.1$ | $87.2$ | $92.2$ | $99.0$ | $91.3$ | $98.6$ | $99.1$ | $93.3$ | $94.2$ | $94.0$ | $92.2$ | $96.4$ | $96.0$ | $95.7$ | $97.1$ | $98.0$ | $94.2$ | $96.3$ | $97.5$ |
| Ours w/o $\mathrm{d}_{\mathrm{Cos}}$ | $90.3$ | $96.6$ | $97.6$ | $85.6$ | $92.4$ | $97.6$ | $90.7$ | $98.0$ | $99.0$ | $96.0$ | $95.5$ | $98.4$ | $96.5$ | $96.9$ | $98.8$ | $97.0$ | $97.0$ | $98.8$ | $95.9$ | $97.3$ | $98.2$ |
| Ours w/o $\mathrm{d}_{\mathrm{Maha}}$ | $97.0$ | $98.0$ | $99.0$ | $89.0$ | $93.5$ | $98.1$ | $87.5$ | $97.5$ | $98.5$ | $99.0$ | $97.8$ | $98.4$ | $99.4$ | $98.0$ | $97.2$ | $99.0$ | $97.9$ | $96.3$ | $99.0$ | $97.8$ | $97.5$ |
| Ours w/ last layer | $91.3$ | $98.0$ | $98.0$ | $75.6$ | $94.1$ | $98.8$ | $82.1$ | $97.4$ | $99.0$ | $94.4$ | $98.6$ | $97.4$ | $96.8$ | $98.9$ | $98.8$ | $97.0$ | $98.8$ | $98.0$ | $96.9$ | $97.9$ | $97.2$ |
| Ours full | $97.8$ | $99.0$ | $99.2$ | $92.5$ | $95.0$ | $99.1$ | $93.0$ | $98.8$ | $99.2$ | $99.5$ | $99.5$ | $99.4$ | $99.8$ | $99.9$ | $99.8$ | $100$ | $99.9$ | $99.8$ | $99.9$ | $99.9$ | $99.8$ |

### V-B Effectiveness of O 3 to Achieve Practical LLM Unlearning

We conduct experiments on three tasks where the LLM is unlearned with continuous requests. Note that we provide sufficient retained data for all comparison baselines while assuming our O^3 framework only uses the data of each unlearning request and does not use any retained data. For these tasks, we calculate the trade-off metric – U^2 Ratio, as shown in Figure 6. The effectiveness of O^3 is evident as it always hits the highest U^2 Ratio and significantly surpasses the second best. Beyond achieving superior performance across all tasks, our framework demonstrates enhanced data and parameter efficiency. As indicated in Table III, the quantity of training data required by our O^3 framework is only half that of the baseline models since it does not necessitate using retained data for training. Moreover, the integration of LoRA significantly reduces the number of trainable parameters in our method to just 20M, which is less than 3% of the baseline’s 6758M trainable parameters. Reducing training data and trainable parameters markedly improves computational and memory efficiency.

#### V-B 1 Question Answering

Figures 7(a) and 7(b) show the QA accuracy on the training and testing set of unlearning data from ScienceQA, which measures the Sample-level and Distribution-level unlearning effectiveness, respectively. Note that we omit the results of GradAsc as it failed to generate meaningful answers for all data types. We can easily observe that our O^3 is located at the bottom tier, with only GradDif and SOGD being lower than O^3. However, further examination of the outputs generated by GradDif, SOGD revealed that these methods produce outputs consisting of empty or nonsensical sentences filled with repeated tokens, complicating the measurement of accuracy. This is considered a form of unlearning failure, as the model fails to generate meaningful and reasonable responses to answer questions appropriately – a critical flaw for real-world applications. What’s more, the utility preservation capability of GradDif and SOGD is extremely poor, as shown in Figure 8.
In contrast, the O^3 framework can effectively maintain the model utility. Specifically, the QA accuracy of O^3 on the retained distribution is slightly lower than the base model (the original target LLM without any unlearning), and O^3 is even nearly the same as the base model on CommonsenseQA and OpenbookQA. In particular, with the continual unlearning of multiple requests, there is no utility drop for our O^3 framework. Furthermore, according to Figure 6, SOPO achieves the best trade-off between unlearning effectiveness and utility preservation among all comparison baselines. However, it is still far from our O^3 framework, which provides much more superior trade-off in unlearning effectiveness and utility preservation than all baselines.

#### V-B 2 Fictitious Knowledge Generation

Table IV presents the experiment results of continuously conducting unlearning on TOFU. According to these results, we can observe that our O^3 again achieves the best trade-off in unlearning effectiveness and utility preservation, providing the best unlearning effectiveness in almost all cases but one, and the best utility preservation in majority of cases. In the one case where O^3 is not the best for unlearning effectiveness (i.e., D.U. for unlearning request 3), the better ones GradAsc and GradDif have almost completely lost model utility and are not useful. In the cases where O^3 is not the best for utility preservation (e.g., R.D. and W.F. for unlearning request 1), the slightly better EUL performs extremely poor in unlearning effectiveness (very high S.U. and D.U. accuracy) and thus is not useful.
Moreover, according to the U^2 Ratio in Figure 6, our O^3 substantially exceeds all other baseline approaches. Note that these baseline approaches are supported by sufficient retained data, which O^3 does not use. When the retained data becomes more limited, these approaches perform even poorer (refer to the Appendix).

#### V-B 3 Intent Classification

Table V presents the experiment results of continuously unlearning the intents from the CLINC150 dataset. We have omitted the results for GradAsc due to similar issues previously encountered in the question-answering context. Additionally, we observed consistent unlearning failures with GradDif, SOGD, and EUL methods. Moreover, both GradDif and SOGD demonstrated extremely poor performance in preserving utility. In contrast, our O^3 framework achieves the best unlearning performance and maintains comparable or better results to the baselines that use retained data, both on the retained distribution and in terms of utility preservation. For instance, our O^3 framework preserves the RTE performance more effectively than all baseline methods. As shown in the U^2 Ratio in Figure 6, O^3 significantly outperforms all other baseline methods, demonstrating the superior overall capability of our approach. Besides, according to the experiments of reduced retained data in the Appendix, these baseline methods cannot work with limited retained data.

**TABLE VII: Ablation study of the unlearning knowledge optimization of O^3 framework. We adopt a series of different values for the factor $\lambda$ of Eq. 14 to validate the necessity of $\mathcal{L}_{\mathrm{Orth}}$ and analyze the sensitivity of $\lambda$. ‘C.QA’ shorts for CommonsenseQA, and ‘O.QA’ shorts for OpenbookQA.**
| Dataset | ScienceQA | CLINC150 |  |  |  |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| Metric | S.U. | D.U. | R.D. | C.QA | O.QA | S.U. | D.U. | R.D. | MRPC | RTE |
| $\lambda=0$ | $15.3$ | $18.1$ | $90.1$ | $78.1$ | $80.0$ | $33.3$ | $31.8$ | $21.8$ | $86.4$ | $89.2$ |
| $\lambda=0.01$ | $6.3$ | $11.4$ | $90.9$ | $78.1$ | $80.8$ | $33.8$ | $33.3$ | $54.5$ | $86.8$ | $88.8$ |
| $\lambda=0.05$ | $8.3$ | $13.1$ | $91.1$ | $78.3$ | $80.8$ | $33.9$ | $35.7$ | $80.8$ | $87.0$ | $89.2$ |
| $\lambda=0.1$ | $9.3$ | $14.0$ | $91.1$ | $78.5$ | $80.9$ | $35.0$ | $36.2$ | $97.0$ | $87.0$ | $88.9$ |
| $\lambda=0.2$ | $9.9$ | $14.8$ | $91.2$ | $78.5$ | $81.4$ | $51.2$ | $54.3$ | $98.5$ | $87.1$ | $88.4$ |

**TABLE VIII: Ablation study of the soft-weighted inference of O^3 framework. We adopt a hard-weighted (Hard-w) mechanism and change the scaling factor $\zeta$ of Eq. 16 to compare with the soft-weighted mechanism in O^3. ‘C.QA’ shorts for CommonsenseQA, and ‘O.QA’ shorts for OpenbookQA.**
| Dataset | ScienceQA | CLINC150 |  |  |  |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| Metric | S.U. | D.U. | R.D. | C.QA | O.QA | S.U. | D.U. | R.D. | MRPC | RTE |
| Hard-w | $38.0$ | $42.2$ | $91.3$ | $79.2$ | $83.0$ | $37.0$ | $41.2$ | $97.3$ | $87.4$ | $87.7$ |
| $\zeta=1$ | $10.0$ | $17.0$ | $91.1$ | $78.5$ | $80.8$ | $36.9$ | $40.5$ | $97.0$ | $87.0$ | $88.8$ |
| $\zeta=5$ | $9.4$ | $14.9$ | $91.1$ | $78.5$ | $80.8$ | $36.1$ | $38.5$ | $97.0$ | $87.0$ | $88.8$ |
| $\zeta=50$ | $9.3$ | $12.5$ | $90.4$ | $78.5$ | $80.8$ | $35.9$ | $37.2$ | $97.0$ | $87.0$ | $88.8$ |
| $\zeta=100$ | $9.1$ | $12.2$ | $90.0$ | $78.5$ | $80.8$ | $35.9$ | $37.2$ | $96.8$ | $87.0$ | $88.8$ |
| Ours | $9.3$ | $14.0$ | $91.2$ | $78.5$ | $80.9$ | $35.0$ | $36.2$ | $97.0$ | $87.0$ | $88.9$ |

### V-C Ablation Study

#### V-C 1 Unlearning Knowledge Detection

We implement the unlearning knowledge detection module variations in O^3 and some state-of-the-art OOD detection approaches. Specifically, we detach the contrastive entropy $\mathcal{L}_{\mathrm{CEL}}$ in O^3 and use SimCLR (‘Ours w/ SimCLR’) and MoCo (‘Ours w/ MoCo’) with the augmentation using token masking. As for the scoring mechanism, we try using Mahalanobis Distance ($\mathrm{d}_{\mathrm{Maha}}$ in Eq. 7) and Cosine Similarity ($\mathrm{d}_{\mathrm{Cos}}$ in Eq. 8) separately, which are termed as ‘Ours w/o $\mathrm{d}_{\mathrm{Cos}}$’ and ‘Ours w/o $\mathrm{d}_{\mathrm{Maha}}$’. Besides, instead of leveraging information from all model layers, we use only the last layer (‘Ours w/ last layer’). Moreover, two state-of-the-art OOD detection approaches: MDF [] and Agg [], are compared with ours. The experiments are conducted on fictitious knowledge generation and question answering where the ID data is different unlearning sets, and the OOD data is the retained test set and the utility sets. We report the AUROC in Table VI. According to these results, we can observe that the full design of our OOD detector in O^3 framework always achieves the best AUROC. Specifically, the performance drops when using SimCLR or MoCo to fine-tune the backbone model, which implies the effectiveness of our contrastive entropy loss. The AUROC differences between ‘Ours w/o $\mathrm{d}_{\mathrm{Cos}}$’ or ‘Ours w/o $\mathrm{d}_{\mathrm{Maha}}$’ and ‘Ours full’ indicate the necessity of combining the Mahalanobis and Cosine Similarity distances to achieve better discrimination. The poorer performance of ‘Ours w/ last layer’ compared with ‘Ours full’ tells us that aggregating representations of multiple layers is essentially beneficial. Besides, our methods can also substantially exceed the state-of-the-art truly unsupervised OOD detection approaches with the unlabeled ID data only (MDF [] and Agg []).

#### V-C 2 Unlearning Knowledge Optimization

In the objective of unlearning knowledge optimization (Eq. 14), there is a factor $\lambda$ balancing $\mathcal{L}_{\mathrm{CE}}$ and $\mathcal{L}_{\mathrm{Orth}}$. In this section, we adopt varying values for $\lambda$ – 0, 0.01, 0.05, 0.1, 0.2, to validate the importance of $\mathcal{L}_{\mathrm{Orth}}$ and the sensitivity of $\lambda$. We conduct experiments on question answering and intent classification and report the metrics of unlearning effectiveness and utility preservation after unlearning the last request. Table VII illustrates that employing orthogonal loss contributes to maintaining utility on the retained distribution and enhancing the unlearning effectiveness. For instance, as the $\lambda$ increases, there is a corresponding increase in the accuracy of retained data. Moreover, the performance in preserving utility on CommonsenseQA, and OpenbookQA in question answering and MRPC in intent classification also improves. Besides, we observe that orthogonal loss not only assists in preserving existing knowledge but also facilitates the unlearning process on the ScienceQA dataset.

#### V-C 3 Soft-weighted Inference

Instead of using our soft weights to load unlearning LoRA, we also test a hard weighting strategy (‘Hard-w’ in Table VIII). Specifically, after calculating the hypersphere boundary distance ($\mathrm{d}_{\mathcal{H}^{t}}$ in Eq. 15) on the unlearning set $\mathcal{D}^{\mathrm{U},t}$, we obtain the range $[\min(\mathrm{d}_{\mathcal{H}^{t}}(\mathcal{D}^{\mathrm{U},t})),\max(\mathrm{d
}_{\mathcal{H}^{t}}(\mathcal{D}^{\mathrm{U},t}))]$. Then for each testing instance $\bm{x}$, if its boundary distance $\mathrm{d}_{\mathcal{H}^{t}}(\bm{x})$ is within the above range, we chose to load the unlearning LoRA. Otherwise, we detach the LoRA. In addition, we conduct a sensitivity analysis of the scaling factor $\zeta$ in Eq. 16 with a series of values 1, 5, 50, and 100. These experiments are carried out on ScienceQA and CLINC150, and we report the performance after the last unlearning request in Table VIII. We observe that the ‘Hard-w’ method performs poorly in terms of unlearning knowledge. With an increase in the scaling factor $\zeta$, our framework enhances its ability to unlearn knowledge more effectively, both at the sample and distribution levels. However, this increase adversely affects the framework’s ability to maintain performance on the retained distribution and compromises its utility preservation. To address this, our framework adopts $\zeta$ as 10, striking a reasonable balance between effective unlearning and utility preservation.

## VI Discussion

### VI-A Future Work for Unlearning Knowledge Detection

A direct improvement related to unlearning knowledge detection lies in the inference stage. In the inference phase of O^3 framework, we need to feed the testing data into each OOD detector to calculate the likelihood of belonging to previous unlearning distributions. In practical system deployment, we can parallelize this process to enhance efficiency [].

In our implementation, the OOD detector backbone uses the encoder-only Roberta model. Although this model can extract high-quality representations, its performance is still limited when faced with complex inputs compared to larger-scale language models. Therefore, we consider directly using the target LLM to detect unlearning knowledge. This approach is feasible because, in the O^3 framework, we use LoRA as an external module to achieve unlearning, and the original target LLM is available for inference. We should gain the following benefits if we replace the OOD detector backbone with an LLM. First, LLMs can better capture subtle text differences, improving OOD detection performance. Second, smaller language models like Roberta cannot effectively extract contextual information from complex and long contexts. Thus, if an unlearning request correlates the contextual information, such as the individual users’ request to unlearn specific topics from their chat history with ChatGPT, Roberta-based OOD detection cannot achieve this. In contrast, LLMs can extract contextual information well [], supporting more fine-grained OOD detection and more accurate ID data localization. Finally, using LLMs for OOD detection might eliminate the need for fine-tuning with ID data, as Uppaal et al. [] suggested that LLMs could provide accurate OOD detection predictions for text classification without any fine-tuning. This could further improve our framework’s efficiency. However, using LLMs for OOD detection might require dedicated improvements to the scoring mechanism because mainstream LLMs now use a decoder-only architecture, which works by predicting the next token. In this case, the representation output by each attention layer of the LLM is likely to be highly inconsistent in terms of token quantity and distribution. Therefore, whether our design based on layer-wise token average representation (Section IV-A2) is suitable for LLMs requires further research.

### VI-B Data Selection for LLM Utility Preservation

In the real world, we often edit LLMs for various purposes, such as knowledge unlearning. However, this model editing leads to uncertain and unpredictable changes in the capabilities of the LLM [, , ]. For instance, recent studies have shown that model editing for a single specific task can cause performance degradation in seemingly unrelated tasks. This phenomenon is more pronounced in sequential or continual model editing [, ]. To address this issue, similar to leveraging a retained dataset to preserve model utility in LLM unlearning [], the intuitive approach is to identify which tasks and data distributions are most affected and then replay some representative data on the LLM []. However, identifying these tasks and data distributions on an LLM is extremely challenging [, , ]. For example, to select suitable retained data for utility preservation in LLM unlearning, we might utilize some interpretable machine learning (ML) techniques [] to locate the neurons activated by the unlearning data. Based on these identified activated neurons, we could retrieve similar data to be used as the retained data. However, current interpretable ML techniques typically only achieve neuron localization for specific model attributes, such as adversarial robustness [] or differential privacy []. For the fine-grained tasks and data distributions corresponding to unlearning requests, neuron localization is either inaccurate or inconsistent in granularity. Therefore, effective data selection to preserve LLM utility during unlearning is research-worthy.

## VII Related Works

Language Model Unlearning:
Regular machine unlearning [, ] is proposed to protect data privacy and ensure authorized usage, which is reflected in many regulations, such as GDPR [] and CCPA []. Recently, as LLM is evolving fast, exploring its unlearning-related problems has attracted extensive interest [, ]. There have been a few approaches to achieving unlearning through parameter optimization [, , , , , ], parameter merging [, , , ], and in-context learning [, ]. The most representative optimization-based unlearning is to employ GradAsc [, ] on the data that needs to be unlearned. More advanced approaches like PO [, , ] notice that unconstrained GradAsc does hurt the model’s utility on other data, thus PO crafts task labels through shuffling or rejection and still applies gradient descent to achieve unlearning. Parameter merging-based unlearning usually localizes the model parameters related to unlearning data [] and updates them through merging or subtracting with parameters fine-tuned by some PEFT techniques []. The in-context learning-based methods aim to achieve unlearning by adjusting the input prompt to reject unwanted content generation. Although these approaches can achieve somewhat effective unlearning in certain cases, they neglect that unlearning requests always appear continuously [] like the demands of incorporating new information through continual learning [, ]. In this setting, the critical problem is that the accumulative impact of conducting unlearning sequentially induces catastrophic model utility loss [, ]. Besides, their success in the utility preservation of a single unlearning operation relies on sufficient retained data with accurate labels, which are difficult to acquire in real-world LLM applications. Although there is a study [] that can achieve effective unlearning without the retained data, it only works on simple image classification models.

Out-of-distribution Detection:
Unlike traditional OOD detection based on one-class SVM [], random forest [], and Gaussian mixture modeling [], recently, deep learning-based OOD detection [] has become mainstream, focusing on the classification task. Such OOD detection approaches assume the availability of category-labeled ID data. However, classification tasks are not popular in natural language processing applications. Only a few studies explore unsupervised OOD detection in language models with only unlabeled ID data, which can be used for non-classification tasks. DAGMM [] uses a deep auto-encoder to generate low-dimensional representations to estimate OOD scores. However, DAGMM is only tested on multivariate time-series data. Xu, et al. [] leverage the feature extracted from each layer of a pre-trained language model and then fit an OC-SVM for detection. More recent related works search ways like ensemble learning [], pseudo labeling [], outlier exposure [], and prefix tuning [] to achieve OOD text intent detection. Although these works can achieve OOD detection over non-classification tasks, their effectiveness still relies on labels of specific tasks.

## VIII Conclusion

In this work, we tackle practical challenges in developing machine unlearning techniques for LLMs, where our empirical studies and experiments demonstrate that existing state-of-the-art LLM unlearning approaches are often impractical due to their heavy reliance on retained data and their ineffectiveness in handling continual unlearning requests. To overcome these challenges, we propose an O^3 framework that includes novel designs of an out-of-distribution detector to measure the similarity between the input and unlearning data and an orthogonal low-rank adapter for continuously unlearning requested data. Experiments across three tasks and seven datasets demonstrate that our proposed O^3 framework can achieve much more superior unlearning effectiveness and utility preservation than state-of-the-art baselines, without using any retained data when facing continuous unlearning requests.

## Appendix

### VIII-A Algorithm Pipelines

The detailed pipeline of unlearning knowledge detection is shown in Algorithm 1. At a high level, the module fine-tunes an out-of-distribution (OOD) detector backbone model on the data of the $t$-th unlearning request with contrastive entropy minimization. After that, a one-class SVM (OCSVM) is fitted with the local-global layer-aggregated scoring mechanism. The OOD detector backbone and the fitted OCSVM are used to assess the input and unlearning data similarity, which allows the O^3 framework to decide whether and to what extent to load the unlearning LoRA in the inference phase.

In addition, the soft-weighted inference of O^3 framework is shown in Algorithm 2. The soft-weighted inference leverages the OOD module to assess the similarity between the input and seen unlearning data, then decides whether and to what extent to load the unlearning LoRA.

Figure: Algorithm 1 Unlearning Knowledge Detection

Figure: Algorithm 2 Soft-weighted Inference of O^3

### VIII-B More Implementation Details

#### VIII-B 1 Instruct-tuning Details

We conducted instruction tuning [] on the LLaMA2-7b model to prepare target models for intent classification (CLINC150-MRPC-RTE) and question answering (ScienceQA-CommonsenseQA-OpenbookQA) tasks. Specifically, we adopted the question-answering pair format from the ScienceQA []. Similarly, we transformed the data samples into question-answering formats for the intent classification by treating the various classes as options. We then employed the instruction template from Alpaca [] to refine our instruction tuning training samples. Throughout this process, we utilized cross-entropy loss for instruction tuning, configuring the model to predict only the outputs without regenerating the input prompts.

#### VIII-B 2 Random Labeling for Preference Optimization

Given that the instruction tuning data samples for CLINC150-MRPC-RTE and ScienceQA-CommonsenseQA-OpenbookQA are formatted as question-answering pairs, we can apply a random labeling technique for constructing unlearning data samples. Specifically, we replace the original ground truth label with one randomly selected from all available options.
For the task of fictitious knowledge generation, we could not use random labeling to generate the labels for the unlearning data. Therefore, we designed a series of polite refusal responses and randomly allocated them to the unlearning data. The specific responses are presented in Table IX.

**TABLE IX: The used polite refusal responses for TOFU**
| Polite Refusal Responses for TOFU |
| --- |
| I’m not certain about that. |
| That’s beyond my current knowledge base. |
| I don’t have that information. |
| I’m not sure. |
| I haven’t learned about that topic. |
| That’s something I need to look up. |
| I’m at a loss for that one. |
| I don’t have the answer to that question. |
| That’s outside my area of expertise. |
| I’m afraid I can’t provide an answer to that. |
| That’s a good question, but I don’t have the answer. |
| My resources don’t contain information on that subject. |
| I wish I could say, but I really don’t know. |
| That’s not something I’m familiar with. |
| I’m drawing a blank on that one. |
| I apologize, but I don’t know that. |
| That hasn’t been included in my training data. |
| Unfortunately, I don’t have an answer for you. |
| That’s not information I’ve been programmed to know. |
| I’m unable to provide an answer to that. |
| I don’t hold the knowledge you’re seeking. |
| I’m clueless about that topic. |
| I’m not well-versed in that subject. |
| I haven’t been briefed on that topic. |
| I lack the specifics on that matter. |
| My databases don’t cover that information. |
| I have no knowledge on that subject. |
| That’s a mystery to me as well. |
| I’m unaware of that detail. |
| I don’t possess the information on that topic. |
| I must admit, I don’t know. |
| I’m unable to answer that question. |
| That topic is out of my scope. |

**TABLE X: Performance comparison among state-of-the-art LLM unlearning approaches when assuming they can access 10% original retained dataset. We report the metrics after unlearning the last request.**
| Dataset | TOFU | CLINC150 |  |  |  |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| Metric | S.U. | D.U. | R.D. | R.A. | W.F. | S.U. | D.U. | R.D. | MRPC | RTE |
| EUL | $60.2$ | $65.4$ | $76.1$ | $78.8$ | $75.4$ | $0.3$ | $0.2$ | $82.3$ | $75.7$ | $18.8$ |
| PO | $35.0$ | $41.2$ | $78.8$ | $80.0$ | $74.3$ | $50.8$ | $49.2$ | $99.5$ | $86.5$ | $85.9$ |
| NPO | $64.5$ | $60.7$ | $76.6$ | $79.2$ | $71.0$ | $100$ | $99.5$ | $98.8$ | $87.7$ | $89.2$ |
| SOGD | $18.0$ | $24.3$ | $40.7$ | $35.5$ | $40.1$ | $0.0$ | $0.0$ | $36.8$ | $0.0$ | $0.4$ |
| SOPO | $30.4$ | $35.0$ | $80.0$ | $81.3$ | $78.9$ | $53.2$ | $55.2$ | $98.3$ | $86.8$ | $85.7$ |

**TABLE XI: Performance comparison among state-of-the-art LLM unlearning approaches when assuming they can access 1% original retained dataset. We report the metrics after unlearning the last request.**
| Dataset | TOFU | CLINC150 |  |  |  |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| Metric | S.U. | D.U. | R.D. | R.A. | W.F. | S.U. | D.U. | R.D. | MRPC | RTE |
| EUL | $50.9$ | $55.6$ | $40.2$ | $45.0$ | $34.7$ | 0 0 | 0 0 | $14.0$ | $12.6$ | $25.6$ |
| PO | $35.0$ | $37.9$ | $65.4$ | $67.0$ | $58.8$ | $59.6$ | $59.3$ | $99.3$ | $86.0$ | $84.4$ |
| NPO | $67.0$ | $71.1$ | $73.4$ | $78.0$ | $71.5$ | $100$ | $99.2$ | $98.8$ | $87.1$ | $87.7$ |
| SOGD | $9.0$ | $10.3$ | 0 0 | 0 0 | 0 0 | $0.0$ | $0.0$ | $0.0$ | $0.0$ | $0.0$ |
| SOPO | $34.2$ | $36.0$ | $67.5$ | $71.4$ | $68.0$ | $56.8$ | $53.7$ | $97.3$ | $86.1$ | $84.4$ |

#### VIII-B 3 Accuracy of Fictitious Knowledge Generation

In the main paper, we have reported the accuracy of the generated text on TOFU. The accuracy is calculated by comparing the cosine similarity of semantic embeddings from Sentence-BERT [] between the ground truth and alternative incorrect responses in TOFU. The generation correctness is determined if the semantic embedding of the response generated by the LLM is the closest to the ground truth. Otherwise, the generated response is incorrect.

### VIII-C More Experiment Results

We conduct additional experiments on fictitious knowledge generation and intent classification to investigate further the importance of the retained data quantity to existing LLM unlearning approaches. Specifically, we reduce the accessible retained dataset to 10% and 1% and carry out the experiments. Tables X and XI present the detailed results. We can observe that all these approaches perform much poorer than when they can access the sufficient retained data (Tables IV and V). In particular, the metrics corresponding to the utility preservation drop significantly, similar to the observed phenomenon in our empirical study (Section III-C). These results validate the necessity of retained data for these LLM unlearning approaches and indirectly reflect their ineffectiveness in achieving practical LLM unlearning.

## Peer Reviews

confidence: 3
contribution: 2
initial_rating: 8
presentation: 3
questions: How robust is the proposed method against ”targeted relearning attacks”? For example, in a safety-critical scenario, can the supposedly unlearned knowledge be solicited again after finetuning the model on related public datasets? [2]

[2] Hu, S., Fu, Y., Wu, Z.S. and Smith, V., 2024. Jogging the Memory of Unlearned Model Through Targeted Relearning Attack. arXiv preprint arXiv:2406.13356.
soundness: 2
strengths: 1. This paper is well-written and motivated by real-world scenarios that require unlearning.
2. The design choices for the proposed unlearning pipeline are justified through ablation studies.
summary: This paper presents a solution to the Continual Unlearning problem, in which the model provider attempts to continuously erase the influence of requested data. The authors motivate their problem formulation because existing model unlearning methods fail to account for the scenario where the unlearning requests emerge continuously, and the model provider lacks access to previous data. To this end, the authors propose a continual unlearning framework that includes LoRA adapters with orthogonal components to minimize the interference among different unlearning requests, along with an OoD detector that measures the similarity between input and unlearning data to decide on how unlearning LoRAs should be loaded.
weaknesses: The authors partially motivate machine unlearning as “ a representative approach for model safety and security by removing the influence of undesired data on the target model.” I very much agree with the assertion. However, the evaluations of the proposed methods mainly focus on unlearning knowledge instead of unsafe behaviors. The usefulness of the proposed method could benefit from additional evaluations against safety-oriented unlearning benchmarks such as WMDP [1].

[1] Li, N., Pan, A., Gopal, A., Yue, S., Berrios, D., Gatti, A., Li, J.D., Dombrowski, A.K., Goel, S., Phan, L. and Mukobi, G., 2024. The wmdp benchmark: Measuring and reducing malicious use with unlearning. arXiv preprint arXiv:2403.03218.

---

confidence: 4
contribution: 3
initial_rating: 5
presentation: 3
questions: See weakness.
soundness: 3
strengths: 1. The authors solve the critical challenge of LLM unlearning by getting rid of the access to the retained data. The design of orthogonal LoRA demonstrates significant improvement in evaluation.

2. The authors conduct extensive experiments to evaluate the effectiveness of the proposed O^3 method.
summary: The authors address significant practical challenges in developing machine unlearning techniques for large language models (LLMs), where current state-of-the-art approaches fall short due to their dependency on retained data and inability to manage continual unlearning requests effectively. To overcome these limitations, they propose the O^3 framework, which introduces an orthogonal low-rank adapter to enable continuous unlearning of requested data and an out-of-distribution detector to assess the similarity between incoming inputs and unlearning data. Comprehensive experiments show that O^3 achieves notably higher unlearning effectiveness and utility preservation than existing methods, all without relying on retained data, even under continuous unlearning conditions.
weaknesses: 1. During the inference, each testing instance x will be fed into all OOD detector backbones. This might limit the method's scalability when the unlearning requests increase due to the higher computational cost. 

2. The experiments focus on the QA datasets, where each query only contains a single knowledge entity to be unlearned. The authors might need to evaluate the framework under more challenging and realistic settings, wherein for each query, there might be multiple knowledge entities to be unlearned. I am concerned about this because the OOD detectors are trained on single unlearning requests.

3. The authors should improve the scale of unlearning requests (more than just 4 requests) to validate the claimed contribution that the O^3 framework can handle continual unlearning settings.

---

confidence: 4
contribution: 2
initial_rating: 5
presentation: 2
questions: 1. With fine-tuning unlearning methods, why is retained data not acceptable? This directly reflects the paper's motivation.
2. this work's novelty seems insufficient, with LORA and OOD blocking the input/output of the LLM.
3. If the model did not really forget the data distribution in the proposed method, is this method vulnerable to attack methods?
soundness: 2
strengths: This paper addresses the LLM unlearning from the continual unlearning perspective.
This unlearning process does not need the retained data.
summary: This paper presents the O3 framework, designed to address continual unlearning requests in LLMs without relying on retained data, a common limitation in existing methods. The O3 framework integrates an orthogonal low-rank adapter (LoRA) for unlearning requests and an Out-Of-Distribution (OOD) detector for measuring input similarity with unlearned data. The orthogonal LoRA prevents interference across multiple unlearning requests, while the OOD detector leverages a novel contrastive entropy loss and a layer-aggregated scoring mechanism to manage unlearning effectiveness dynamically. Extensive experiments demonstrate O3’s superior balance between unlearning effectiveness and utility preservation, particularly in continuous unlearning scenarios. Compared to state-of-the-art methods, O3 shows promising results in reducing computational costs and maintaining model utility across various tasks, such as question answering and intent classification.
weaknesses: The proposed LLM unlearn methods LORA and OOD detector does not exactly unlearn the knowledge from the LLMs. They are just like two modules externally mounted outside the LLM and block the input and output of the LLMs related to the unlearn targets.

Meta-review: This paper presents a solution to the Continual Unlearning problem, in which the model provider attempts to continuously erase the influence of requested data. The authors motivate their problem formulation because existing model unlearning methods fail to account for the scenario where the unlearning requests emerge continuously, and the model provider lacks access to previous data. To this end, the authors propose a continual unlearning framework that includes LoRA adapters with orthogonal components to minimize the interference among different unlearning requests, along with an OoD detector that measures the similarity between input and unlearning data to decide on how unlearning LoRAs should be loaded. This paper is well-written and motivated by real-world scenarios that require unlearning. The authors solve the critical challenge of LLM unlearning by getting rid of the access to the retained data. The design of orthogonal LoRA demonstrates significant improvement in evaluation, and the design choices for the proposed unlearning pipeline are justified through ablation studies. While the reviewers had some concerns about the evaluation, the authors did a particularly good job in their rebuttal. Therefore, all of us have agreed to accept this paper for publication! Please include the additional discussion in the next version.

Decision: Accept (Poster)