Knowledge Swapping via Learning and Unlearning
Authors: Mingyu Xing
Lechao Cheng
Shengeng Tang
Yaxiong Wang
Zhun Zhong
Meng Wang
Venue: ICML 2025 poster (2025)
Keywords: continual learning
machine unlearning
knowledge swapping
Primary area: deep_learning->everything_else

Abstract: We introduce Knowledge Swapping, a novel task designed to selectively regulate knowledge of a pretrained model by enabling the forgetting of user-specified information, retaining essential knowledge, and acquiring new knowledge simultaneously.  By delving into the analysis of knock-on feature hierarchy, we find that incremental learning typically progresses from low-level representations to higher-level semantics, whereas forgetting tends to occur in the opposite direction—starting from high-level semantics and moving down to low-level features. Building upon this, we propose to benchmark the knowledge swapping task with the strategy of Learning Before Forgetting. Comprehensive experiments on various tasks like image classification, object detection, and semantic segmentation validate the effectiveness of the proposed strategy. The source code is available at https://github.com/xingmingyu123456/KnowledgeSwapping.

Knowledge Swapping via Learning and Unlearning
Mingyu Xing
Lechao Cheng æ
Shengeng Tang'
Yaxiong Wang'
Zhun Zhong
12
Meng Wang'
Abstract
We introduce Knowledge Swapping, novel task designed to selectively regulate knowledge of a pretrained model by enabling the forgetting of user-specified information, retaining essential knowledge, and acquiring new knowledge simultaneously. By delving into the analysis of knock-on feature hierarchy, we find that incremental learning typically progresses from low-level representations to higher-level seman- tics, whereas forgetting tends to occur in the opposite direction-startiin semantics and moving down to low-level features. Building upon this, we propose benchmark the knowledge swapping task with the strategy of Learning Before Forgetting. Comprehen- sive experiments on various tasks like image classification, object detection, and semantic segmentation validate the effectiveness of the proposed strategy. The source code available at Swapping
Task
Unlearning
Swapping
Task Tt
e
Continual Learning
Machine Unlearning
Knowledge Swapping
Learning
Retained Knowledge
from high-level
Swapping
Remaved Knowledge
|||
Unlearning
New Knowledge
Knowledge Swapping: Learning
Unleaminng
Figure 1. Comparisons of three tasks: Continuous Learning, Ma- chine Unlearning, and our Knowledge Swapping.
(ttpingmiinnn122336/111 23456/ 30445//nnowwegee nowledge
block or forget certain sensitive content. Recent works, such as machine unlearning (Liu et al., 2024c; Wang et al., 2025; Zhang al., 2024b), have begun to address the uni- lateral forgetting of specific content within pretrained mod- els. Nonetheless, approaches that simultaneously enable the learning of new knowledge and the forgetting of specific content remain underexplored.
1. Introduction
The proliferation of deep learning has led to the widespread adoption of pretrained models (Han et al., 2021). which are typically fine-tuned using task-specific data to achieve parameter-efficient adaptation. the context of streaming tasks, researchers have increasingly explored methods for continuously optimizing and adapting pretrained models to new tasks (Lin et al., 2023; Chen et al., 2024: Zhu al., 2023), paradigm referred to as continual learning (Wang et al., 2024). However, in practical applications, as deep models integrate more knowledge, they often encounter additional requirements, such as the need to continuously
Inspired by this insight, we propose a novel task termed Knowledge Swapping, which enables the selective forget- ting of specific categories of knowledge while preserving others, tailored to the requirements of new tasks. As de- picted in Figure 1, continual learning (Cheng et al., 2024a;b; Zhang et al., 2024a; Huang et al., 2024a;b; Wu et al., 2025) aims to integrate new task knowledge into an existing pre- trained model. Current mainstream approaches (Li et al., 2024; Wang et al., 2022b) often involve attaching new adapter for each task and fine-tuning it, yet the need to for- get outdated less relevant knowledge remains underex- plored challenge. Recent advancements (Liu et al., 2024b; Wang et al., 2025) in machine unlearning have demonstrated that isolating or removing specific knowledge from a pre- trained model necessitates an explicit unlearning process. In contrast, our proposed Knowledge Swapping task facili-
'School of Computer Science and Information Engineer- ing. Hefei University of Technology "School of Computer Science, University of Nottingham. Correspondence to: Lechao Cheng <chenglc@hfurg chhengic@hfur.cdu.cm.. Zhun Zhong <zhun- zhong007
gmmil.com>. e
Proceedings of the 42nd International Conference Machine Learning. Vancouver, Canada. PMLR 267, 2025. Copyright 2025 by the author(s).

---

Knowledge Swapping via Learning and Unlearning
tates the learning of new tasks while simultaneously forget- ting less important prior knowledge or sensitive data that requires protection, thereby preserving the core capabilities of the pretrained model.
posed strategy significantly improves overall perfor- mance.
2. Related Work
We further delve into how to perform knowledge swapping more effectively by leveraging empirical insights. Intu- itively, this process can be divided into two stages: for- getting specific knowledge and learning novel knowledge. A natural assumption might be that the model should first forget less important or potentially detrimental priors in order to "free up" the capacity for new information. We conduct a set of straightforward experiments to analyze, in isolation, how incremental learning and targeted forgetting each influence model parameters. Our findings indicate that incremental learning typically progresses from low-level representations higher-level semantic features, whereas forgetting tends to occur in the opposite direction-starting from high-level semantics and moving down to low-level features. This contrast provides valuable insights for design- ing strategies for knowledge swapping task. Specifically, if we perform targeted forgetting first, we may complete the forgetting of high-level semantics before any major ad- justments occur in the low-level feature space. Once we begin introducing new content afterward, these low-level changes may no longer align with the previously forgotten high-level semantic representations, thereby creating po- tential conflicts. Conversely, if we first learn the new task (thus updating the low-level feature distribution), and only then conduct targeted forgetting, the process more likely to remain confined higher-level semantics. As result, the updated low-level distributions are less likely to be per- turbed during the forgetting stage, which helps to maintain the integrity of previously acquired knowledge. We empir- ically show learning new tasks first, followed by selective forgetting of specific knowledge, leads to significantly better results. Our contributions are summarized as follows:
2.1. Continual Learning
Continual learning, also known as lifelong learning, aims to enable models to learn new tasks incrementally while mitigating catastrophic forgetting. Existing approaches can be broadly categorized into Regularization-Bass Baseed Meth- ods (Kirkpatrick et al., 2017; Li & Hoiem, 2017; Zhu et al., 2021; Liu & Liu, 2022; Wang et al., 2023), Memory-Based Methods (Rebuffi et al., 2017; Ashok et al., 2022; Chaudhry et al., 2021; Zhou et al., 2022; Sun et al., 2023; Yang et al., 2023), and Architecture
Methods (Rusu et al., 2016; Douillard et al., 2022; Wang et al., 2022a; Lu et al., 2024).
iittaaiizaaiio-bsaee methods introduce constraints in the loss function to retain past knowledge. For instance, EWC (Kirkpatrick et al., 2017) distills knowledge from old models to new ones for prediction consistency. Memory- based methods maintain an external memory to store or gen- erate past knowledge. BMKP (Sun et al., 2023) introduces a bilevel memory framework, where a working memory adapts new tasks and long-term memory retains com- pact knowledge representations. Architecture-bacte ods expand the model to accommodate new tasks. Progres- sive Neural (etuorks(Rusu et al., 2016) expands the model using gradient boosting and compresses it via knowledge distillation. ArchCraft (Lu et al., 2024) leverages neural architecture search (NAS) to balance stability and plasticity, generating architectures that enhance knowledge retention with minimal parameter overhead. Our proposed method shares the goal of balancing retention and learning with con- tinual learning approaches. However, knowledge swapping introduces an additional challenge of selective forgetting, which is not explicitly addressed in traditional continual learning methods.
meth-
We propose the concept of Knowledge Swapping, novel task that facilitates the learning of new tasks while simultaneously forgetting less important prior knowledge and preserving essential pretrained capabil- ities.
2.2. Machine Unlearning
Machine unlearning (Koh & Liang. 2017: Kurmanji et al., 2024; Liu et al., 2024a) focuses on efficiently removing specific data or knowledge from a trained model without re- quiring full retraining, which is crucial for data privacy com- pliance. One of the earliest approaches is fine-tuning, which exploits catastrophic forgetting by retraining the model on a retention dataset, though it may leave residual traces of forgotten data. This method forms the foundation for sub- sequent unlearning techniques. Building on this, Influence Functions (Koh & Liang. 2017) emerged, whiestimatetes the influence of individual data points model parameters, pro- viding more precise and computationally efficient method for data removal without retraining the entire model. Later,
We uncover that incremental learning progresses from low-level to higher-level semantic features, whereas targeted forgetting begins at high-level semantics and works downward. This directional contrast provides key insights into how to design effective knowledge swapping procedures.
Building upon the insight from feature-bierarchy in- terplay, we propose to achieve knowledge swapping by sequential learning-thee thaiinggthh--faee then-forgetting principle. Com- prehensive experiments also demonstrate that the pro-
2

---

Knowledge Swapping via Learning and Unlearning
more sophisticated methods are introduced. NegGrad+ (Kur- manji al., 2024) balances the loss on the forgotten set and the retention dataset, offering more controlled trade-off in the unlearning process. To further refine the removal of spe- cific knowledge, L1-Sparse (Liu et al., 2024a) introduces the use of LI -e-uluulaiizztion to zero out parameters associated with forgotten data, effectively eliminating their influence on the model. Additionally, Relabeling techniques, such as Salieney Unlearning (Feldman, 2020) disrupts the model's memory of forgotten data by altering its labels, focusing on modifying key parameters that store the data's influence. Unlike conventional unlearning methods, which primarily focus on individual data points, our proposed framework introduces a novel approach for category-level forgetting. By integrating the processes of learning, retention, and for- getting into unified system, this framework offers more flexibility and control over knowledge management, mark- ing a significant advancement in this area of research.
3. For each x E X,, M1 correctly predicts its label yo Formally, (1)) = vi 1, Vaz Xt (Lear-- ing)
Here, P(.) denotes the probability of the corresponding event under the trained model. The objectives are then to promote or discourage each of these criteria accordingly.
3.2. To Forget Before Learning, or to Learn Before Forgetting?
Revisiting that we have already provided comprehen- sive definition of the knowledge swapping task, we note that-based on its criteria-it can be naturally divided into two core phases: forgetting and learning. This highlights a pivotal question: should a model first forget certain ex- isting knowledge before learning new information (which seems intuitively appealing). or should it learn new content first and then perform forgetting? The way we answer this sequence dilemma directly informs how we design ro- bust knowledge swapping benchmark. Although intuitively, forgetting old knowledge first appears to free up capacity for accommodating the new, is this really the optimal ap- proach? To explore this, we conduct two sets of experiments on dense prediction tasks such as semantic segmentation, each corresponding to one of these two learning orders. We then examine how the neural network's parameters, across various layers, evolve under each approach (see Figure 2).
3. Knowledge Swapping
3.1. Task Definition
We introduce a novel task, referred to as Knowledge Swapping, which aims to selectively regulate a model's knowledge by employing specifie swapping mechanisms to achieve three primary objectives: (1) forgetting user- specified knowledge, (2) retaining core knowledge, and (3) simultaneously learning new knowledge.
Knock-on Feature Hierarchy In this section, we directly evaluate the weight norms and parameter differences at each stage of the process. Specifically, L + F denotes Learning Before Forgetting, while F -> indicates Learning After Forgetting. The superscript W represents the weight norms at different stages under each sequence. We aggregate re- sults from multiple image segmentation tasks and observe that when following the L - F sequence, the majority of parameter updates occur in the latter layers of the neural network- responsible for generating semantic- features. Conversely, in the F + L sequence, the principal changes are concentrated in the earlier layers, which pro- duce low-level features. Based on these results, found:
Let Dp = (Xp: Yp) be the pretraining dataset on which an initial model Mo has been trained. We define three additional sets:
Retaining Set: D, = K.), which contains the knowledge that must be preserved.
Forgetting Set: Dj (X,, containing the knowledge that the model needs to forget.
Learning Set: D. = (Xi, Yi), comprising new knowl- edge to acquire.
In general, both D, and Dy are subsets of the pretraining dataset Dp, i.e., D,, D, C D,, while D, could represent an entirely new task or domain.
Discovery-l: Incremental learning typically progresses from low-level representations to higher-level semantic features, whereas forgetting tends to occur in the opposite direc- tion-starting from high-level semantics and moving down to low-level features.
Objectives:
We seek to train an updated model M1 such
that:
What is the practical significance of this seem- ingly intuitive finding? Clearly, its hierarchical feature im- plications offer valuable insights for designing knowledge swapping strategies. Specifically, if we conduct targeted for- getting first, we may erase high-level semantic parameters before making any substantial adjustments to the low-level feature parameter space. However, once we subsequently
Remark.
1. For each 2r E Xr, Mi correctly predicts its label Vr- Formally, (MM) = v.) x 1, Ve, E X,. (Retention)
2. For each zy E Xy. M, does not correctly predict its label yy. Formally, (z)) = wr) ze O, Vay E Xy. (Forgetting)
3

