SlowGuess/NeurIPS_2023_OCR huggingface dataset:
Yuyuan Li
College of Computer Science
11821022@zju.edu.cn
Chaochao Chen*
zjuccc@zju.edu.cn
Yizhao Zhang
22221337@zju.edu.cn
Weiming Liu
21831010@zju.edu.cn
Xiaolin Zheng
xlzheng@zju.edu.cn
Dan Meng
OPPO Research Institute
mengdan90@163.com
junwang.lu@gmail.com
With growing concerns regarding privacy in machine learning models, regulations have committed to granting individuals the right to be forgotten while mandating companies to develop non-discriminatory machine learning systems, thereby fueling the study of the machine unlearning problem. Our attention is directed toward a practical unlearning scenario, i.e., recommendation unlearning. As the state-of-the-art framework, i.e., RecEraser, naturally achieves full unlearning completeness, our objective is to enhance it in terms of model utility and unlearning efficiency. In this paper, we rethink RecEraser from an ensemble-based perspective and focus on its three potential losses, i.e., redundancy, relevance, and combination. Under the theoretical guidance of the above three losses, we propose a new framework named ULtraRE, which simplifies and powers RecEraser for recommendation tasks. Specifically, for redundancy loss, we incorporate transport weights in the clustering algorithm to optimize the equilibrium between collaboration and balance while enhancing efficiency; for relevance loss, we ensure that sub-models reach convergence on their respective group data; for combination loss, we simplify the combination estimator without compromising its efficacy. Extensive experiments on three real-world datasets demonstrate the effectiveness of ULtraRE. The source codes are available at https://github.com/ZhangYizhao/UltraRE.
Machine Learning (ML) models have made significant strides in various domains, including natural language processing [36], image recognition [15], and recommender systems [18, 27, 28]. However, privacy concerns arise due to individual data involved in training ML models. These concerns are
mainly twofold. Firstly, the General Data Protection Regulation (GDPR) [44] provides individuals with the right to request the removal of their data, including any impact the data may have on the trained models, i.e., the right to be forgotten. Secondly, the Algorithmic Accountability Act [31] requires companies to evaluate the effect of their ML systems on bias and discrimination.
Machine unlearning is a practical approach that promotes privacy in ML systems by removing previously used data and learned information from ML models. Individuals can remove sensitive information that is learned through their data, while companies can proactively unlearn biased [32] or inaccurate [24] data. Unlearning methods can be divided into two approaches based on the level of completeness, namely exact unlearning (full completeness), and approximate unlearning (partial completeness).
In this paper, we concentrate on recommendation unlearning. The personalized recommendation is a typical scenario that urgently requires unlearning because (i) recommender systems rely heavily on individual data, and (ii) the performance of recommendation is highly sensitive to the quality of training data [40]. Existing recommendation unlearning method [7] follows the Exact Unlearning (EU) approach. As retraining is an algorithmic way to ensure fully complete unlearning, EU approach is mainly developed on the ensemble retraining framework [4, 26, 7, 48]. Similar to the idea of ensemble learning [39], the ensemble retraining framework involves dividing the dataset into non-overlapping shards, training a sub-model for each shard independently, and ultimately combining all sub-models. The ensemble retraining framework limits retraining overhead to sub-models, thereby avoiding retraining from scratch on the entire dataset.
However, the ensemble retraining framework's non-overlapping division isolates user and item collaboration, which leaves considerable room for performance improvement in recommendation tasks. Guided by the intuition of collaboration preservation, RecEraser groups similar data together and combines sub-models with attention networks. In this paper, we analyze RecEraser as an ensemble system through a theoretical lens, and find that i) existing clustering algorithms exhibit an incongruity between the requirements of collaboration and balance, and ii) the usage of attention networks is not necessary. As shown in Figure 1, the lower bound of error rate  $\mathcal{B}(\varepsilon)$  in an ensemble system can be decomposed into three components, i.e., redundancy, relevance, and combination loss [34]. Each of these components is associated with a particular stage of the ensemble retraining framework. Considering the three loss components as a well-grounded set of metrics, we simplify and power the State-Of-The-Art (SOTA) recommendation unlearning framework, i.e., RecEraser. Specifically, for redundancy loss (stage I), we incorporate transport weights in the clustering algorithm to pursue the optimal trade-off between collaboration and balance; for relevance loss (stage II), we ensure that sub-models reach convergence on their respective shard data; for combination loss (stage III), we simplify the design of the sub-model combiner to reduce complexity without compromising its efficacy. As a result, we propose a novel recommendation unlearning framework named Ultra RecEraser (U1traRE) that offers greater model utility and efficiency while still achieving full completeness. The main contributions of this paper are summarized as follows:
- We propose a novel ensemble retraining framework (Ultrare) to address the problem of recommendation unlearning. Ultrare enhances both model utility and unlearning efficiency while achieving unlearning completeness at the algorithmic level.
- During stage I (non-overlapping division), we propose an optimal balanced clustering algorithm that transforms the discrete clustering problem into a continuous optimization process while incorporating a balanced constraint to achieve both balanced clustering and minimal inertia simultaneously.
- During stage III (model combination), we take an empirical investigation into the choice of model combiners, and simplify the complexity of model combiner without compromising model utility.
- We empirically validate and demonstrate the proposed framework through extensive experiments on three real-world datasets in terms of model utility and unlearning efficiency.
In this section, we first briefly introduce the goals and targets in recommendation unlearning, followed by the error decomposition of an ensemble system.
Figure 1: Decomposition of error rate [34] in the ensemble retraining framework which is the SOTA framework for model-agnostic exact unlearning and recommendation unlearning.
2.1 Recommendation Unlearning
Unlearning Goals. As introduced in [7, 26], there are mainly three goals for an unlearning task: (G1) Unlearning completeness, which requires completely eliminating the impact of target data from a previously trained model; (G2) Unlearning efficiency, which entails maximizing the efficiency of unlearning while minimizing the need for computationally expensive retraining; and (G3) Model utility, which ensures that the unlearned model can achieve recommendation performance comparable to that of the model retrained from scratch.
As the ensemble-retaining framework belongs to the EU approach, which naturally achieves G1 at an algorithmic level, i.e., the highest level of completeness [43]. In this paper, our objective is to enhance the quality of the ensemble-retraining framework within the recommendation context, with a view to advancing G2 and G3.
Unlearning Targets. The concept of training data holds a multifaceted view, resulting in different unlearning targets. In the context of personalized recommendation, the user-item interaction serves as the training data. Considering ratings as a form of user-item interaction, the unlearning target may differ based on the perspective, either focusing on the user-wise, item-wise, or sample-wise aspects. For instance, user-wise unlearning refers to unlearning all interactions made by the specific target user(s). In this paper, we focus on the ensemble retraining framework, which is versatile and can be applied to any type of unlearning target.
2.2 Ensemble System
Ensemble learning has proven to be successful in various fields of machine learning. An ensemble system involves combing multiple models, such as bagging [5, 23], stacking [46], and mixture of experts [20, 42]. Early studies have been guided by the intuition that ensemble systems achieve better performance when employing a combination of accurate and diverse models. From a theoretical standpoint, using Fano's inequality of information theory, [34] decomposes the error rate of an ensemble system into three components, i.e., redundancy (model diversity), relevance (model accuracy), and combination (information lost during model combination) loss. As shown in Figure 1, the aforementioned ensemble retraining framework is basically an ensemble system. We divide the ensemble retraining into three stages, i.e., non-overlapping division, independent training, and model combination. Each stage is associated with one specific error component.
3.1 Machine Unlearning
Machine unlearning is the process of removing the influence of specific training data, i.e., unlearning target, from a learned model [35]. A naive approach to achieve this is by retraining the model from
scratch on the updated dataset that excludes the target. However, this approach can be computationally prohibitive in practice. Based on the degree of unlearning completeness, existing unlearning methods can be classified into the following two approaches.
Exact Unlearning. This approach aims to ensure that unlearning target is fully unlearned, i.e., as complete as retraining from scratch. Cao and Yang [6] achieved this by transforming training data points into a reduced number of summations to enhance unlearning efficiency. Recently, Bourtoule et al. [4] proposed an ensemble retraining framework, i.e. SISA, which divides the dataset into non-overlapping subsets, trains a sub-model on each subset, and combines all sub-models in the end. This design reduces the retraining overhead to subsets. Similarly, ARCANE [48] divides the dataset by class and applies one-class anomaly detection training on each subset. However, ARCANE can only be applied to classification tasks.
Approximate Unlearning. This approach estimates the influence of unlearning target, and removes the influence through direct parameter manipulation [11, 13, 41, 45]. While theoretically more efficient than exact unlearning, this approach faces challenges regarding unlearning completeness, i.e., exactness, due to the inaccurate estimation of influence. In this approach, the influence of unlearning target is estimated by influence function [21, 22], which is found to be fragile in deep learning [1]. Recent studies also point out that the influence of individual training data on deep models is intractable to compute analytically [12].
3.2 Recommendation Unlearning
RecEraser was proposed to achieve unlearning in recommender systems [7]. Following SISA's ensemble retraining framework, RecEraser groups similar data together, instead of random division. This modification effectively preserves collaborative information necessary for personalized recommendations. In addition, RecEraser uses an attention-based combination to further enhance model utility. Similarly, LASER also groups similar data together [26]. However, instead of training a model on each subset and combining them, LASER trains a model sequentially on each subset using curriculum learning. While this modification significantly enhances model utility, it comes at the cost of reduced efficiency. Theoretically, LASER can only accelerate the unlearning speed two times compared to retraining from scratch, which is generally unsatisfying in practice. Recently, Approximate recommendation unlearning was proposed to enhance efficiency [25]. However, it still suffers from common weaknesses of approximate unlearning and is unable to provide algorithmic unlearning completeness, which exact unlearning achieves.
In this section, we present our UtraRE for addressing the recommendation unlearning problem. Following the design of the ensemble retraining framework, we rethink RecEraser from an ensemble-based perspective. Instructed by the error decomposition theory in ensemble systems (see Figure 1), we associate each loss component with a specific stage in the ensemble retraining framework. Our proposed UtraRE refines the design of each stage to minimize its corresponding loss component. In the following subsections, we describe in detail the modifications we propose for each stage.
4.1 Redundancy Loss (Stage I)
In stage I, the ensemble retraining framework divides the original training data into several non-overlapping shards.
Random Balanced Division. The original framework (SISA [4], designed for the machine unlearning problem), uses random balanced division. The assumption that there is no prior knowledge regarding the distribution of unlearning requests is widely accepted and practical [4, 7, 26]. In the absence of such knowledge, it is optimal to presume that users submit these requests with equal probability. Therefore, in order to attain optimal unlearning efficiency, the ensemble retaining framework needs to achieve balanced division. The theoretical explanation can be found in Appendix A.
Balanced  $k$ -means. Collecting collaborative information across users and items is essential to the performance of recommendation models. With the intuition of preserving collaboration, RecEraser [7] uses clustering algorithms to group similar samples together. Additionally, RecEraser needs to achieve balanced division. Thus, the balanced clustering algorithms were proposed [7, 8, 26]. Assume that there are  $N$  input samples  $\pmb{x} \in \mathbb{R}^d$  for clustering. Note that the input samples can consist of user embedding, item embedding, or a combination of both depending on the unlearning target, i.e., user-wise, item-wise, or sample-wise. The core idea of their proposed algorithm is i) limiting the maximum number of samples in one shard, typically
$|S_i| \leq \lceil N / k \rceil$ , ii) constructing a priority list for every sample-centroid pair, and iii) assigning each sample to its destination shard by priority value.
(a) Balanced Grouping
(b) Imbalanced Grouping
Figure 2: An illustration of balanced and imbalanced grouping. We conducted an experiment on a real-world dataset (ML-1M). (a) and (b) are the results of random balanced division and  $k$ -means respectively. Each color block represents one shard. The size of the block varies with the number of samples in the shard, with larger blocks representing more samples.
every sample-centroid pair, and iii) assigning each
4.1.1 Optimal Balanced Clustering
The loss component for stage I is redundancy loss, which directs ensemble systems to enhance the diversity among shards [34]. This theoretical guidance conforms with prior work's intuition of collaboration preservation, which proposes the balanced  $k$ -means algorithm to group similar samples together [7]. However, to achieve a balanced division, balanced  $k$ -means may not always assign samples to their optimal clusters. In practice, as shown in Figure 3, this can result in a significant number of sub-optimally assigned samples, which degrades the clustering performance. To address this incongruity, we propose an Optimal Balanced Clustering (OBC) algorithm that achieves an adaptive equilibrium between sample similarity and shard balance.
Generally speaking, OBC incorporates a balanced constraint into the optimization process. As illustrated in Figure 3, we obtain the trans
Figure 3: An illustration of different clustering algorithms. The red block located at coordinate  $(\pmb{x}_i,\pmb{\mu}_j)$  represents assigning  $\pmb{x}_i$  to  $\pmb{\mu}_j$ . On the left,  $k$ -means groups samples based solely on their similarity, resulting in an imbalanced result. In the middle, balanced  $k$ -means forces a balanced result by considering a similarity-based priority list. On the right, Optimal Balanced Clustering (OBC) incorporates a balanced constraint into the optimization process and assigns samples according to their transport weight values.
port weight of assigning an input sample  $\pmb{x}$  to a cluster centroid  $\pmb{\mu}$  through the optimization process. The input samples are assigned to the cluster with the largest weight. To start with the derivation of OBC, we first introduce the basic concept of  $k$ -means. The  $k$ -means algorithm minimizes the total distance of each sample-centroid pair, namely inertia  $\mathcal{I}$ . It is formally defined as
$$
\mathcal {I} = \sum_ {j = 1} ^ {k} \sum_ {i \in S _ {j}} \| \boldsymbol {x} _ {i} - \boldsymbol {\mu} _ {j} \| _ {2} ^ {2}, \quad \boldsymbol {\mu} _ {j} = \frac {\sum_ {i \in S _ {j}} \boldsymbol {x} _ {i}}{| S _ {j} |}. \tag {1}
$$
Considering  $\pmb{x}$  and  $\pmb{\mu}$  as two variables respectively sampled from subsets  $X$  and  $Y$  in the Euclidean space  $\mathbb{R}^d$ , the problem of inertia minimization can be framed as the Monge-Kantorovich problem.
Problem 1 (Monge-Kantorovich Problem). Given the transport cost function  $c: X \times Y \to \mathbb{R}$ , the objective of the Monge-Kantorovich problem is to find the joint probability measure  $P: X \times Y \to \mathbb{R}$  that minimizes the total transport cost
$$
\mathbb {E} [ c (X, Y) ] = \min  _ {P} \int_ {X \times Y} c (\boldsymbol {x}, \boldsymbol {\mu}) d P (\boldsymbol {x}, \boldsymbol {\mu}). \tag {2}
$$
The Monge-Kantorovich problem offers the advantage of accommodating additional constraints to the probability measure. Turning back to the inertia minimization problem, we insert a set of transport
weights  $\boldsymbol{w}$  where their summation equals one into Eq (1) to mimic the function of the joint probability measure  $P$ . Then, we can rewrite the objective of  $k$ -means as
$$
\min  _ {\boldsymbol {w}} \left[ \sum_ {j = 1} ^ {k} \sum_ {i = 1} ^ {N} w _ {i j} \cdot \| \boldsymbol {x} _ {i} - \boldsymbol {\mu} _ {j} \| _ {2} ^ {2} \right], \quad s. t. \sum_ {j = 1} ^ {k} \sum_ {i = 1} ^ {N} w _ {i j} = 1, w _ {i j} \in \{0, \frac {1}{N} \}, \sum_ {i = 1} ^ {N} w _ {i j} = \frac {1}{k}, \tag {3}
$$
where  $w_{ij} = 1 / N$  denotes assigning  $\pmb{x}_i$  to  $\pmb{\mu}_j$ , and the constraint  $\sum_{j}w_{ij} = 1 / k$  ensures each shard is treated equally. By introducing the transport weights  $\pmb{w}$ , we can transform the discrete clustering problem into a continuous optimization process. This transformation allows us to impose additional constraints on  $\pmb{w}$  that facilitate more fine-grained control over the clustering process. Consequently, we add the constraint  $\sum_{j}w_{ij} = 1 / N$  to ensure a balanced division. Following the Monge-Kantorovich framework [3, 30], we also relax the range of  $\pmb{w}$  to  $\mathbb{R}^+$  to guarantee the existence of solution space for the objective. Finally, the shard assignment of  $\pmb{x}_i$  is determined by  $\arg \max_j w_{ij}$ . However, the worst-case complexity of computing the optimum for such a transport objective with additional constraints scales in  $O(N^3)$  [37]. To enhance efficiency, we utilize Sinkhorn divergence to accelerate the optimization process [38, 29]. Specifically, we smooth the objective with an entropic regularization as follows:
$$
\min  _ {\boldsymbol {w} \in \Gamma} \left[ \sum_ {j = 1} ^ {k} \sum_ {i = 1} ^ {N} w _ {i j} \cdot \| \boldsymbol {x} _ {i} - \boldsymbol {\mu} _ {j} \| _ {2} ^ {2} + \epsilon \cdot \sum_ {j = 1} ^ {k} \sum_ {i = 1} ^ {N} w _ {i j} \cdot (\log (w _ {i j}) - 1) \right], \tag {4}
$$
where  $\Gamma = \{\| \pmb{w} \|_1 = 1, \pmb{w} \succeq 0, \sum_i w_{ij} = \frac{1}{k}, \sum_j w_{ij} = \frac{1}{N}\}$ . The derived new objective can be efficiently solved through Sinkhorn's matrix scaling algorithm with a complexity of  $O(Nk)$  [9, 10]. The optimization details can be found in Appendix B.
4.2 Relevance Loss (Stage II)
In stage II, the ensemble retraining framework trains a sub-model on each shard independently, which means sub-models do not interfere with each other during training. The loss component associated with this stage is relevance loss, which implies that the aim is to enhance the performance of sub-models. However, to ensure unlearning completeness at the algorithmic level, it is crucial that the sub-models fully replicate the original model. This includes replicating not only the model structure, but also hyper-parameters, parameter initialization, and any other relevant elements. Therefore, we do not break the requirement of full replication and also leave stage II unchanged [4, 7, 8]. We assume that the shard data is i.i.d. with the original training data and ensure that all sub-models fully replicate the original model that attains convergence on the original training data. This ensures that sub-models reach convergence on their respective shard data.
4.3 Combination Loss (Stage III)
In stage III, the ensemble retaining framework combines the sub-models to obtain the final model. The original framework, i.e., SISA [4], uses an average combiner. However, this is a naive solution, since various shards may have different contributions to the final model. Thus, the model-based combiner is proposed by [7, 8]. Specifically, this approach utilizes machine learning models to determine the combination weights by the following objective:
$$
\min  _ {\beta} \mathbb {E} \left[ \sum_ {i = 1} ^ {k} \ell \left(\beta_ {i} \boldsymbol {\alpha} _ {i}, R\right) \right] + \lambda \| \boldsymbol {\beta} \| _ {2} ^ {2}, s. t. \| \boldsymbol {\beta} \| _ {1} = 1, \boldsymbol {\beta} \succeq 0, \tag {5}
$$
where  $\ell$  is the original loss function for recommendation tasks,  $R$  is the recommendation data,  $\alpha_{i}$  denotes the parameters of  $i$ -th sub-models, and  $\beta$  denotes the weights of combination. Note that the parameters of sub-models are fixed during model combination. The  $L_{2}$  regularization parameterized by  $\lambda$  on  $\beta$  is applied to prevent over-fitting. This approach is akin to the use of meta-estimators in ensemble systems [33], where they are employed to alleviate information loss during model combination. As empirically studied by [34], a simple meta-estimator such as Logistic Regression (LR) proves to be enough on deep models. Building on this insight, we empirically validate the effectiveness of LR on the recommendation tasks in Section 5.2.3. Our results show that LR can perform comparably to attention networks [7] while substantially reducing model complexity.
4.4 Putting Together
Our proposed UltraRE belongs to the ensemble retraining framework and follows the three-stage structure described in Figure 1. In stage I, we obtain an adaptive equilibrium between sample similarity and shard balance by optimizing Eq (4) In stage II, we do not interfere with sub-model training, meeting the requirement of fully replicating the original model. In stage III, we apply LR to determine the combination weight by optimizing Eq (5).
We conduct experiments on three real-world datasets to evaluate the performance of our proposed U1traRE framework. The evaluation mainly focuses on G2 (unlearning efficiency) and G3 (model utility), as our proposed method (U1traRE) belongs to exact unlearning, which naturally achieves G1 (unlearning completeness). U1traRE can handle all three types of unlearning targets, i.e., user-wise, item-wise, and sample-wise. In this paper, we focus on user-wise unlearning without loss of generality, as it is the most common one in practice. Additionally, we perform an ablation study to further investigate the effectiveness of modification.
We conduct experiments on the following three real-world datasets: i) MovieLens 100k (ML-100K) $^2$ : The MovieLens datasets are among the most extensively used in recommendation researchn [14, 16]. ML-100K contains 100 thousand ratings; ii)