                 Invariance Makes LLM Unlearning Resilient Even to Unanticipated Downstream Fine-Tuning



the WMDP dataset (Li et al., 2024) for harmful content                  empirical training objective for the representation model ϕ

degeneration and evaluated using 1 minus accuracy on the                but also ensures optimal fine-tuning performance on each

WMDP-Bio evaluation set, termed as ‘forget quality’, where              dataset Di . Formally, the IRM problem is formulated as

a higher value indicates better unlearning performance. For

                                                                         minimize     ℓERM (w∗ (ϕ) ◦ ϕ; ∪i Di )

comparison, we also include the performance of a model                       ϕ                                                           (2)

fine-tuned from the original pre-trained state (i.e., ‘Origi-            subject to   w∗ (ϕ) ∈ arg minw ℓi (w ◦ ϕ; Di ), ∀i ∈ [N ],

nal’). As we can see, both NPO and RMU lose their unlearn-

                                                                        where the upper-level objective ℓERM (·; ∪i Di ) represents

ing effectiveness during the fine-tuning process, despite (1)

                                                                        empirical risk minimization P  (ERM) across all data to op-

having high forget quality prior to fine-tuning (i.e., at 0 fine-

tuning epochs) and (2) the downstream tasks (GSM8K or

                                                                        timize ϕ (e.g., ℓERM (·) =       i ℓi (·; Di )), ℓi denotes the

                                                                        individual training loss over Di , and w∗ (ϕ) denotes an

AGNews) being unrelated to the unlearning task (WMDP).

                                                                        invariant predictor (built upon ϕ) that is optimal to any spe-

In addition, as the number of fine-tuning epochs increases,

                                                                        cific training environment. Here we explicitly express the

the fine-tuned models (even when starting from different

                                                                        solution w∗ (ϕ) as a function of ϕ.

initial unlearned models) exhibit improved fine-tuning ac-

curacy, converging to the performance of fine-tuning the                However, solving the original IRM problem (2) poses sig-

‘Original’ model. Furthermore, while RMU yields a higher                nificant challenges due to the need to compute the gradient

forget quality prior to fine-tuning, it demonstrates weaker             dw∗ (ϕ)

                                                                           dϕ . To circumvent that, problem (2) is typically relaxed

robustness to downstream fine-tuning, as evidenced by the               to a single-level, regularized problem, referred to as IRMv1:

faster ununlearning rate with increasing fine-tuning epochs.

                                                                                                  XN

                                                                            minimize ℓERM (θ) + λ     ∥∇w ℓi (w ◦ θ; Di ) | w=1 ∥22

Problem statement. As motivated by Fig. 1, fine-tuning                         θ     | {z }       i=1

                                                                                                                                    (3)

                                                                                       ERM

on unrelated information that reverses unlearning has

                                                                                                |              {z                 }

                                                                                                             Invariance regularization

emerged as a significant concern and a major limitation

of current LLM unlearning methods. Thus, the central prob-              where the original predictor’s parameters w are absorbed

lem addressed in this paper is: How can we enhance the                  into the full model parameters θ, λ > 0 serves as a regular-

current LLM unlearning approach (1) to achieve greater                  ization parameter, ∥ · ∥2 is the ℓ2 norm, and ∇w ℓi represents

resilience against downstream fine-tuning?                              the gradient of ℓi with respect to the (virtual) scalar predic-

                                                                        tor w, evaluated at w = 1. The invariance regularization

We will approach the above problem through the lens of                  in (3) enforces the necessary optimality condition for each

IRM (invariant risk minimization). By leveraging IRM, we                lower-level problem in (2) by penalizing non-stationarity.

can integrate and promote invariance in LLM unlearning.

                                                                        The IRMv1 approach (3), while a relaxation of (2), facil-

                                                                        itates the application of invariance regularization to LLM

4. Promoting Invariance in LLM Unlearning                               unlearning. First, composing θ with a constant scalar predic-

Invariance in LLM unlearning: From IRM to ILU.                          tor w = 1 ensures adaptability to a wide range of machine

IRM is designed to seek an “invariant” (i.e., training                  learning models, including LLMs. Second, if θ represents

environment-agnostic) model, aiming for universal repre-                the unlearned model obtained by replacing ERM with the

sentation learning to achieve optimal predictions across                unlearning objective ℓu in (1) and Di is a fine-tuning dataset,

diverse training environments (Arjovsky et al., 2019; Ahuja             the invariance regularization in (3) enforces robustness of θ

et al., 2020; Zhang et al., 2023). By treating a fine-tuning            against fine-tuning. Therefore, we propose ILU (invariant

task as an unlearning training environment, integrating IRM             LLM unlearning), extended from IRMv1 (3), as below:

with (1) is then expected to enhance the invariance of the                                          N

                                                                                                    X

unlearned model, i.e., improve its robustness against fine-                   minimize ℓu (θ) + λ         ∥∇w|w=1 ℓi (w ◦ θ; Di )∥22 ,   (4)

                                                                                  θ

tuning. Therefore, we propose framing the LLM unlearning                                            i=1



problem within the IRM framework.

                                                                        where ℓu is the unlearning objective, and Di is a fine-tuning

Following the IRM setup in (Arjovsky et al., 2019), let Di              dataset that can be unrelated to the unlearning task, e.g.,

denote the dataset associated with the training environment             GSM8K or AGNews in Fig. 1.

i ∈ [N ], where [N ] := {1, 2, . . . , N }, and N represents the

number of training environments. IRM learns a universal                 A single (unrelated) fine-tuning dataset may suffice to

representation model ϕ, which enables the existence of an               promote unlearning invariance. A key question in (4) is

invariant predictor w that remains simultaneously optimal               whether the introduction of multiple fine-tuning sets {Di }

across all environments. This results in the invariant (train-          (i.e., N > 1) is necessary, as it assumes greater access

ing environment-agnostic) model θ := w ◦ ϕ (where ◦                     to additional data and knowledge of potential fine-tuning

denotes model composition), which not only optimizes the                tasks. An ideal ILU framework should minimize reliance



                                                                    4