---

Knowledge Swapping via Learning and Unlearning
[ F
FW
Difference forget
20
20
20
15
15
15
Values
Values
10
10
10
10
20
30
10
20
30
10
20
30
Index
Index
Index
Pascal Voc
Oxford-IIIT Pet
DeepGlobe Land
(a) Learning Before Forgetting (L F)
FW L
F LW
Difference learn
20
20
15-
Values
Values
Values
10
5-
10
20
30
10
20
20
30
Index
Index
Index
Pascal Voc
Oxford-IIT
DeepGlobe Land
(b) Learning After Forgetting (F L)
Figure 2. Le norm for each parameter under L - F and F - L. The superscript W denotes the weight norm value at the current stage. The figure illustrates that (a) during the Learning Before Forgenting phase, changes parameter norms are predominantly concentrated in layers responsible for high-level semantic representations. Conversely, (b) in the Learning After Forgetting phase, parameter norm changes primarily occur layers associated with low-level feature representations.
introduce new content, further modifications to the low-level parameters can cause inconsistencies the high-level se- mantics (breaking the forgetting pipeline owing to altering low-level parameters). potentially leading to conflicts. By contrast, if we begin by learning a new task (thereby up- dating the low-level parameters) and then perform targeted forgetting, the forgetting process is more likely confined to the high-level semantic parameters.
that Learning Before Forgetting is more stable.
4. Benchmark
4.1. Overview
As illustrated in Figure 3, we employ the Low-Rank Adap- tation (LoRA) technique (Hu et al., 2021) to fine-tune the pretrained model Mo Sec. 4.2). Additionally, we lever- age group sparse regularization to constrain the selective learning and forgetting of specific knowledge (Sec. 4.3).
Principle: Learning Before Forgetting. Recall that we demonstrate that initiating the forgetting process before learning disrupts the intended forgetting due alterations in low-level feature learning. This raises the question: does conducting the learning process before forgetting similarly interfere with previously acquired knowledge? We also measure the average gradient changes across two primary sequences, L + F' and F + L, as shown in Figure 4. The superscript G means the log average gradient at the current stage. First, parameter changes during the learning phases (I + F and F + I,G) are consistently more significant, indicating that the Learning process is relatively challenging; second, in the L + F phase, the final updates to forgetting gradients remain consistently small, suggesting
4.2. LoRA-Basee Fine-Tuning
Building on the findings in (Geva et al.. 2020), which demonstrate that the linear layers within Transformers encapsulate a substantial amount of the model's knowl- edge, we employ the Low-Rank Adaptation (LoRA) tech- nique (Hu et al., 2021) to fine-tune only these linear layers. Let X denote the input to the of the k-th Transformer block after the t-th gradient up- date. The weights and biases of the first linear layer are represented by W k1 and by respectively, while those of
Network (FFN)
4

---

Knowledge Swapping via Learning and Unlearning
Output
KKnowedgee ( ((w=)
Learning Phase
LoRA Groups
Layer Norm
Transformer
Block
FFN Linear
Low Level High Level
B
A
FFN Linear 1
Transformer
Knowledge Swapping
Block
Layer Norm
Transformer
Forgetting Phase
Block
Attention
Trainable
Input
Learning
Forgetting
Low Level High Level
Figure Benchmark Framework. First, we decouple knowledge swapping into separate learning and forgetting processes. observed that the learning process progresses from low-level features to high-level features, while the forgetting process proceeds in the opposite direction from high-level features to low-level features. Therefore, a two-stage strategy Learning Before Forgetting adopted. In general, adopt LoRA fine-tune the linear layers in each Transformer block, with all other parameters frozen to enable selective regulation of the model knowledge.
LG
L4FG
F-LG
FG-L
-3
-4-
-4-
-5
10g
log
-8
30
30
30
Index
Index
Index
Pascol Voc
Oxford-IITT Pet
DeepGlobe Land
Figure 4. Logarithm of the Average Gradient. We compute the logarithm of cumulative average gradient changes at different stages in the T. F and + processes. We observe two key phenomena: first, parameter changes during the learning phases (I and F + T.6) are consistently more significant, indicating that the Learning process is relatively challenging; second, in the I, + FG phase, the final updates to forgetting gradients remain consistently small, suggesting that Learning Before Forgetting is more stable.
the second linear layer are denoted by W and b/ The computation performed by the FFN can be expressed as:
Although the biases bj and b% may also be fine-tuned, they typically involve fewer parameters compared to the weights. By restricting updates to low-rank matrices, LoRA enables efficient fine-tuning with reduced computational and storage overhead while preserving the knowledge embedded in the original pretrained weights.
FFN ReLU (xW b(a) W bk2- (1)
Using LoRA, the weights are decomposed into their original pretrained components and learnable low-rank adaptations:
W A1 = Wh + AW
AW #1 = A B
(2)
4.3. Sparse Constriant
R1
W A2 2 + AW!
AW = A B
(3)
We employ Group Coefficient Regularization to selectively retain specific knowledge within the Feed-Forward Network (FFN) modules. Specifically, we adopt the Lasso strategy (Liu et al., 2015; Wen et al., 2016; Yuan & Lin, 2006) for group sparse regularization. Lasso achieves the selective retention of knowledge by zeroing out the A and B matrices of irrelevant FFN modules within LoRA, thereby enabling
k2:
In these equations, W and WO represent the original pre- trained weights, while AW! 11 and AW! k2 are the low-rank updates at time step f. parameterized by the matrices A and B. This approach ensures efficient adaptation by focusing solely on the linear layers of the Transformer, which are hy- pothesized store the majority of the model's 's knowledge.
5

---

Knowledge Swapping via Learning and Unlearning
Table Image classification results on Imagenet100 under Learning Before Forgetting. L and are short for Learning and Forgetting, respectively. Acc,, Ace; and A represent the accuracy of the retaining set, the learning set, and the forgetting set.
Cub
Resise45
Oxford-pe pet
Plantvillage
Stages
Ace, +
Acc f
Acc,
Ace, t
Acei 1
Acc,
Acc, t
Acc; t Acc; +
Acc, +
Acci
Acc, 1
Learning Set
5 classes, Forgetting Set: 5 classes, Retaining Set: 95 classes
Start
88.08
84.4
88,08
0.2
84.4
88.08
0.4
84.4
88.08
0
84.4
F
86.63
0
0.4
86.63
0.4
0.4
86.63
0.4
0.4
86.63
0
0.4
F + L L
86.94
94.04
80.8
87.62
99
70.8
88.48
93,6
77.2
88.06
99.13
74,8
86.67
94.04
82,44
87.93
98.8
82.0
87.83
94.4
82.8
87.97
99.56
82.4
L F
86.4
91.66
0
86.77
99.2
0
87.01
93.6
0
87.26
99.78
0
Learning Set:
10 classes,
Forgetring Ser: 10 classes, Retaining Ser: 90 c classes
Start
87.75
89.2
87.75
0.1
89.2
87.75
1.8
89.2
87.75
0
89.2
F
85.22
0
0
85,22
0.2
0
85.2
2
0
85.22
0
0
F + L
86.84
96.27
82
87.2
98.7
82
88
96
83
87.66
98.55
82.2
L 85.06
95.03
83.6
86.84
98.9
84.4
87.0
95.8
85.2
87.35
98.86
85,4
F
84.68
93.78
0
85,97
98.7
0.6
86.22
95.2
0.2
85.48
98.65
0
targeted learning and forgetting. The Lasso regularization loss is defined as:
Licarn = (X)( Yi),
(6)
Call = Lrotain + B Lleamn + OrLeee
(7)
Fre = Σ [
+
(4)
where (X,, Y,) denotes the data from the retention set, (X;, Xi) denotes the data from the learning set, and a and 3 are hyperparameters that balance the contributions of the different loss components.
where I|e denotes the Frobenius norm, calculated as the square root of the sum of the squared elements of matrix, and n represents the number of FFN groups
In the forgetting phase, the goal is to eliminate specific knowledge while retaining both the original and newly ac- quired knowledge. This involves minimizing (X)( Y,) and (x),, Yi). while maximizing (X) Yy). How- ever, directly maximizing the negative loss (i.e., minimiz- C( Yy)) can result in unbounded loss growth, leading to optimization instability. To address this issue, we introduce boundary constraint (BND) to stabilize the loss. The final loss function for the forgetting phase is defined as:
Remark. Sparse constraints enhance parameter efficiency by limiting non-zero parameters, reducing computational and storage overhead, and accelerating inference. knowl- edge swapping tasks, they enable the selective retention of crucial parameters for the current task while suppressing re- dundant ones, thereby preventing conflicts between new and existing knowledge. Additionally, parameter sparsification mitigates interference from irrelevant variables during learn- ing and forgetting (similar idea in model pruning), allowing the model focus on important information. Specifically, Lasso regularization penalizes the Frobenius norms of matri- ces, promoting group sparsification that selectively retains and forgets at the module level and maintains stability in low-level feature parameters when introducing new knowl- edge. Consequently, the model preserves new knowledge while maintaining the stability of existing representations. Overall, sparse constraints effectively manage parameters in knowledge swapping. enabling efficient adaptation to new tasks and maintaining previously acquired knowledge, thereby supporting scalable continual learning.
Liorget ReLU(BND - L(f(Xs), Yr)),
(8)
Call Cretain + Lieara + 3L + aLre,
(9)
where BND defines the forgetting boundary, and (X f, Y,) represents the data from the forgetting set.
5. Experiments
5.1. Experimental Setup
All experiments are conducted on a hardware setup com- prising 2xRTX 4090 GPUs, with the software environment configured as Python 3.12, PyTorch 1. and CUDA 12.4. The AdamW optimizer is employed for all training and forgetting phases.
4.4. Training and Inference Protocol
In the learning phase, the objective is for the model to acquire new knowledge while retaining essential existing knowledge. Accordingly, the loss function for this phase is defined as follows.
For image classification tasks, the learning set includes: CUB-200-2011 1 (Wah et al., 2011), Oxford-IIIT Pet (Parkhi et al., 2012), RESISC45 (Cheng et al., 2017) and Pilnt lage (Geetharamani & Pandian, 2019). Both the retention
Cretain = -(J(X,), Y,),
(5)
6

---

Knowledge Swapping via Learning and Unlearning
celling
light
ming
lig
ceiling
light
oconce
WE
picture
WEllI
picture
WAR
picture
wind
Wwind
wind
ant
Jamo
cuchion
eint
Irux cushlon
annt
abbl
rable
cable
bed
pour
pour
floor
DAD
TiDo
Dan
DAN
The forgotten classes are lamp and scope. The learned class is cow. The retained classes are all remaining classes.
animal
COW
CDVY
grass
255
Forgetting After Learning Figure Qualitative results on semantic segmentation. The forgotten classes are marked with red dotted lines, and the learned class marked with dark green dotted lines.
Pretrained
Learning
set and the forgetting set are selected from ImageNet- 100. During the training phase, the hyperparameters are set to = 0.05 and 3 = 0.2, while BND = 105 the forgetting phase. The classification performance evaluated using accuracy as the primary metric.
rently, the forgetting phase appears to be more straightfor- ward, as the accuracy of the forgetting set decreases from approximately 80% to 0%, indicating successful forgetting. Besides, the retaining set can also be well preserved even though there exist limited negative impacts on the whole phase. We further evaluate the reverse order (Learning After Forgetting) in the same setting. We observe that although the accuracy of the forgetting set initially drops significantly during the forgetting phase, the subsequent learning phase induces substantial changes in the model's lower-level pa- rameters. This renders the previously forgotten higher-level parameters ineffective, resulting in an increase the ac- curacy of the forgetting set during the later stages. These findings confirm the validity of our hypothesis.
For object detection tasks, the learning consists of CUB- 200-2011 1 and Stanford Dogs (Dataset, 2011). Both the retention set and the forgetting set are sourced from the COCO (Lin et al., 2014) dataset. The learning phase em- ploys a = 0.01 and B = 0.9, while the forgetting phase uses BND 15, a 0.01, and = 0.2. The detection capability assessed using the mean Average Precision (mAP) metric.
For semantic segmentation tasks, the learning set includes: Pascal VOC (Hoiem et al., 2009), COCO, Oxford-IIIV Pet (Parkhi et al., 2012), and DeepGlobe Land (Demir et al., 2018). These datasets cover a diverse range of segmentation domains. The learning phase configured with a 0.01 and 0.9 while the forgetting phase is BND 115, 0.01, and B 0.2. The segmentation accuracy is evalu- ated using the mean Intersection over Union (mloU) metric.
5.3. Semantic Segmentation Results
We select the pretrained Mask2Former(Cheng al., 2021) model ADE20K as the pretraining model. The results in Table demonstrate that under the Learning Before Forget- ting strategy, the mloU of the retention set remains stable, ensuring effective memory retention. In contrast, the mloU of the forgetting set decreases from 68.31 to nearly 0%, indicating complete forgetting. Concurrently, the learning set achieves high mloU, confirming successful knowledge acquisition. Figure 5 further illustrates this process, where the classes lamp and sconce successfully forgotten and blended into the wall, while the learned class cow remains well retained even after the forgetting phase. In contrast, under the Learning After Forgetting setting (Table 2), al-
5.2. Classification Results
We VIT-B16 model pretrained ImageNet100 as the base model. As shown in Table under the Learning Before Forgetting setting, the accuracy of the learning set consistently increases from approximately 0% to over 90%, demonstrating effective knowledge acquisition. Concur-

---

Knowledge Swapping via Learning and Unlearning
Table Semantic segmentation results on four datasets. For each dataset, learning set and forgetting set include randomly selected
5 classes. The retaining set includes all other classes from ADE20K.
VOC
Oxford-pet
COCO
Deepglobe Land
procedure
m
m
m
mloU,
m ,
mloU, 1
mloU,
mloU, 4
mloU,-
mloU, 1 mloU,
Start
50.51
68.31
50.51
68.31
50.51
68.31
50.51
68.31
50.36
2.26
50.61
3.48
50.24
2.41
50.66
3.65
F-L
50.7
85.45
49.42
50.28
59.45
53.67
51.03
90.87
54.47
50.38
54.33
60.25
F L-
50.98
88.07
0.15
50.17
61.85
0.33
50.64
94.64
0.39
50.87
63.86
0.27
L
50.2
84.97
60.67
48.92
62.21
65.5
50.54
93.46
61.85
50.96
59.8
64.61
L-F
50.57
85,43
0.12
49.87
69.55
0,08
50.35
93.36
0.71
49.54
58.34
0.4
F
50.5
95.83
45.51
50.97
86,98
53.87
50.41
97.27
50.03
50.54
69.18
57.25
FW LL
F- =F
F FW
Difference leam
Difference forget
20
20
Valucs
15
15
Values
15
10
10
10-
5
5
0
10
20
30
10
20
30
0
10
20
30
Index
Index
dex
Pascal Voc
Oxford-IITT Pet
DeepGlobe Land
Figure Ca of weights in L
though both the retention and learning sets perform well, the mloU the forgetting set increases after learning due to significant changes in low-level parameters, rendering pre- viously tuned high-level forgetting parameters ineffective. Figure 7 highlights this issue, showing that mountain, which is initially erased and blended into sand, re-emerges after learning, demonstrating the instability of this approach.
sky
bKy
rrountai
5ea
663
sand
band
sand
F
L
Figure 7. Semantic segmentation results for Learning After Forget- ring on ADE20K.
5.4. Object Detection Results
For the object detection task, 2022) pretrained on the COCO dataset as the base model. The forgetting set consists of five randomly selected classes: person, teddy bear, toilet, bench, and bed, while all re- maining classes form the retention set. The learning sets consist of classes: Black-footed Albatross, Laysan Al- batross, Sooty Albatross, Groove-billed Ani, and Brewer Blackbird for CUB-200-2011 and Chihuahua, Maltese Dog, Basset, American Staffordshire Terrier, and Norwich Terrier for Stanford Dogs, respectively.
DINO (Zhang al.,
getting set drops from 44.5% to below 1%, and the learning set improves from 0 to satisfactory level, confirming the success of our approach. In contrast, it also shows that in the Learning After Forgetting( F - I.) setting, the forgetting set retains a relatively high mAP, indicating ineffective forget- ting. This supports our hypothesis that learning progresses from low-level to high-level features, while forgetting fol- lows the opposite direction, from high-level to low-level features.
Table 3. Object Detection Results on COCO.
Cub
Stanford Dogs
5.5. Insights and Discussion
procedure
mAP,
mAP;
mAP, L
mAP, 1
mAP,
mAP,
Start
55.4
44.5
44.5
To further validate the effectiveness of our strategy, we conduct an additional experiment involving Forget-Learn- Forget sequence. As shown in Table 2, although the mloU of the forgetting set remains high after the initial forgetting and subsequent learning phases, it is significantly reduced after the second forgetting phase. This result demonstrates the robustness the Learn Before Forget strategy. The results - F I. further provide indirect evidence that
54.9
9.7
55
65.4
78.5
11.1
55.3
64.3
37.6
54.5
67.5
37.5
55.5
62.2
0.5
55
80.1
0.6
The quantitative results in Table demonstrate the effective- ness of our Learning Before Forgetting strategy, as the mAP of the retention remains stable at around 55% the for-
8

---

Knowledge Swapping via Learning and Unlearning
positioning the learning phase the end influences the con- tent that was previously forgotten. We analyze the L2 norm of model parameters at different stages, illustrated in Fig- ure 6. The red line represents parameter changes from F to F + I,, while the black line indicates changes from F + I. to F + L + F. The results show that Iearning-inducee parameter changes are primarily concentrated in the early layers of the model, whereas forgetting-rede relatee changes are more prominent in the later layers. These observations align well with our previous findings.
Paz, D. Using hindsight to anchor past knowledge in continual learning. In Proceedings of the AAAI confer- ence artificial intelligence, volume 35, pp. 6993-7001, 2021.
Chen, K., Du, Y., You, T.,, Islam, M., Guo, 7.,, Jin, Y., Chen, G., and Heng, P.-A. Llm-assisted multi-teacher continual learning for visual question answering in robotic surgery. arXiv preprint arXiv:2402.16664 2024.
Cheng, B., Schwing, A., and Kirillov, A. Per-pixel clas- sification is not all you need for semantic segmentation. Advances neural information processing systems, 34: 17864-17875, 2021.
6. Conclusion and Future Works
We proposed Knowledge Swapping, a novel task that en- ables selective regulation of model knowledge by achieving three goals: forgetting user-specified knowledge, retaining essential knowledge, and learning new knowledge. To ac- complish this, we introduced a two-stage training strategy based on the Learning Before Forgetting principle, which decouples learning and forgetting to mitigate catastrophic forgetting effectively. We benchmark our Learning Be- fore Forgetting with various experiments. However, our experiments also reveal that the difficulty of learning new knowledge for different categories and forgetting old knowl- edge varies. An interesting direction for future research is to explore and analyze the difficulty of forgetting specific knowledge and learning new knowledge of categories.
Cheng, D., Ji, Y., Gong, D., Li, Y., Wang. N., Han, J., and Zhang, D. Continual all-in-one adverse weather removal with knowledge replay unified network structure. IEEE Transactions on Multimedia, 2024a.
Cheng, D., Zhao, Y., Wang, N., Li, G., Zhang, D., and Gao, X. Efficient statistical sampling adaptation for exemplar- free class incremental learning. IEEE Transactions on Circuits and Systems for Video Technology, 2024b.
Cheng, G., Han, J., and Lu, X. Remote sensing image scene classification: Benchmark and state of the art. Proceed- ings of the IEEE, 105(10):865--188) 2017.
Acknowledgements
Dataset, E. Novel datasets for fine-grained image catego- rization. In First Workshop on Fine Grained Visual Cate- gorization, CVPR. Citeseer: Citeseer. Citeseer, volume 5, pp. 2. Citeseer, 2011.
This work has been supported by the New Cornerstone Sci- ence Foundation through the XPLORER PRIZE. This work was funded by the National Natural Science Foundation of China (No. 72188101 & No. 62472139 & No. 62302140) and the Fundamental Research Funds for the Central Univer- sities (No. JZ2024HGTB0261 & No. JZ2024HGTA0113, The computation completed on the HPC Platform of Hefei University of Technology.
Demir, I., Koperski, K., Lindenbaum, D.,, Pang, G., Huang, J., Basu, S., Hughes, F., Tuia, D., and Raskar, R. Deep- globe 2018: A challenge to parse the earth through satel- lite images. In Proceedings of the IEEE conference on computer vision and pattern recognition workshops, pp. 172-181, 2018.
Impact Statement
Douillard, A., Ramé, A., Couairon, G., and Cord, M. Dytox: Transformers for continual learning with dynamic token expansion. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 9285 9295, 2022.
This paper presents work whose goal is to advance the field of Machine Learning. There are many potential societal consequences of our work, none of which we feel must be specifically highlighted here.
Feldman, V. Does learning require memorization? short tale about a long tail. In Proceedings of the 52nd Annual ACM SIGACT Symposium on Theory of Computing, pp. 954-959, 2020.
References
Ashok, A., Joseph, K., and Balasubramanian, V. N. Class- incremental learning with cross-space clustering and con- trolled transfer. In European Conference Computer Vision, pp. 122. Springer, 2022.
Geetharamani, G. and Pandian, A. Identification of plant leaf diseases using a nine-layer deep convolutional neural network. Computers & Electrical Engineering, 76:323- 338, 2019.
Chaudhry, A., Gordo, A., Dokania, P., Torr, P., and Lopez-
9

---

Knowledge Swapping via Learning and Unlearning
Geva, M., Schuster, R., Berant, J., and Levy, O. Transformer feed-forward layers are key-value memories. arXiv preprint arXiv:2012. 14913, 2020.
Lin, T.-Y., Maire, M., Belongie, S., Hays, J., Perona, P., Ra- manan, D., Dollár, P., and Zitnick, C. L.. Microsoft coco: Common objects in context. In Computer Vision-ECCV 2014: 13th European Conference, Zurich, Switzerland, September 6-12, 2014, Proceedings. Part V 13, pp. 740- 755. Springer, 2014.
Han, X., Zhang, Z., Ding, N., Gu, Y., Liu, X., Huo, Y., Qiu, J., Yao, Y., Zhang, A., Zhang, L.,, et al. Pre-trained models: Past, present and future. Al Open, 2:225-250, 250, 2021.
Liu, B., Wang, M., Foroosh, H., Tappen, M., and Pensky, M. Sparse convolutional neural networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 806-814, 2015.
Hoiem, D., Divvala, S. K., and Hays, H. Pascal voe 2008 challenge. World Literature Today, 24(1):1-4, 2009.
Hu, E. J., Shen, Y., Wallis, P., Allen-Zuu, Z., Li, Y., Wang. S., Wang, L., and Chen, W. Lora: Low-rank adaptation of large language models. arXiv preprint 1exxi:2/06.0900 2021.
Liu, H. and Liu, H. Continual learning with recursive gra- dient optimization. arXiv preprint arXiv:2201.12522, 2022.
Huang, L., An, Z., Zeng, Y., Xu, Y., et al. Kfc: Knowl- edge reconstruction and feedback consolidation enable efficient and effective continual generative learning. In The Second Tiny Papers Track ICLR 2024, 2024a.
Liu, J., Ram, P., Yao, Y., Liu, Liu, Y., SHARMA, P., Liu, S., et al. Model sparsity can simplify machine unlearning. Advances in Neural Information Processing Systems, 36, 2024a.
Huang, L.., Zeng, Y., Yang, C., An, Z., Diao, B., and Xu, Y. etag: Class-incremental learning via embedding distilla- tion and task-oriented generation. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 38, pp. 12591-12599, 2024b.
Liu, S., Yao. Y., Jia, J., Casper, S., Baracaldo, N., Hase, P., Yao, Y., Liu, C. Y., Xu, X., Li, H., et al. Rethinking machine unlearning for large language models. arXiv 2024b.
preprint arXivv2402.0881
Liu, Z., Dou, G., Tan, Z., Tian, Y. and Jiang, M. Towards safer large language models through machine unlearning. arXiv preprint arXiv:2402. 10058, 2024c.
Kirkpatrick, J., Pascanu, R., Rabinowitz, N., Veness, J., Des- jardins, G., Rusu, A. A., Milan, K., Quan, J., Ramalho, T., A., et al. Overcoming catastrophic forgetting in neural networks. Proceedings of the national academy of sciences, 114(13)3351133526 2017.
Lu, A., Feng, T., Yuan, H., Song, X., and Sun, Y. Revisiting neural networks for continual learning: An architectural perspective. arXiv preprint arXiv:2404. /4829, 2024.
Koh, P. W. and Liang, P. Understanding black bbxck-box predic- tions via influence functions. In International conference on machine learning, pp. 1885- 1894. PMLR, 2017.
Parkhi, O. M., Vedaldi, A., Zisserman, A., and Jawahar, C. Cats and dogs. In 2012 IEEE conference on computer vision and pattern recognition, pp. 2012.
IEEE,
Kurmanji, M., Triantafillou, P., Hayes, J., and Triantafillou, E. Towards unbounded machine unlearning. Advances in neural information processing systems, 36, 2024.
Rebuffi, S.-A., Kolesnikov, A., Sperl, G., and Lampert, C. H. icarl: Incremental classifier and representation learning. In Proceedings of the IEEE conference on Computer Vision and Pattern Recognition, pp. 2001-2010. 2017.
Langley, P. Crafting papers on machine learning. In Langley, P. (ed.), Proceedings of the 17th International Conference on Machine Learning (ICML 2000). pp. 1207-1216, Stan- ford, CA, 2000. Morgan Kaufmann.
Rusu, A. A., Rabinowitz, N. C., Desjardins, G., Soyer, H., Kirkpatrick, J., Kavukcuoglu, K., Pascanu, R., and Had- sell, R. Progressive neural networks. arXiv preprint TrXiv:1606.04: 04671, 2016.
Li, H., Tan, Z., Li, X., and Huang, W. Atlas: Adapter-based modal continual learning with a two-stage learning strategy. arXiv preprint arXiv:2410. 11.::240..0093,, 2024.
Li, and Hoiem, D. Learning without forgetting. JEEE transactions on pattern analysis and machine intelligence, 40(12):2935-2947 2017.
Sun, W., Li, Q., Zhang, J., Wang, W., and Geng, Y.- a. Decoupling learning and remembering: A bilevel memory framework with knowledge projection for task- incremental learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 20186-20199 2023.
Lin, H., Zhang, B., Feng, $., Li, X., and Ye, Y. Per: Proxy- based contrastive replay for online class-incremental con- tinual learning. In Proceedings of the IEEE/CVF Con- ference on Computer Vision and Pattern Recognition, pp. 24246-24255, 2023.
Wah, C., Branson, S., Welinder, P., Perona, P., and Belongie, S. The caltech-uesd birds-200-2011 dataset. 2011.
10

---

Knowledge Swapping via Learning and Unlearning
Wang, F.-Y,, Zhou, D.-W., Ye, H.-J., and Zhan, D.-C. Foster:
adversarial training for robust concept erasure in diffusion models. arXiv preprint arXiv:2405. /5234, 2024b.
Feature boosting and compression for class-incremental learning. In European conference computer vision, pp. 398 414. Springer, 2022a.
Zhou, D.-W., Wang, Q.-W., Ye, H.-J., and Zhan, D.-C. model or 603 exemplars: Towards memory-efficient class- incremental learning. arXiv preprint wrXiv:2205.32211 2022.
Wang, H., Lin, J., Chen, B., Yang. Y., Tang, R., Zhang. W., and Yu, Y. Towards efficient and effective unlearning of large language models for recommendation. Frontiers of Computer Science, 19(3):193327, 2025.
Zhu, F., Zhang, X.-Y., Wang, C., Yin, F., and Liu, C.-L. Pro- totype augmentation and self-supervision for incremental learning. Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 5871- 5880, 2021.
Wang, L., Zhang, X., Su, H., and Zhu, comprehen- sive survey of continual learning: theory, method and application. IEEE Transactions Pattern Analysis and Machine Intelligence, 2024.
Zhu, L., Chen, T., Yin, J., See, S., and Liu, Continual semantic segmentation with automatic memory sample selection. In Proceedings of the IEEE/CVF Conference Computer Vision and Pattern Recognition, pp. 3082- 3092, 2023.
Wang, W., Hu, Y., Chen, Q. and Zhang. Y. Task difficulty aware parameter allocation regularization for lifelong learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 7776- 7785, 2023.
Wang, Z., Zhang, Z., Lee, C.-Y., Zhang, H., Sun, R., Ren, X., Su, G., Perot, V., Dy, J., and Pfister, T. Learning to prompt for continual learning. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 139-149, 2022b.
Wen, W., Wu, C.,, Wang, Y., Chen, Y., and Li, H. Learning structured sparsity in deep neural networks. Advances in neural information processing systems, 29, 2016.
Wu, F., Cheng. L., Tang, S., Zhu, X., Fang. C., Zhang, D., and Wang, M. Navigating semantic drift in task- agnostic class- insremmaatt learning. arXiv preprint arXiv:2502.07560. 2025.
Yang. Y., Cui, Z., Xu, J., Zhong. C., Zheng, W.-S., and Wang, R. Continual learning with bayesian model based fixed pre-trained feature extractor. Visual Intelli- gence, 1(1):5, 2023.
Yuan, M. and Lin, Model selection and estimation in regression with grouped variables. Journal of the Royal Statistical Society Series B: Statistical Methodology, 68 (1):49-67, 2006.
Zhang, D., Li, Y., Cheng, D., Wang. N., and Han, J. Center- sensitive kernel optimization for efficient on-device in- cremental learning. arXiv preprint arXiv:2406.086. 088330, 2024a.
Zhang, H., Li, F., Liu, S., Zhang, I.., Su, H., Zhu, J., Ni, L. M., and Shum, H.-Y. Y. Dino: Detr with improved denois- ing anchor boxes for end-to-end object detection. arXiv preprint 22X3:2203.03603 2022.
Zhang, Y., Chen, X., Jia, J.. Zhang, Y., Fan, C., Liu, J., Hong, M., Ding, K., and Liu, S. Defensive unlearning with


Reviews:
[{"review_id": "abPNfDAfMk", "reviewer": "Reviewer_3jJx", "summary": "This paper proposed Knowledge Swapping, a novel task designed to regulate knowledge of a pretrained model selectively. Meanwhile, this paper uncovers that incremental learning progresses from low-level to higher-level semantic features, whereas targeted forgetting begins at high-level semantics and works downward. Therefore, the paper achieves knowledge swapping by the sequential learning-then-forgetting principle. Comprehensive experiments on various tasks like image classification, object detection, and semantic segmentation validate the effectiveness of the proposed strategy.", "questions": "", "limitations": "", "rating": 4, "confidence": null, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "We thank Reviewer **3jJx** for the valuable comments. Reviewer 3jJx appreciates that \"**Knowledge Swapping is a good task**,\" \"is **interesting and novel**,\" \"**well-structured**,\" represents a \"**novel and intriguing concept**,\" and is \"**robust**.\" Below, we provide detailed responses addressing the remaining concerns.\n>**Reviewer 3jJx asks for more results in Fig.5 & Fig.7.**\n\nThank you for this suggestion. We have included additional related results (**Fig. S3 and Fig. S4**) in the supplementary material accessible via the anonymous link (https://anonymous.4open.science/r/rebuttal-C764/figures.pdf). These results will also be included explicitly in our final manuscript.\n\n>**Reviewer 3jJx suggests providing further discussion about the limitations of the current approach, specifically regarding the varying difficulty in learning and forgetting different types of knowledge, and outlining potential future directions.**\n\nWe greatly appreciate Reviewer 3jJx’s insightful recommendation to elaborate on limitations. Our experiments have demonstrated that the difficulty in acquiring new knowledge and the ease of forgetting existing knowledge indeed vary significantly across different categories. Investigating these variations presents a meaningful future research direction. Specifically, exploring and characterizing the complexity associated with different knowledge categories can reveal critical insights. **One promising approach is to incorporate uncertainty-based assessment methods, as discussed by **[R1]**, to better evaluate model confidence and quantify these complexities**. Employing uncertainty estimation can further elucidate the underlying mechanisms influencing learning and forgetting within our proposed framework. Ultimately, this line of inquiry may foster the development of more robust, targeted, and efficient strategies in future research.\n\n**References:**\n\n[R1] Gawlikowski, Jakob, et al. \"A survey of uncertainty in deep neural networks.\" *Artificial Intelligence Review*, 2023.", "claims_and_evidence": "The claims of this paper are clear and supported by convincing evidence. The claims are summarized as:\n1)\tKnowledge Swapping is an interesting and novel task.\n2)\tThe incremental learning progresses from low-level to higher-level semantic features, whereas targeted forgetting begins at high-level semantics and works downward. This is the motivation for how to design effective knowledge-swapping procedures.\n3)\tComprehensive experiments on various tasks like image classification, object detection, and semantic segmentation validate the effectiveness of the proposed strategy.", "methods_and_evaluation_criteria": "The proposed method appears to be reasonable based on the following key aspects.\n(1). Empirical Justification of Learning and Forgetting Strategies (Section 3.2).\n-The paper systematically investigates the impact of learning-before-forgetting and forgetting-before-learning strategies by analyzing parameter changes across multiple image segmentation tasks.\n-By comparing these strategies under controlled settings, the method provides empirical evidence supporting the claim.\n(2). Logical and Coherent Model Design (Section 4).\n-The model's formulation aligns well with the problem setting, ensuring that each component has a justified role in improving performance.\n-The theoretical reasoning provided in this section lays a solid foundation for the model’s expected behavior.\n(3). Generalization and Robustness Considerations.\n-The proposed method is tested on multiple datasets and task, and the findings are consistent, it implies that the approach is not overly specialized for a single case.\n-The method’s adaptability to different settings (e.g., segmentation, classification) further validates its broader applicability.\n(4). Minimal Unjustified Assumptions\n-The paper does not seem to rely on overly strong assumptions that could limit its real-world applicability.", "theoretical_claims": "Yes, Both claims seem reasonable given the paper’s empirical results and theoretical grounding.", "experimental_designs_or_analyses": "Yes, the theoretical claims in the paper are valid. The experimental designs and analyses have been carefully checked, covering three tasks: image classification, object detection, and semantic segmentation. The results demonstrate the effectiveness of the proposed method, and the analysis is reasonable, further supporting the correctness of the claims.", "relation_to_broader_scientific_literature": "(1). Knowledge Swapping is a good task. The concept of Knowledge Swapping introduces a novel approach to balancing learning new tasks while selectively forgetting less important or sensitive prior knowledge. The idea of Knowledge Swapping differs from existing continual learning and machine unlearning.\n(2). The discovery of “learning-before-forgetting” is interesting and novel. This further provides a guidance for related researches.\n(3). I think this work could be applied to various existing large-model-based works. For example, Privacy-Preserving AI and Federated Learning, AI Model Auditing and Compliance, etc.", "essential_references_not_discussed": "None.", "other_strengths_and_weaknesses": "(1). The writing of this draft is clear and content of each section is well-structured.\n(2). Knowledge Swapping is a newly defined task that introduces a novel and intriguing concept. The proposal of this task expands the scope of deep learning and holds significant potential for advancing the industry.\n(3). The experimental design is robust, incorporating various tests and analyses that provide compelling evidence to support the conclusions.", "other_comments_or_suggestions": "Suggestion: Add more examples in Figures 5 and 7 to make the experiments more comprehensive and the paper more convincing.", "questions_for_authors": "As the authors mentioned in the limitations, the difficulty of learning and forgetting different types of knowledge varies. Could you discuss this further and suggest potential directions for future research?", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "extra_scores": {}}, {"review_id": "r58bwrTrwp", "reviewer": "Reviewer_tJYm", "summary": "This paper introduces a new task called Knowledge Swapping, which aims to regulate the knowledge of a pretrained model by optimizing three objectives: forgetting user-specified knowledge, retaining core pretrained knowledge, and simultaneously learning new knowledge. The authors empirically demonstrate that learning new knowledge before forgetting specified knowledge leads to better results than the reverse order.", "questions": "", "limitations": "", "rating": 3, "confidence": null, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "We sincerely thank Reviewer tJYm  for the insightful and constructive comments. Reviewer tJYm finds that \"Knowledge Swapping is a **practical and novel task**\", “the experimental design is overall **valid**”, and \"learning before forgetting would be a **substantial contribution**\". We address the main concerns below.\n>**Reviewer tJYm  think (1) weight norms in Fig. 2 do not convincingly validate the key claim; (2) more metrics like CKA are suggested to make a stronger argument.**\n\nThanks. (1) We would like to clarify potential confusion regarding Fig. 2. Specifically, in the $L^W→F$ (Fig.2(a)), the shallow layer weight norms clearly increase significantly during the learning phase compared to those in the $F^W→L $ (Fig.2(b)). Given that we initialize the weights uniformly using Kaiming initialization, resulting in an average initial norm of approximately 1.12, the observed increase in shallow-layer norms in Fig. 2(a) implies substantial updates occurring at shallow layers during learning (thereby subsequently impacting the middle-to-deep layers).  Conversely, the elevated norms observed in Fig. 2(b), when the forgetting phase precedes learning, occur primarily in middle-to-deep layers. **This difference indicates that when learning precedes forgetting, modifications mainly affect higher-level semantic information, whereas in the forgetting-first scenario, substantial updates are more prominent in shallow layers.** We hope this clarification adequately addresses the reviewer's concern. \n\n(2)  Good suggestion!  We have conducted additional validation experiments using the CKA metric as recommended. The detailed results   are available (Fig. S1 and Fig. S2) at the anonymous link (https://anonymous.4open.science/r/rebuttal-C764/figures.pdf) and further corroborate our original findings. \n\n**Should additional clarification be required, we would gladly engage in further discussion during the rebuttal period.**\n\n>**Reviewer tJYm  suggests more sequential $L$ and $F$ phase.**\n\nGood point. We have explored sequential phases of learning and forgetting as reported in Tab.2 (F→L→F and L→F→L). We have now extended these experiments by adding further cycles, as shown in the updated results below:\n\n|||VOC|||Oxford-pet||\n|-|-|-|-|-|-|-|\n||mIoU$_r$↑|mIoU$_l$↑|mIoU$_f$↓|mIoU$_r$↑|mIoU$_l$↑|mIoU$_f$↓|\n|Start|50.51|0|68.31|50.51|0|68.31|\n|F|50.36|0|2.26|50.61|0|3.48|\n|F→L|50.70|85.45|49.42|50.28|59.45|53.67|\n|F→L→F|50.98|88.07|0.15|50.17|61.85|0.33|\n|F→L→F→L|51.28|96.21|40.95|50.84|88.86|45.94|\n|F→L→F→L→F|50.43|94.60|1.90|50.54|88.49|0.25|\n|L|50.20|84.97|60.67|48.92|62.21|65.50|\n|L→F|50.57|85.43|0.12|49.87|69.55|0.08|\n|L→F→L|50.50|95.83|45.51|50.97|86.98|53.87|\n|L→F→L→F|50.43|93.19|1.09|50.20|88.38|1.06|\n|L→F→L→F→L|50.51|97.50|33.28|51.03|91.12|43.35|\n\nThe expanded experimental results continue to support our claim: concluding with  F→L makes forgetting significantly more challenging,  whereas ending with L→F effectively alleviate this. Additionally, multiple cycles appear to contribute to incremental performance improvements.\n>**Reviewer tJYm  questions whether the observed forgetting results reflect genuine forgetting or merely the model's ability to nullify LoRA weights.**\n\nThanks. We respectfully provide an alternative interpretation based on the following considerations:\n(1) Our \"knowledge swapping\" task explicitly requires the model to forget knowledge originally learned during pretraining. Merely nullifying LoRA parameters (setting them to 0) would return the model to its pretraining state without achieving actual forgetting of previously learned knowledge.\n\n(2) Additionally, we conduct further experiments using CNN-based full tuning (ResNet-18). We set the model to learn 5 new classes and forget 5 original classes. These results still demonstrate the validity of our key insight. (Please see the first response for R#ab73).\n\n**Should further clarification be necessary, we would welcome additional discussion during the rebuttal period.**\n>**Reviewer tJYm  suggests to explore more results  about the forgetting of emergent knowledge not included in the pretraining data.**\n\nThanks. We additionally conduct segmentation experiments on the COCO dataset, where \"l5f1\" denotes learning 5 new classes and forgetting 1 new class (with other settings similar), none of which are included in the pretraining. Interestingly, the accuracy for the forgotten class dropped to 0. This indicates that forgetting emergent knowledge (previously unknown during pretraining) can be readily achieved by nullifying specific LoRA parameters. However, our primary scenario involves forgetting previous knowledge (distinct from \"emergent knowledge\" as defined in Sec. 3.1). For detailed results and discussions, please refer to the previously response.\n||mIOU$_r$↑| mIOU$_l$↑|mIOU$_f$↓|\n|---------|--------------|--------------|--------------|\n|l5f1|50.36|93.78|0|\n|l4f2|50.68|96.78|0|\n|l3f3|49.98|98.03|0|\n|l2f4|50.87|98.88|0|\n|l1f5|50.17|98.05|0|", "claims_and_evidence": "The manuscript is based on the claim that in the Learning then Forgetting sequence, most parameter updates occur in the latter layers of the neural network, while in the Forgetting then Learning sequence, changes are concentrated in the earlier layers.\nHowever, in my opinion the empirical study presented in Figure 2 does not clearly validate such a claim. Specifically, the observed parameter norms appear similar regardless of whether the Learning or Forgetting phase comes first. Moreover, the value of weight norms alone may not be a suitable metric to evaluate the extent to which different layers are affected, as it does not directly capture changes in feature representations or their semantic hierarchy. I suggest using more established measures of change across layers, such as CKA as in [1,2], to make a stronger argument.\n\n[1]:  Boschini, Matteo, et al. Transfer without forgetting. In ECCV 2022.  \n[2]: Ramasesh, V. V., et al. Anatomy of catastrophic forgetting: Hidden representations and task semantics. In ICLR 2020.", "methods_and_evaluation_criteria": "Since the manuscript is positioned within a continual learning context, I believe it would be valuable to include experiments involving more than three sequential learning and forgetting phase (e.g., alternating learn→forget→learn→forget->learn).\n\nFurthermore, the forgetting sets used in the experiments are predefined subsets of the pretraining data. It would be interesting to explore the forgetting of emergent knowledge not included in the pretraining data, as such knowledge cannot be forgotten by zeroing out the learned LoRA matrices.", "theoretical_claims": "N/A", "experimental_designs_or_analyses": "The experimental design is overall valid but lacks an evaluation of more than three sequential learning and forgetting phases. Since the main experiments only considers a single learning and forgetting cycle, it remains unclear whether the observed forgetting effects stem from the order of these phases, as claimed by the authors, or from the model’s ability to set to 0 the LoRA parameters, thus returning to the pre-training configuration.", "relation_to_broader_scientific_literature": "The original claim regarding the order of learning and forgetting would be a substantial contribution.", "essential_references_not_discussed": "N/A", "other_strengths_and_weaknesses": "Strengths:\n1) The manuscript introduces a practical and novel task (Knowledge Swapping) with real-world applications (e.g., privacy compliance, model adaptation).   \n2) The proposed approach is based on the insight that incremental learning progresses from low-level to higher-level semantic features, which offers an actionable strategy for dynamic model adaptation.   \n\nWeaknesses:\n1) The claim that incremental learning follows a progression from low-level to high-level features is not convincingly demonstrated, as the experiments do not provide clear empirical evidence to support it.   \n2)  Experiments do not reflect continual learning’s iterative nature or emergent forgetting scenarios. While they show the effectiveness of the proposed strategy, they do not allow for direct comparison with existing continual learning approaches. In particular, I believe the results observed during the forgetting phase may be attributed to the model's ability to effectively nullify the contributions of LoRA weights, rather than reflecting the model's inherent capacity to forget a given task. This I believe is also supported by Tab. 2, where it seems that the only important thing in the evaluated scenario is for the forgetting phase to happen last in the sequence.", "other_comments_or_suggestions": "N/A", "questions_for_authors": "See section on \"Claims And Evidence\" and \"Methods And Evaluation Criteria\"", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "extra_scores": {}}, {"review_id": "cWaAZ01Iy1", "reviewer": "Reviewer_ab73", "summary": "1. This paper introduces Knowledge Swapping, a novel task designed to selectively regulate a pretrained model's knowledge by enabling the forgetting of user-specified information while retaining essential knowledge and acquiring new knowledge simultaneously. \n\n2. The authors propose a two-stage training strategy based on the \"Learning Before Forgetting\" principle, which decouples learning and forgetting processes to effectively mitigate catastrophic forgetting and achieve better performance in knowledge regulation. \n\n3. Comprehensive experiments across various tasks including image classification, object detection, and semantic segmentation demonstrate the effectiveness of the proposed approach, showing significant improvements in retaining essential knowledge, forgetting specified content, and learning new information compared to alternative approaches.", "questions": "", "limitations": "", "rating": 3, "confidence": null, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "We sincerely thank Reviewer ab73 for the valuable comments. Reviewer ab73 notes that our **claims are well-supported by experimental evidence and technical details**, acknowledges that **Tables 1–3 demonstrate superior results** for our proposed method compared to the reverse approach, commends our two-stage approach as **well-motivated by our analysis** of how learning and forgetting affect different layers of neural networks, and highlights the **generalizability of our method across various vision problems**. We address the main concerns as follows:\n\n>**Additional results using other architectures, such as CNNs.**\n\nGood point.  We conduct additional experiments using the ResNet-18 architecture to learn five new classes and forget five original classes. These additional results consistently support the key insight of \"Learning before Forgetting.”\n|Procedure||Cub|||Oxford-pet||\n|---------|---|---|---|----------|---|---|\n|         |Acc$_r$↑|Acc$_l$↑|Acc$_f$↓|Acc$_r$↑|Acc$_l$↑|Acc$_f$↓|\n|Start|77.32|0|68.00|77.32|0|68.00|\n|F|77.874|0|3.60|78.52|0|4.0|\n|F→L|75.13|50|16.40|76.12|54.80|11.60|\n|L|76.48|51.19|58.80|78.16|58.4|59.6|\n|L→F|76.88|73.81|0.0|76.21|81.60|0.4|\n\n\n|Procedure||Resisc45|||Plantvillage||\n|---------|:-------:|:-------:|:-------:|:-------:|:-------:|:-------:|\n|         |Acc$_r$↑|Acc$_l$↑|Acc$_f$↓|Acc$_r$↑|Acc$_l$↑|Acc$_f$↓|\n|Start|77.32|0|68.00|77.32|0|68.00|\n|F|79.05|0|3.2|78.04|0|2.4|\n|F→L|76.08|77.60|6.0|73.43|70.53|6.80|\n|L|75.95|72.2|54.0|71.83|87.95|51.20|\n|L→F|77.03|95.0|0.4|77.20|97.20|1.60|\n\n\n>**More ablation studies about individual components, such as the impact of different regularization strengths and the importance of sparse constraints.**\n\nThank you for this suggestion. The table below summarizes the performance metrics on the CUB dataset when excluding sparse constraints. Metrics are provided under various conditions (default settings: $\\alpha_l = \\alpha_f = 0.01$):\n\n|Condition|CUB mAP$_r$↑|CUB mAP$_l$↑|CUB mAP$_f$↓|\n|---------|------------|------------|------------|\n|$\\alpha_l$=0, $\\alpha_f$=0|55.4|60.3|0.4|\n|$\\alpha_l$=0, $\\alpha_f$=0.01|55.5|61.2|0.3|\n|$\\alpha_l$=0.01, $\\alpha_f$=0|55.3|61.3|0.5|\n|$\\alpha_l$=0.01, $\\alpha_f$=0.01|55.5|62.2|0.5|\n\n>**More ablation studies about  hyperparameters ($\\alpha$, $\\beta$, BND).**\n\nBelow we provide detailed ablation results illustrating the impact of various hyperparameters on detection performance using the CUB dataset as the learning set.\n\n**Effect of BND (default: BND=15)**\n\n|BND|CUB mAP$_r$↑|CUB mAP$_l$↑|CUB mAP$_f$↓|\n|-|-|-|-|\n|5|55.7|64.5|30.5|\n|15|55.5|62.2|0.5|\n|25|55.6|48.4|5.4|\n|50|55.2|44.3|8.1|\n**Effect of $\\beta_{learn}$ (default: $\\beta_{learn}=0.9 $)**\n\n|$\\beta_{learn}$|CUB mAP$_r$↑|CUB mAP$_l$↑|CUB mAP$_f$↓|\n|-|-|-|-|\n|50|55.4|55.9|1.0|\n|10|55.3|61.4|0.7|\n|2|55.4|61.8|0.6|\n|0.9|55.5|62.2|0.5|\n|0.5|55.5|60.5|0.3|\n|0.1|55.7|48.9|0.2|\n|0|55.5|40.7|1.8|\n\n**Effect of $\\beta_{forget}$ (default: $\\beta_{forget}=0.2$)**\n|$\\beta_{forget}$|CUB mAP$_r$↑|CUB mAP$_l$↑|CUB mAP$_f$↓|\n|-|-|-|-|\n|1|55.4|57.7|0.2|\n|0.5|55.4|60.2|0.6|\n|0.2|55.5|62.2|0.5|\n|0.1|55.7|63.8|0.5|\n|0|55.6|64|35.7|\n\n**Effect of $\\alpha$ (default: $\\alpha_l = \\alpha_f = 0.01$)**\n|$\\alpha$|CUB mAP$_r$↑|CUB mAP$_l$↑|CUB mAP$_f$↓|\n|-|-|-|-|\n|0.001|55.4|61.7|0.4|\n|0.01|55.5|62.2|0.5|\n|0.1|55.4|49.4|0.4|\n|1|55.2|46.1|0.2|\n\n>**Computational efficiency discussion.**\n\nThank you for highlighting this aspect. The following table provides a comparative analysis of training time, inference speed per image, and the number of trainable parameters for various model architectures. It demonstrates the trade-offs among training duration, inference efficiency, and parameter efficiency:\n|Model|Training Time|Inference Time (per image)|Trainable Parameters|\n|-----|-------------|--------------------------|--------------------|\n|ResNet-18 (all)|0.3 h|0.0007 s|11.2 M|\n|Vit16_B (LoRA)|0.5 h|0.0035 s|0.74 M|\n|Dino (LoRA)|4 h|0.084 s|1.8 M|\n|Mask2former (LoRA)|4 h|0.0037 s|1.4 M|\n\n**Should further clarification or additional details be necessary, we welcome further discussion during the rebuttal period.**", "claims_and_evidence": "1. Introduction of Knowledge Swapping as a novel task: This claim is well-supported. The authors clearly define the task, distinguish it from related approaches like continual learning and machine unlearning, and provide a mathematical formulation of the objectives. The comparison to existing tasks (Figure 1) further strengthens this claim.\n\n2. Discovery of the directional contrast between learning and forgetting: This claim is supported by experimental evidence. The authors conduct experiments analyzing parameter changes during learning and forgetting phases across different layers of neural networks. Figures 2 and 4 show that learning affects later layers (high-level features) while forgetting affects earlier layers (low-level features).\n\n3. Effectiveness of the \"Learning Before Forgetting\" strategy: This claim is well-supported. The authors present experimental results across multiple tasks (image classification, object detection, semantic segmentation) showing that the Learning Before Forgetting approach consistently achieves better performance in terms of retention, forgetting, and learning objectives. Tables 1-3 demonstrate superior results for their proposed method compared to the reverse approach.\n\n4. Benchmark framework using LoRA with group sparse regularization: This claim is supported by technical details and experimental results. The framework is shown to work as intended, enabling efficient and effective knowledge regulation while maintaining parameter efficiency.\n\n5. Variation in difficulty of learning and forgetting across categories: This claim is somewhat speculative. While it may be a reasonable hypothesis based on their work, the authors do not provide specific quantitative analysis or dedicated experiments to support this claim. It is mentioned more as a future research direction rather than a firmly established finding.", "methods_and_evaluation_criteria": "1. Learning Before Forgetting Strategy:\n1.1 This two-stage approach is well-motivated by the authors' analysis of how learning and forgetting affect different layers of neural networks. Their experiments showing that learning affects higher-level semantic features while forgetting impacts lower-level features provide a logical basis for sequencing these processes.\n1.2 The strategy effectively decouples the learning and forgetting processes, which helps mitigate catastrophic forgetting and allows for more controlled knowledge regulation.\n\n2. LoRA with Group Sparse Regularization:\n2.1 Using Low-Rank Adaptation (LoRA) for fine-tuning is appropriate as it allows efficient parameter updates while preserving pretrained knowledge. This choice makes sense for vision tasks where Transformers have become standard architectures.\n2.2 The group sparse regularization approach is suitable for selectively retaining and forgetting knowledge at the module level within the Feed-Forward Network (FFN) modules. This method enables targeted parameter control without excessive computational overhead.\n\n3. Boundary Constraint for Forgetting:\n3.1 The introduction of a boundary constraint (BND) in the forgetting phase addresses potential optimization instability issues that could arise from directly maximizing the negative loss. This technical refinement demonstrates thoughtful consideration of implementation details.", "theoretical_claims": "In this paper, the authors don't present formal mathematical proofs for their claims. Instead, they rely on empirical evidence from experiments to support their theoretical insights.", "experimental_designs_or_analyses": "1. The authors evaluate their method across three different computer vision tasks: image classification, object detection, and semantic segmentation. This demonstrates the generalizability of their approach across different types of vision problems.\n\n2. The authors specifically compare their proposed \"Learning Before Forgetting\" strategy against the reverse approach (\"Forgetting Before Learning\") across all tasks. This direct comparison effectively demonstrates the superiority of their proposed method.\n\n3. They provide both quantitative results (tables) and qualitative results (figures) to comprehensively evaluate their method's effectiveness.\nThe qualitative results help visualize the practical implications of their findings.", "relation_to_broader_scientific_literature": "1. Curriculum Learning Parallels: The proposed strategy shares conceptual similarities with curriculum learning (Bengio et al., 2009), where the order of learning tasks can significantly impact model performance. Just as curriculum learning orders tasks from simple to complex, the \"Learning Before Forgetting\" approach sequences knowledge regulation in a way that leverages the natural progression of feature learning.\n\n2. Mitigating Catastrophic Forgetting: This approach addresses catastrophic forgetting more effectively than traditional methods by decoupling learning and forgetting. Unlike regularization-based methods that attempt to balance retention and new learning simultaneously (Li & Hoiem, 2017), the sequential approach allows for more controlled knowledge regulation.", "essential_references_not_discussed": "NO", "other_strengths_and_weaknesses": "1. While the paper demonstrates the effectiveness of their overall approach, there could be more extensive ablation studies to understand the contribution of individual components (e.g., the impact of different regularization strengths, the importance of sparse constraints).\n\n2. The hyperparameters (α, β, BND) are set based on what worked well in their experiments, but there's limited analysis of how sensitive the method is to these choices. A more thorough exploration of the hyperparameter space could strengthen the robustness of their conclusions.\n\n3. The experiments primarily focus on Transformer-based models (VIT-B16, Mask2Former). While this is appropriate given the current trends in vision research, it would be valuable to see how the method performs on other architectures like CNNs.\n\n4. While the method is shown to be effective, there's limited discussion of computational efficiency compared to alternative approaches.\nInformation about training time, memory usage, or parameter efficiency could provide additional insights into the practicality of their method.", "other_comments_or_suggestions": "No", "questions_for_authors": "1. While the paper demonstrates the effectiveness of their overall approach, there could be more extensive ablation studies to understand the contribution of individual components (e.g., the impact of different regularization strengths, the importance of sparse constraints).\n\n2. The hyperparameters (α, β, BND) are set based on what worked well in their experiments, but there's limited analysis of how sensitive the method is to these choices. A more thorough exploration of the hyperparameter space could strengthen the robustness of their conclusions.\n\n3. The experiments primarily focus on Transformer-based models (VIT-B16, Mask2Former). While this is appropriate given the current trends in vision research, it would be valuable to see how the method performs on other architectures like CNNs.\n\n4. While the method is shown to be effective, there's limited discussion of computational efficiency compared to alternative approaches.\nInformation about training time, memory usage, or parameter efficiency could provide additional insights into the practicality of their method.", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "extra_scores": {}}]

Author rebuttal:

Meta-review: This paper introduces Knowledge Swapping as a task, motivates learning then forgetting through looking at high and low-level features and how they change, and provides experiments across a variety of tasks. 

Reviewers mostly agree that this is a good paper: the task of Knowledge Swapping is interesting, novel and well-motivated; learning then forgetting is well-motivated; experiments are performed across many different tasks and sufficiently. 

The authors added experiments in the rebuttal about increased number of tasks (like in a continual learning setting), ablations on hyperparameters, and more. I encourage the authors to add these to the main paper (or appendices), including the ablation results.
Decision: Accept (poster)