Manuscript Offprint
arXiv:2610.38001Preserving Safety During Sequential Fine-Tuning: A Factorial and Geometric Analysis of Replay
George Ruellan
School of Electronic Engineering and Computer Science
Queen Mary University of London
London, United Kingdom
Diana Benavides-Prado
School of Electronic Engineering and Computer Science
Queen Mary University of London
London, United Kingdom
Abstract—Benign fine-tuning can erode safety alignment in large language models, and sequential adaptation substantially compounds this risk. Prior work mitigates this erosion by replaying harmful-prompt refusals and benign-compliance examples, while other work instead matches base-model logits via distillation. However, the individual contributions of supervised exposure and distillation to safety behavior and refusal geometry during sequential adaptation remain unclear. We factor these two strategies apart and study their behavioral and geometric effects during sequential LoRA fine-tuning of Mistral-7B and Llama-3-8B across diverse task sequences (code generation, German-language summarization, and science question-answering). Behaviorally, supervised replay exposure yields the largest reduction in HarmBench attack success rate (ASR) on Mistral, averaging 51.1 points below base, but at a substantial over-refusal cost, averaging 53.4 points above base on OR-Bench-hard. Logit distillation, without any supervised replay loss, largely prevents safety erosion at a fraction of this cost: an average 5.4-point ASR reduction against only a 5.1-point rise in over-refusal. Llama shows the same asymmetry between the two strategies. Combining exposure and distillation moderates exposure's over-refusal while leaving downstream task scores largely unaffected. Geometrically, the two models diverge: on Mistral, distillation preserves the base refusal direction more closely than exposure does, whereas on Llama, refusal behavior after exposure largely survives ablation of the extracted refusal direction. This dissociation between models indicates that preserving the base refusal direction is not a reliable proxy for behavioral safety.
I. INTRODUCTION
Fine-tuning can compromise safety alignment even when the downstream data are benign [1, 2]. Repeated adaptation makes this a continual learning problem: a model must acquire new task behavior while retaining earlier capabilities and safety constraints [3, 4]. LoRA is a fine-tuning technique that learns low-rank weight updates efficiently [5]. However, it does not guarantee retention of safety [6]. A mitigation must therefore limit harmful compliance across successive tasks while preserving the model's ability to answer benign requests.
Replay revisits a subset of past data during adaptation to limit catastrophic forgetting [7]. It has been successfully applied to continual fine-tuning of language models, helping to retain earlier task performance while learning new tasks [8]. In safety alignment, mixing supervised safety examples into fine-tuning data can reduce harmful responses [1] but excessive safety replay can also increase refusal of benign requests [9]. Unforgotten Safety [10] shows that Dark Experience Replay (DER) [7] reduces harmful compliance after one downstream task while retaining task utility, although over-refusal increases relative to standard fine-tuning. SafeAnchor [11] studies sequential domain adaptation across six domain orderings, combining replay with projection and distribution anchoring.
Nevertheless, replay can help achieve safety preservation via two very distinct training signals. Supervised exposure teaches supplied refusal and benign-compliance responses; logit distillation encourages retention of the base model's output distribution. This distinction matters because the base model may already comply with harmful requests or refuse benign ones. Consequently, matching the base model's logits and training on supplied safe responses may produce different safety outcomes from the same replay samples. Furthermore, supervised replay exposure and base-model logit distillation may differ in their behavioral and geometric effects across tasks that vary in format, domain and language, an aspect that has been overlooked in previous studies. Prior work links refusal to early output tokens [12] and low-dimensional activation and weight representations [13, 14]. Yet, it remains unclear whether preserving the base model's refusal representation corresponds to safer behavior after fine-tuning.
We decouple supervised replay exposure and logit distillation during sequential fine-tuning on code generation, German-language summarization and science question-answering. We evaluate the effects of having these two signals, having each of these separately and having neither (i.e. standard fine-tuning). Joint measurement of harmful compliance, benign refusal and task performance establishes what each training objective preserves and at what cost. We then track refusal-related activations and use directional ablation to test whether the extracted representation continues to mediate refusal. Our main contributions and findings are:
- Safety degradation depends on task order. Across six task orderings, task-only fine-tuning ends with higher attack success rate (ASR) compared to the base model on both Mistral and Llama models, with much of the variation following the final task. This motivates evalu-
Code and results can be found at: https://github.com/gruellan/preserving_safety_sequential_finetuning ation across whole diverse sequences rather than single tasks.
-
Exposure reduces harmful compliance, while distillation retains base behavior. Our factorial comparison shows that supervised exposure produces the largest ASR reductions below base and the greatest over-refusal, while distillation changes behavior the least. Combining the signals reduces exposure's over-refusal, but also gives up some of its ASR reduction on a Mistral model. The objectives therefore make distinct, non-additive contributions.
-
Task scores stay similar despite increased over-refusal. Combined replay lowers ASR below base across six task orderings while retaining similar task scores, yet its benign-refusal cost depends on the model and benchmark. This is a direct observation from joint evaluation that task performance alone cannot capture.
-
Lower ASR does not require preserving the base refusal direction. By relating geometric trajectories to behavioral outcomes, we show that exposure achieves lower ASR than distillation despite greater rotation of the refusal direction. On Llama, refusal also persists after ablation of the checkpoint's own extracted direction, limiting what a single direction at a fixed layer explains about refusal after replay.
The paper is organized as follows. Section II reviews related work. Section III defines training, evaluation and geometric analysis protocols. Section IV presents the sequential erosion problem, separates the behavioral effects of replay objectives and tests what task performance and refusal geometry reveal about those effects, including seed and Gemma replications, and a recent projection method. Sections V–VII discuss the implications, limitations and conclusions of this work.
A. Continual Learning and Catastrophic Forgetting
Following pre-training and alignment, LLMs are often adapted sequentially across domains or tasks, a process called continual learning (CL). Shi et al. [4] distinguish vertical CL, which repeatedly adapts a general model to one task or domain, from horizontal CL, which adapts it across a sequence of tasks or time periods. We study the latter, also known as sequential fine-tuning, where catastrophic forgetting is a particular risk [15]. Classical mitigations include regularization-based, replay-based and model-based methods [16]. Their ability to preserve safety alignment has received less attention than their effect on task retention.
B. The Fragility of Safety Alignment
Qi et al. [1] show that benign fine-tuning can compromise aligned instruction-tuned models, a finding replicated by Fraser et al. [17] for the Mistral-7B family used here. Qi et al. [12] attribute this fragility to alignment being concentrated in the first few output tokens, where subsequent fine-tuning can readily alter the model's distribution. In a two-task sequence, Ung et al. [18] find greater safety degradation when task fine-tuning follows safety fine-tuning than under the reverse
order. We extend this setting to all six permutations of three heterogeneous downstream tasks.
C. Safety Degradation Mitigation
Relevant mitigations include projection-based, constraint-based and replay-based methods. SafeLoRA [19] projects LoRA updates onto a safety-aligned subspace, SaLoRA [20] freezes a safety module during fine-tuning and ProCon [21] penalizes hidden-state drift along the refusal direction. Replay supplements task data with examples of safe behavior during fine-tuning. These approaches target different parts of adaptation: weight updates, hidden representations or model responses.
Existing studies examine both their behavioral outcomes and internal effects. Unforgotten Safety measures over-refusal using XSTest, OR-Bench-80K and OR-Bench-Hard alongside ASR and task utility [10]. SafeAnchor combines projection, distribution anchoring and triggered replay and also studies weight-space subspace drift [11]. We focus on the separate effects of supervised exposure and logit distillation on behavior and refusal geometry during heterogeneous sequential adaptation, with a SafeLoRA comparison of safety and over-refusal under weight-space projection.
D. Refusal Geometry and Causal Interventions
Research on model internals has linked refusal to activation-space representations. Arditi et al. [13] found that a single vector mediates refusal across 13 open-source models ranging from 1.8B to 72B parameters. Ablating this direction nearly eliminates refusal of harmful prompts, while adding it induces refusal. Other work locates safety in a small band of middle layers [22] or roughly 5% of neurons [23]. The single-direction account remains contested: Wollschläger et al. [24] describe a multidimensional concept cone, Pan et al. [25] identify multiple orthogonal safety directions and Joad et al. [26] find a representation more distributed than any single vector. ProCon [21] analyzes refusal-direction drift during fine-tuning, while Lan et al. [27] tracks behavioral and geometric changes under dynamic adversarial fine-tuning. These findings motivate two separate tests after replay: whether similarity to the base direction tracks harmful compliance, and whether the checkpoint's extracted direction still mediates refusal after adaptation.
III. METHODOLOGY
Our study analyses the effect of the replay objective and the effect of encountering replay examples. We hold the buffer fixed while enabling supervised exposure, logit distillation, both or neither. Behavioral evaluation measures harmful compliance, benign refusal and task learning. We also track each model's refusal direction relative to the base model and ablate the extracted direction to test its role in refusal after adaptation.
A. Training
We compare task-only fine-tuning (Plain), Experience Replay (ER; supervised replay exposure only), Dark Experience Replay (DER; base-model logit distillation only) and DER++
(both replay signals). A fifth condition, Matched Plain, applies task loss alone using the replay trainer. All these alternatives share adapter and optimizer hyperparameters. Matched Plain, ER, DER and DER++ also share the replay data path, batching and update budget; original Plain uses length grouping and fewer updates. Matched Plain measures the size of this procedural difference (see Appendix VIII-B).
The main experiments fine-tune LoRA adapters sequentially on three TRACE tasks [28]: Py150 (code generation), 20Minuten (German-language summarization) and ScienceQA (scientific question-answering). Adapters use rank 16 on the q/k/v/o attention projections, with scaling 32 and dropout 0.05. Rank 16 is used in prior LoRA safety fine-tuning of Mistral-7B-Instruct and Llama-3-8B-Instruct [29] and in sequential safety preservation [11] (see Appendix VIII-A for other training settings).
The core comparison covers task orderings O1–O3 on Mistral and Llama, while Plain and DER++ cover all six task orderings, as shown in Table I. Supplementary analyses examine a homogeneous task sequence, SafeLoRA projection and Gemma (see Appendix VIII-C for evaluation coverage).
LoRA adapters are merged cumulatively. After task , consists of the base weights plus adapters , each trained as a delta from the preceding cumulative model. To assess seed sensitivity, we replicate the four core conditions (Section III-B) at O1 with seeds 42, 43 and 44 on both models. We also train each model on a homogeneous sequence of three Py150 shards (1667/1667/1666 samples) using the same optimizer and adapter settings. The smaller data volume prevents a controlled comparison of homogeneous and heterogeneous task sequences.
TABLE I
TASK SEQUENCES FOR ORDERING LABELS O1–O6. CODE DENOTES PY150, SUM DENOTES 20MINUTEN AND QA DENOTES SCIENCEQA.
| Ordering | Task 1 | Task 2 | Task 3 |
|---|---|---|---|
| O1 | code | sum | qa |
| O2 | qa | sum | code |
| O3 | sum | code | qa |
| O4 | code | qa | sum |
| O5 | sum | qa | code |
| O6 | qa | code | sum |
B. Factorial decomposition of replay
We independently enable supervised replay exposure and base-model logit distillation to distinguish their individual and combined effects. During each task, the full fixed buffer of 500 examples is concatenated with the 5000 task examples and shuffled. Replay therefore accounts for 500/5500 examples per epoch; the number of replay examples in a minibatch varies. We hold buffer size fixed and do not evaluate alternative sizes. The buffer is constructed from WildJailbreak [30]: harmful samples pair a vanilla_harmful prompt with a safe refusal completion and over-refusal samples pair an adversarial_benign prompt with a compliant completion.
The main buffer contains 350 harmful and 150 benign prompts (70:30). Its builder filters candidates using behavior: harmful prompts must elicit a refusal without harmful content and benign prompts a compliant response. The supervised target remains the WildJailbreak completion field; the separately stored m0_response records filtering provenance and is not the replay CE target. Teacher logits are computed under the stored completion. The released builder and fixed seed make the buffer composition and any overlap with evaluation sets auditable. Exact regeneration is limited by the unpinned base-model revision used for behavior filtering.
The loss configurations use task examples X and replay examples with the following terms:
where task and replay cross-entropy are separately averaged over their respective unmasked next-response-token targets within each minibatch. The distillation term first averages mean squared error over response positions and vocabulary entries for each replay example, then averages over replay examples present. It compares the logits of the model being trained (the student) against the pre-computed logits of the frozen base model (the teacher). Canonical DER stores the model's logits when each sample enters the replay buffer [7]. Because our buffer is constructed before fine-tuning, these logits are generated by the base model, making the teacher.
We index the replay loss settings by these coefficients: ; cross-entropy replay only), ; logit distillation only) and ( ; both). Plain uses task cross-entropy only with length-grouped task batches, giving 936 scheduled updates per stage. Matched Plain also has but runs through the replay trainer: buffer rows are masked from task CE and both replay losses are zero, while those rows still occupy the mixed batches. Length grouping is therefore disabled and the 1032-update budget matches ER, DER and DER++. Matched Plain differs from the replay methods only in their loss terms and from original Plain only in batching and update budget. We evaluate it on both primary models, O1–O3 and seed 42.
To measure whether exposure and distillation have additive effects, we calculate their interaction separately on the ASR and ORR percentage-point scales. For each outcome, we calculate the interaction as in percentage points. We also substitute Matched Plain for Plain to assess sensitivity to the task-only control.
C. Evaluation Approach
Each behavioral measure addresses a different failure mode. ASR measures harmful compliance, over-refusal rate (ORR) measures refusal of benign requests and task performance scores assess learning and retention of the downstream tasks.
HarmBench ASR is recorded across for the reported sequential safety trajectories; downstream task scores are also recorded across , as forgetting calculations require complete chains for the relevant task. Held-out ASR and over-refusal are evaluated at , with separate baselines, so the safety-over-refusal comparison is an endpoint analysis only. See Appendix VIII-C for a summary of the reported coverage.
-
Task Performance: Following TRACE [28], we measure Py150 with edit similarity, ScienceQA with answer accuracy and 20Minuten with ROUGE-L.
-
Attack Success Rate: Attack Success Rate (ASR) is measured on the test split of the HarmBench DirectRequest dataset [31]. It contains 320 harmful prompts across categories such as copyright infringement, cybercrime, harassment/bullying and chemical/biological weaponry. Copyright infringement samples were discarded, mirroring Arditi et al. [13], so the reported metric covers the remaining categories (n = 240).
The judge model, cais/HarmBench-Llama-2-13b-cls , provides a binary harmful/safe label for each generated output and is fine-tuned specifically to classify responses to the HarmBench dataset. ASR is the fraction of harmful prompts whose completion the judge labels harmful:
To measure whether safety generalizes beyond HarmBench-style prompts, the final model is evaluated on three additional English-language jailbreak datasets (AdvBench [32], JailbreakBench [33] and the toxic split of OR-Bench [34]), scored using the HarmBench judge model and ASR calculation above.
- Over-Refusal Rate: Over-refusal is measured on benign prompts that resemble unsafe requests, commonly called hard negatives. WildGuard [35] labels each prompt-completion pair as refusal or compliance. The over-refusal rate:
is the fraction of hard-negative completions labeled as refusals; lower ORR means fewer benign requests are refused.
We evaluate on 500 randomly drawn samples from OR-Bench's or-bench-hard-1k subset of hard negative prompt completion pairs [34], labeled ORB-Hard in Section IV and the 250 hard negative samples in XSTest [36].
D. Analysis of Refusal Direction
We use difference-in-means (DIM) extraction and directional ablation [13] at each cumulative checkpoint to distinguish refusal geometry preservation from behavioral safety. DIM-vector magnitude measures the activation contrast between extraction classes, and cosine similarity measures angular drift from the base direction. Ablation then tests how much refusal depends on the checkpoint's own extracted direction. None of these measurements substitutes for the behavioral evaluations above.
The refusal analyses cover the factorial from Section III-B: Plain, ER, DER and DER++ with the 70:30 harmful-to-benign replay buffer. For each method, we analyze geometry from the base model through the final model , merging the LoRA adapters cumulatively.
- Extracting the refusal direction: Following Arditi et al. [13], we calculate the DIM vector from contrasting harmful and harmless prompts. contains OR-Bench-toxic samples and contains benign XSTest prompts; both sets are truncated to n = 112.
For each checkpoint and layer , we measure the residual-stream activation at a fixed offset in the chat-formatted input: -1 for Mistral and -5 for Llama. The offsets are held fixed across checkpoints within each model. The refusal direction is the DIM vector between the two extraction classes (Equation 4).
The magnitude measures the extraction-set activation contrast at layer . Its unit vector is used for both cosine similarity to the base direction and the ablation in Section III-D2. We use layer 12 for Llama, following Arditi et al. [13], and middle layer 16 for Mistral. The extraction layers remain fixed across checkpoints and have a measurable ablation effect at . We assess class separation at and using in-sample AUROC: the same prompts are used to extract each direction and evaluate its projections, with AUROC averaged over O1–O3.
- Causal concentration via directional ablation: Magnitude and cosine describe a single direction but do not establish its causal role in refusal. Thus, we remove the refusal unit vector from every residual stream activation (Equation 5) to prevent the model from representing this direction in the residual stream [13].
For each checkpoint we generate unablated and ablated completions for 60 harmful OR-Bench-toxic prompts held out from the extraction set of Section III-D1; the ablated direction is never evaluated on prompts it was fit on. WildGuard [35] judges each completion as refusal or compliance. Following Arditi et al. [13], denotes the refusal score of on harmful prompts and the post-ablation score. Equation 6 gives the relative drop in refusal rate.
Magnitude and rotation [21] describe how the direction changes during fine-tuning. A high Refusal indicates that refusal is strongly mediated by the ablated direction.
https://huggingface.co/cais/HarmBench-Llama-2-13b-cls

Fig. 1. HarmBench DirectRequest ASR trajectories under Plain () for Mistral (left) and Llama (right), with orderings colored by first task and dashed baselines.
E. SafeLoRA comparison
SafeLoRA [19] projects weight updates using aligned and unaligned model weights. We apply it post-hoc: the Plain training runs are completed first and projection is then applied after each cumulative merge of their saved adapters for O1–O3 at seed 42. No additional training is performed after projection. Consequently, each later adapter was learned from an unprojected predecessor, even though it is subsequently evaluated as part of a projected sequence. We use projection threshold on both primary models and examine threshold sensitivity on Mistral O1 by raising from 0.5 to 1.0; this paired rerun is reported separately from the O1–O3 averages and not pooled with them (see Table XIII). Thresholds are not tuned per model and downstream task performance is not evaluated, so this is a sensitivity study rather than a tuned comparison with replay.
SafeLoRA [19] pairs each instruction-tuned model with its unaligned (base, pre-instruction-tuning) weights: mistral-community/Mistral-7B-v0.2 for Mistral and meta-llama/Meta-Llama-3-8B for Llama. For each of 128 matrices, define and . These projection matrices remain fixed across tasks.
Saved Plain adapters are merged in task order. An update is replaced by when their flattened cosine is at most ; otherwise it is retained. Adapters are not retrained after projection. The main comparison uses O1–O3, seed 42 and .
IV. RESULTS
Whether retaining a base model's behavior is desirable depends on a base model's safety operating point. Mistral-7B-Instruct-v0.2 has a HarmBench ASR of 52.1%, while Meta-Llama-3-8B-Instruct starts at 5.8% ASR but refuses 72.4%
of benign OR-Bench-hard prompts. Staying close to base can therefore retain harmful compliance on Mistral or over-refusal on Llama. We assess both outcomes alongside task performance and refusal geometry.
Unless stated otherwise, factorial comparisons use final checkpoints averaged over the same three orderings, O1–O3, at seed 42. The wider Plain/DER++ comparison covers all six orderings, O1–O6.
A. Task-only adaptation erodes safety in every ordering
Every evaluated Plain sequence ends with higher Harm-Bench ASR than its base model, extending single-task evidence that benign fine-tuning can compromise safety [1, 2, 6]. Averaged across all six orderings, ASR rises from 52.1% to 68.7% on Mistral and from 5.8% to 33.5% on Llama, as shown in Table II. Llama's mean increase is larger (27.7 versus 16.6 percentage points). Safety erosion therefore affects both a model with substantial base harmful compliance and one with low initial ASR — the catastrophic forgetting problem against which we evaluate replay.
Task order determines the extent of that problem. Final ASR ranges from 57.9–76.2% on Mistral and 19.6–52.1% on Llama, with QA-last orderings ending highest. On Llama, QA raises ASR to only 10.4% when trained first, compared with a mean of 47.7% when trained last. Its effect therefore depends on the preceding adaptation. Erosion is not always monotonic: Mistral O2 ASR, for example, falls from 72.9% at to 57.9% at ; but no ordering restores the base level. Figure 1 shows the trajectories.
Seed replications repeat the erosion pattern (see Section IV-F), and homogeneous code-only chains erode safety as well, so task heterogeneity is not required for it, as shown in Table III. Here, is in percentage points. These chains use 5000 examples versus 15,000 for heterogeneous
TABLE II
HARMBENCH ASR (%) UNDER PLAIN ACROSS SIX TASK ORDERINGS AND CHECKPOINTS ; .
| Model | Ordering | |||||
|---|---|---|---|---|---|---|
| Mistral-7B | O1 | 52.1 | 59.2 | 72.5 | 76.2 | +24.2 |
| O2 | 52.1 | 65.4 | 72.9 | 57.9 | +5.8 | |
| O3 | 52.1 | 68.3 | 66.2 | 74.6 | +22.5 | |
| O4 | 52.1 | 59.2 | 75.0 | 73.8 | +21.7 | |
| O5 | 52.1 | 68.3 | 75.8 | 67.1 | +15.0 | |
| O6 | 52.1 | 65.4 | 62.5 | 62.5 | +10.4 | |
| Llama-3-8B | O1 | 5.8 | 30.4 | 30.4 | 43.3 | +37.5 |
| O2 | 5.8 | 10.4 | 22.1 | 19.6 | +13.8 | |
| O3 | 5.8 | 28.7 | 30.4 | 52.1 | +46.2 | |
| O4 | 5.8 | 30.4 | 34.6 | 33.8 | +27.9 | |
| O5 | 5.8 | 28.7 | 38.8 | 24.6 | +18.8 | |
| O6 | 5.8 | 10.4 | 22.1 | 27.9 | +22.1 |
chains, with fewer updates (see Appendix VIII-B); final code edit similarity is approximately 53 points.
TABLE III
HARMBENCH ASR (%, n=240) OVER THREE PY150 SHARDS AT SEED 42.
| Model | |||||
|---|---|---|---|---|---|
| Mistral-7B | 52.1 | 72.1 | 72.1 | 69.6 | +17.5 |
| Llama-3-8B | 5.8 | 34.2 | 37.9 | 28.7 | +22.9 |
B. Exposure lowers ASR at an over-refusal cost; distillation stays near base
The factorial decomposition identifies two different responses to erosion. Supervised exposure (ER) drives harmful compliance well below base, while logit distillation (DER) largely retains base behavior. On Mistral, ER reduces mean HarmBench ASR to 1.0%, compared with 46.7% for DER and 52.1% at base, as shown in Table IV. DER therefore prevents much of the deterioration under Plain but leaves most of the base model's harmful compliance intact. Llama shows the same ordering, with less room to improve on its already low base ASR. The contrast also appears on the other harmful-request datasets (as shown later in Table VII).
Exposure's significant ASR reduction comes at the cost of a larger increase in benign refusal. On Mistral, OR-Bench-hard ORR rises from 13.0% at base to 66.4% under ER, compared with 18.1% under DER. The same distinction appears on Llama, but its high base OR-Bench-hard ORR leaves less room for an increase. XSTest makes the cost clearer: ER raises Llama ORR from 4.8% to 24.9%, while DER remains near base at 4.5%. Exposure's low ASR must therefore be interpreted alongside its greater tendency to refuse benign requests (Figure 2).
Combining the replay components changes this trade-off. On Mistral, DER++ reduces ER's OR-Bench-hard ORR from 66.4% to 60.5%, while ASR rises from 1.0% to 7.1%. On Llama, DER++ also reduces ER's over-refusal on both benign benchmarks while retaining similarly low ASR. These effects are non-additive: the ASR reduction from adding exposure
TABLE IV
FINAL- ASR AND ORR (%), MEAN SAMPLE S.D. OVER O1–O3 AT SEED 42.
| Model | Method | HarmBench | XSTest | ORB-hard |
|---|---|---|---|---|
| ASR | ORR | ORR | ||
| Mistral-7B | 52.1 | 4.8 | 13.0 | |
| Plain | 69.6 10.1 | 2.8 0.7 | 3.9 1.8 | |
| Matched Plain | 71.2 10.5 | 2.5 1.2 | 4.9 1.9 | |
| ER | 1.0 0.9 | 28.0 2.8 | 66.4 2.8 | |
| DER | 46.7 3.8 | 7.9 0.8 | 18.1 2.3 | |
| DER++ | 7.1 1.1 | 17.3 0.5 | 60.5 3.5 | |
| Llama-3-8B | 5.8 | 4.8 | 72.4 | |
| Plain | 38.3 16.8 | 3.5 2.0 | 11.1 1.8 | |
| Matched Plain | 41.7 10.8 | 3.5 2.7 | 8.3 1.4 | |
| ER | 1.2 0.4 | 24.9 2.7 | 77.2 1.4 | |
| DER | 4.9 1.7 | 4.5 0.6 | 74.9 1.5 | |
| DER++ | 1.4 0.6 | 10.5 1.6 | 72.3 4.0 |
is smaller when distillation is already present, and adding distillation moderates exposure's over-refusal. Section IV-B1 reports the interaction estimates and their sensitivity to the task-only control. No objective is uniformly preferable when considering both ASR and ORR.
Procedural and replication checks support this interpretation. Matching Plain to replay's batching and update budget shifts mean ASR by at most 3.3 percentage points and ORR by at most 2.9 points, well below the principal Plain–ER and Plain–DER++ gaps. Across three O1 seeds, the contrast between ER's low ASR/high over-refusal and DER's smaller deviation from base persists (as shown later in Table X). A single-ordering Gemma-2-9B-IT comparison [37] shows the same contrast, although its low base ASR limits the absolute difference between objectives (see Section IV-G).

Fig. 2. HarmBench ASR versus OR-Bench-hard ORR over O1–O3, seed 42 (lower is better on both axes). Faint points show orderings, bold points their means and stars the base models.
- Matched-control and interaction checks: For the balanced O1–O3 factorial comparison, Matched Plain's mean ASR is 71.2% versus 69.6% for original Plain on Mistral, and


Fig. 3. Final HarmBench ASR under Plain and DER++ across O1–O6 for Mistral (left) and Llama (right) (n=240, excluding copyright behaviors); dashed lines show .
41.7% versus 38.3% on Llama. Calculated before rounding, the largest mean ASR and ORR shifts are 3.3 and 2.9 percentage points. These procedural effects are small relative to the Plain–ER and Plain–DER++ gaps, but do not establish equivalence between the controls.
On the percentage-point scales defined in Section III-B, the exposure–distillation interaction is +29.0 for Mistral Harm-Bench ASR and +33.6 for Llama; on XSTest ORR, it is −15.7 and −15.5. Using Matched Plain gives ASR interactions of +30.6 and +37.0, while XSTest ORR interactions change by at most 0.4 points. These estimates describe non-additivity on the measured outcome scales, not an identified internal mechanism.
C. DER++ retains task scores but still over-refuses
The combined objective's low ASR extends beyond the three-ordering factorial comparison. DER++ finishes below base in every evaluated ordering on both models (Figure 3). Across all six orders, mean ASR is 7.4% on Mistral and 1.1% on Llama, compared with 68.7% and 33.5% under Plain. Task order changes the severity of unmitigated erosion, yet DER++ still reduces direct harmful compliance in every sequence.
The task evaluations show that continued learning of the downstream tasks survives this reduction. As shown in Table V, scores are similar across Plain and the replay objectives; for example, Mistral's mean final code edit similarity spans only 53.2–54.1, and summarization and QA scores remain above base. Task performance and forgetting are averaged over available orderings. Forgetting averages the peak-to-final task score drop on the two tasks not trained last. Replay also shows lower observed mean forgetting on earlier tasks than Plain (Figure 4), at most 1.2 points compared with 2.3 points for Plain.
Those task scores leave the benign-refusal cost largely unmeasured. Across all six orderings, Mistral DER++ refuses 61.5% of OR-Bench-hard prompts, compared with 13.0% at
TABLE V
FINAL-CHECKPOINT TASK PERFORMANCE AND FORGETTING, MEAN S.D. OVER AVAILABLE ORDERINGS WITH COMPLETE EVALUATION CHAINS. LOWEST MEAN FORGETTING PER MODEL IN BOLD.
| Model | Method | sum (ROUGE-L) | code (edit sim.) | qa Forgetting (acc) | |
|---|---|---|---|---|---|
| Mistral-7B | 18.7 | 9.8 | 67.2 | — | |
| Plain | 21.4 ± 0.9 | 54.1 ± 1.2 | 87.0 ± 4.2 | 2.3 ± 1.9 | |
| ER | 22.7 ± 0.5 | 53.2 ± 0.6 | 89.1 ± 1.8 | 1.2 ± 0.7 | |
| DER | 22.1 ± 0.2 | 53.9 ± 0.6 | 90.8 ± 2.6 | 1.1 ± 1.3 | |
| DER++ | 22.4 ± 0.6 | 53.6 ± 0.3 | 89.6 ± 1.3 | 1.0 ± 0.6 | |
| Llama-3-8B | 18.6 | 7.3 | 72.5 | — | |
| Plain | 23.4 ± 0.9 | 52.8 ± 1.0 | 90.0 ± 2.9 | 2.0 ± 1.3 | |
| ER | 23.4 ± 0.2 | 53.4 ± 0.9 | 92.0 ± 1.8 | 1.1 ± 0.6 | |
| DER | 24.3 ± 0.1 | 53.9 ± 0.3 | 92.1 ± 1.0 | 0.6 ± 0.2 | |
| DER++ | 23.7 ± 0.2 | 53.7 ± 0.3 | 92.2 ± 0.8 | 0.8 ± 0.1 |
base. Llama stays near its already high base OR-Bench-hard ORR, but its XSTest ORR rises from 4.8% to 10.4%, as shown in Table VI. Thus, similar downstream scores cannot establish that ordinary benign use is unaffected; task performance and over-refusal must be measured separately.
D. Additional safety results and buffer composition
Additional harmful-request and over-refusal benchmarks are also analyzed (Table VII). Unlike the balanced comparison in Table IV, its means use different ordering sets: O1–O6 for Plain and DER++, and O1–O3 for ER and DER.
On Llama, however, DER++ has mean OR-Bench-toxic ASR of 4.7%, compared with 4.1% at base, so its below-base HarmBench results do not extend to every benchmark.
The available buffer comparison also changes the trade-off. On Mistral O2 and O3, the 50:50 harmful:hard-negative buffer has 11–15 points lower OR-Bench-hard ORR and 1–6 points higher ASR than the main 70:30 buffer (Table VIII). This comparison keeps the buffer at 500 examples while changing

Fig. 4. Downstream task performance at O3 (left) and mean forgetting over available orderings (right), with Mistral in the top row and Llama in the bottom row.
TABLE VI
DER++ FINAL- HARMBENCH ASR AND XSTEST/ORB-HARD ORR (%) BY ORDERING, WITH MEAN S.D. OVER O1–O6.
| Model | Ordering | HarmBench ASR | XSTest | ORB-hard |
|---|---|---|---|---|
| Mistral-7B | O1 | 6.2 | 16.8 | 58.2 |
| O2 | 8.3 | 17.6 | 58.8 | |
| O3 | 6.7 | 17.6 | 64.6 | |
| O4 | 6.2 | 17.6 | 56.0 | |
| O5 | 8.3 | 17.6 | 63.8 | |
| O6 | 8.8 | 22.4 | 67.8 | |
| Mean s.d. | 7.4 1.2 | 18.3 2.1 | 61.5 4.5 | |
| Llama-3-8B | O1 | 0.8 | 10.8 | 71.0 |
| O2 | 2.1 | 8.8 | 69.2 | |
| O3 | 1.2 | 12.0 | 76.8 | |
| O4 | 0.8 | 10.0 | 66.6 | |
| O5 | 0.8 | 11.2 | 74.8 | |
| O6 | 0.8 | 9.6 | 75.2 | |
| Mean s.d. | 1.1 0.5 | 10.4 1.2 | 72.3 4.0 | |
its harmful-benign ratio. The two evaluated orderings suggest that adding benign replay examples can moderate over-refusal, with some loss of the harmful-compliance reduction. However,
coverage is limited to Mistral O2/O3 so it does not identify a generally optimal buffer ratio.
E. Lower ASR does not require preservation of the base refusal direction
Refusal direction tracking demonstrates that retaining the base representation does not identify the training objective with the lowest harmful compliance. On both models, DER preserves the direction more closely than ER, despite ER achieving lower ASR (Figure 5). The mismatch is particularly clear for Mistral: DER's cosine similarity to base is 0.976, versus 0.718 for ER, while their ASRs are 46.7% and 1.0%.
The wider geometric pattern follows the training signal. DER and DER++ retain high cosine similarity and nearly unchanged magnitude on both models, while Plain and ER rotate farther from base (Table IX; Figure 6). Since Plain increases ASR and ER reduces it, rotation alone cannot distinguish safety erosion from the behavioral change induced by supervised replay exposure. See Figure 7 for a summary of the magnitude and rotation of the refusal direction across the objectives.
TABLE VII
FINAL- ASR AND ORR (%) AT SEED 42, MEAN S.D. OVER O1–O6 FOR PLAIN/DER++ AND O1–O3 FOR ER/DER.
| Model | Metric | Plain | DER | ER | DER++ | |
|---|---|---|---|---|---|---|
| Mistral-7B | HarmBench ASR | 52.1 | 68.7 7.4 | 46.7 3.8 | 1.0 0.9 | 7.4 1.2 |
| AdvBench ASR | 35.8 | 66.3 5.6 | 30.3 1.8 | 0.0 0.0 | 0.7 0.4 | |
| JBB ASR | 41.0 | 73.5 8.4 | 39.0 4.4 | 0.3 0.6 | 1.0 0.6 | |
| ORB-toxic ASR | 43.1 | 75.8 2.8 | 37.4 2.4 | 2.0 0.5 | 8.3 2.5 | |
| XSTest ORR | 4.8 | 2.7 0.6 | 7.9 0.8 | 28.0 2.8 | 18.3 2.1 | |
| ORB-hard ORR | 13.0 | 4.0 1.6 | 18.1 2.3 | 66.4 2.8 | 61.5 4.5 | |
| Llama-3-8B | HarmBench ASR | 5.8 | 33.5 12.2 | 4.9 1.7 | 1.2 0.4 | 1.1 0.5 |
| AdvBench ASR | 1.2 | 12.8 4.6 | 1.1 0.3 | 0.0 0.0 | 0.0 0.0 | |
| JBB ASR | 3.0 | 25.3 10.5 | 2.3 1.5 | 0.3 0.6 | 0.2 0.4 | |
| ORB-toxic ASR | 4.1 | 28.6 5.1 | 2.9 0.7 | 2.5 0.5 | 4.7 0.8 | |
| XSTest ORR | 4.8 | 4.1 2.0 | 4.5 0.6 | 24.9 2.7 | 10.4 1.2 | |
| ORB-hard ORR | 72.4 | 12.3 3.4 | 74.9 1.5 | 77.2 1.4 | 72.3 4.0 |
TABLE VIII
FINAL-CHECKPOINT ASR AND ORR (%) FOR THE 70:30 AND 50:50 BUFFERS ON MISTRAL O2/O3.
| Metric (Mistral-7B) | O2 70:30 | O2 50:50 | O3 70:30 | O3 50:50 |
|---|---|---|---|---|
| HarmBench ASR | 8.3 | 13.8 | 6.7 | 7.9 |
| XSTest ORR | 17.6 | 16.0 | 17.6 | 16.8 |
| ORB-hard ORR | 58.8 | 48.0 | 64.6 | 50.0 |
Direction similarity alone cannot tell us whether the extracted direction still mediates refusal. In Table IX, Refusal is the unablated refusal rate and Refusal is the fraction of WildGuard-judged refusal removed by own-direction ablation on held-out prompts (Eq. 6); a low unablated refusal rate magnifies this ratio. On Llama, ablating ER's own direction at removes only 6% of refusals, compared with 71% for DER; this gap persists across O1 seeds (as described later in Table XI). On Mistral, ER again has a smaller effect than DER but the gap is narrower (0.19 versus 0.32 in Refusal).
Mistral Plain illustrates why Refusal must be read as a relative change. Its unablated refusal rate at is only 0.15, and its Refusal of -0.29 means refusal increases after ablation. Because the unablated rate is the denominator in Eq. 6, -0.29 does not mean a 29-percentage-point increase. A supplementary Gemma evaluation likewise finds a smaller effect for ER than DER, though the DER–DER++ ordering differs from Llama (see Section IV-G). How much refusal survives directional ablation is therefore model-dependent, yet across all three models geometric preservation still fails to rank the observed ASR outcomes.
Figure 7 compares final refusal-direction similarity and magnitude across O1–O3. Magnitudes are normalized to the base values of 2.89 for Mistral and 2.77 for Llama.
F. Seed robustness
Seed replications cover O1, seeds 42–44, excluding Matched Plain. Table X reports ASR and ORR. Table XI reports Refusal, the fraction of refusals removed by own-direction ablation (Eq. 6). O1 Plain endpoints are on Mistral and on Llama. Across the four objectives, ASR standard deviations range from 0.5 to 2.5
TABLE IX
REFUSAL GEOMETRY AND ABLATION EFFECTS, MEANS OVER O1–O3 AT , EXCEPT THE REFUSAL CHAIN (). NEGATIVE REFUSAL INDICATES INCREASED REFUSAL AFTER ABLATION; NO CELLS ARE BOLDED AS THESE METRICS HAVE NO PREFERRED DIRECTION.
| Model | Method | cos | Refusal | Refusal | |
|---|---|---|---|---|---|
| Mistral-7B | 1.000 | 2.89 | 0.72 | 0.42 | |
| Plain | 0.737 | 2.08 | 0.15 | 0.15 -0.16 -0.29 | |
| ER | 0.718 | 2.44 | 0.99 | 0.16 0.24 0.19 | |
| DER | 0.976 | 2.92 | 0.70 | 0.33 0.28 0.32 | |
| DER++ | 0.960 | 2.85 | 0.94 | 0.28 0.31 0.30 | |
| Llama-3-8B | 1.000 | 2.77 | 0.97 | 0.69 | |
| Plain | 0.891 | 2.43 | 0.64 | 0.69 0.65 0.65 | |
| ER | 0.827 | 2.51 | 1.00 | 0.03 0.05 0.06 | |
| DER | 0.995 | 2.79 | 0.98 | 0.71 0.72 0.71 | |
| DER++ | 0.992 | 2.76 | 0.95 | 0.61 0.57 0.54 |

Fig. 5. Final-checkpoint cosine similarity to the base refusal direction versus HarmBench ASR (faint: orderings, bold: means, stars: ).
percentage points, smaller than the main gaps between Plain and exposure-based replay. At seed 43 on Mistral, final-task mean ASR retains the ordering QA (74.8%), summarization (70.6%), then code (66.9%).

Fig. 6. Refusal geometry across O1–O3 for Mistral (left) and Llama (right), with magnitude normalized to each trajectory's base and each arrow representing one task step.

Fig. 7. cosine similarity to the base refusal direction versus relative magnitude over O1–O3 (faint: orderings; bold: model-method means).
G. Gemma generalization check
Gemma-2-9B-IT uses seed 42, token offset -5, extraction layer 21, micro-batch 4 and gradient accumulation 4 (effective batch size 16), with the same 60 ablation prompts as the primary models. Across O1–O6, Plain raises HarmBench ASR from 2.1% to 5.8–15.4% (mean 8.5%); DER++ ends at 1.7–2.5% (mean 2.1%). Table XII gives the O1 behavioral results. ER reduces ASR below base (1.2% versus 2.1%), while DER retains the base value; their OR-Bench-hard ORRs are 91.6% and 82.4%, compared with 79.0% at base. This single-ordering comparison reproduces the distinction between exposure's larger ASR reduction and distillation's retention of base behavior.
TABLE X
O1 FINAL- ASR AND ORR (%), MEAN S.D. OVER SEEDS 42–44. LOWEST MEAN PER MEASURE AND MODEL IN BOLD.
| Model | Method | HarmBench ASR | XSTest ORR | ORB-hard ORR |
|---|---|---|---|---|
| Mistral-7B | 52.1 | 4.8 | 13.0 | |
| Plain | 75.3 1.3 | 2.9 0.5 | 5.9 1.3 | |
| ER | 1.1 1.0 | 27.5 2.0 | 67.7 3.8 | |
| DER | 45.4 1.8 | 7.1 0.6 | 18.5 2.0 | |
| DER++ | 8.3 2.1 | 17.9 1.2 | 57.7 3.8 | |
| Llama-3-8B | 5.8 | 4.8 | 72.4 | |
| Plain | 41.0 2.5 | 2.9 0.5 | 10.9 1.9 | |
| ER | 1.5 0.6 | 26.5 1.6 | 83.8 4.7 | |
| DER | 4.2 2.2 | 5.3 0.6 | 72.5 4.6 | |
| DER++ | 0.6 0.5 | 11.2 0.4 | 72.9 2.1 |
TABLE XI
O1 FINAL- REFUSAL, MEAN S.D. OVER SEEDS 42–44.
| Model | Method | Refusal |
|---|---|---|
| Mistral-7B | 0.42 | |
| Plain | ||
| ER | ||
| DER | ||
| DER++ | ||
| Llama-3-8B | 0.69 | |
| Plain | ||
| ER | ||
| DER | ||
| DER++ |
ER has a smaller own-direction ablation effect than DER (0.15 versus 0.59). DER++ however has a larger effect than DER (0.64 versus 0.59), reversing their ordering on Llama. The ER–DER contrast recurs with Gemma but the full ordering of geometric effects does not generalize across models.
TABLE XII GEMMA O1 FACTORIAL ASR AND ORR AT (%).
| Method | HarmBench ASR | XSTest ORR | ORB-hard ORR |
|---|---|---|---|
| 2.1 | 16.0 | 79.0 | |
| Plain | 15.4 | 18.0 | 60.6 |
| ER | 1.2 | 26.8 | 91.6 |
| DER | 2.1 | 17.2 | 82.4 |
| DER++ | 2.5 | 16.8 | 78.6 |
H. SafeLoRA also exhibits a safety-over-refusal trade-off
Post-hoc SafeLoRA reduces harmful compliance on Llama while increasing refusal of benign requests. Thus the safety-over-refusal trade-off observed under replay also occurs under weight-space projection in this setting. At the shared threshold , Llama's mean HarmBench ASR over O1–O3 falls from 38.3% under Plain to 20.3%, while OR-Bench-hard ORR rises from 11.1% to 43.7%. ASR remains above the base model's 5.8%. Lower harmful compliance thus comes with a substantial benign-refusal cost under the post-hoc protocol in Section III-E.
The ASR effect varies with the model and projection threshold. At , Mistral's mean ASR is 72.4%, above both Plain (69.6%) and base (52.1%). In a separate Mistral O1 rerun, however, raising from 0.5 to 1.0 lowers ASR from 77.5% to 50.4%, near base (see Table XIII). This threshold sensitivity limits conclusions from the shared setting.
Table XIII gives the Mistral O1 threshold sweep. ASR is the percentage of harmful answers on 240 matched non-copyright HarmBench behaviors; the base model is shown for context, not as a threshold setting. Projecting the ten lowest-cosine matrices instead gives mean O1–O3 ASR of 74.7% (Mistral) and 36.5% (Llama). Sensitivity runs round selection cosines to five decimal places; their means are 72.1%/20.8%, versus 72.4%/20.3% in the original evaluations above. These runs are not pooled.
TABLE XIII SAFELORA THRESHOLD SENSITIVITY ON MISTRAL O1 AT SEED 42.
| Setting | Harmful / total | ASR (%) |
|---|---|---|
| 125/240 | 52.1 | |
| 186/240 | 77.5 | |
| 175/240 | 72.9 | |
| 186/240 | 77.5 | |
| 121/240 | 50.4 |
V. DISCUSSION
A. Retaining base behavior and reducing harmful compliance are different objectives
The factorial decomposition shows why the choice of replay signal matters. Distillation constrains the model toward the base logits on the buffer, so its behavior changes little. Supervised exposure instead trains on the buffer's refusal and compliance responses, producing larger reductions in ASR along with more benign refusal. These effects follow directly
from what each objective optimizes and, depending on the base model's safety profile, can be desirable or detrimental.
For Mistral, this proximity reproduces substantial harmful compliance; for Llama, it retains substantial over-refusal of difficult benign requests. Adding distillation to exposure moderates over-refusal but sacrifices some of exposure's ASR reduction on Mistral. These non-additive effects make the relative cost of harmful compliance and benign refusal, rather than any single optimal setup, the important choice when selecting a training objective.
B. Refusal geometry and behavioral safety decouple
The geometric results reinforce the distinction between direction preservation and ASR reduction. Distillation preserves the base direction closely on both primary models but exposure reaches lower ASR after greater rotation. Plain also rotates the direction while increasing ASR. Table XIV summarizes this mismatch: similar degrees of geometric preservation can result in very different behavioral outcomes. Direction tracking is therefore informative about representational changes but is insufficient on its own to select a safety-preserving objective.
Llama's ablation result adds a distinct limitation. After supervised exposure, the extracted direction separates the extraction prompts yet accounts for little of the observed refusal under intervention. This does not establish that refusal has become multidimensional: a different direction or extraction layer could account for the retained behavior. Distinguishing those possibilities requires layer sweeps and multi-directional interventions [24, 26].
TABLE XIV DESCRIPTIVE () FACTORIAL SUMMARY; : DISTILLATION, : REPLAY EXPOSURE, COSINE: SIMILARITY TO THE BASE REFUSAL DIRECTION, ASR: HARMBENCH.
| PlainLower base cosineASR above base | ERLower base cosineASR below base | |
| DERHigher base cosineASR near base | DER++Higher base cosineASR below base |
C. Safety evaluation requires complementary behavioral tests
Task performance and benign refusal expose different aspects of the safety-overrefusal trade-off. Similar task scores show that the replay objectives retain learning on the evaluated tasks, but do not reveal how often the model refuses difficult benign requests. A mitigation can therefore preserve task learning and reduce harmful compliance while remaining costly for benign use. Evaluating all three outcomes is necessary to characterize that cost.
The Llama SafeLoRA result extends the need for joint behavioral evaluation beyond replay: weight-space projection also reduces harmful compliance while increasing benign refusal. Its Mistral threshold sensitivity and unmeasured task utility prevent a general comparison with replay. What generalizes across these evaluations is the need to assess each behavioral outcome directly.
VI. LIMITATIONS AND FUTURE WORK
The main study covers two 7–8B instruction-tuned models and three-task sequences, with a single-ordering 9B Gemma check. Whether these trade-offs extend to longer chains, larger models and reasoning models remains untested.
The reported safety evaluations use fixed harmful requests and do not establish robustness to adaptive attacks. Future work should evaluate optimized suffix attacks such as GCG [32], as well as multi-turn, transfer and prompt-injection attacks, to test whether the exposure-distillation trade-off persists under stronger adversarial pressure.
All ASR and ORR values come from automated judges, without a human audit of errors. Directional ablation uses one extraction layer per model and 60 WildGuard-scored prompts from a single dataset; its effects may depend on that layer, dataset and judge. Our geometric analysis does not fully characterize how refusal is represented. Larger ablation datasets, layer sweeps and multi-directional refusal analyses would enable a more complete understanding.
The factorial comparison holds several design choices fixed. ER, DER and DER++ share the same procedure and budget, while Matched Plain checks the difference from original Plain only on O1–O3 at seed 42. Its small observed shifts do not establish equivalence across other orders or seeds. Adapter rank and replay-buffer size are fixed at 16 and 500 examples, with no sensitivity ablations, and the buffer comes from one source, WildJailbreak.
Controlled sweeps of adapter rank, replay volume, buffer construction and loss coefficients would establish whether the same distinction between exposure and distillation persists beyond these settings.
VII. CONCLUSION
Sequential fine-tuning erodes safety across every evaluated task ordering, but the two replay signals address that erosion differently. Supervised exposure reduces harmful compliance well below base at a substantial benign-refusal cost; logit distillation largely retains base behavior. Combining them moderates exposure's over-refusal while retaining task learning, with some loss of its ASR reduction on Mistral. The geometric analysis supports the same distinction between retention and behavioral improvement: preserving the base refusal direction does not identify the lowest-ASR objective, and Llama's refusal after exposure largely survives ablation of its extracted direction. These findings make the replay objective consequential for both harmful and benign use. Choosing it requires direct evaluation of harmful compliance and benign refusal alongside task performance.
OPEN SCIENCE
The repository includes the results supporting the reported evaluations, training and evaluation code, offline analysis scripts and figure assets. The results folders contain retained aggregate metrics and per-item records, including prompts, generated responses and judge outputs. Model weights and raw training/replay inputs are omitted because of their size. The release includes the dataset and replay-buffer builders and the replay seed to support inspection of the construction procedure. Base model identifiers are listed in Appendix VIII-C and training datasets in Appendix VIII-A. The repository is available at https://github.com/gruellan/preserving_safety_sequential_finetuning.
LLM USAGE CONSIDERATIONS
LLM assistants supported coding, statistical analysis and paper revisions. LLMs were used for editorial purposes in this manuscript, and all outputs were inspected by the authors to ensure accuracy and originality. The substantial majority of the code and writing was performed by the authors. The authors verified all methods, calculations and commentary outputted by the LLMs and take full responsibility for the final work.
LLMs are also part of the experimental method: provides replay-filtering responses and teacher logits used in fine-tuning experiments, HarmBench supplies the harmfulness classifier model and WildGuard supplies refusal labels. These labels are not human annotations and their error rates on the evaluated conditions are unknown. The study uses 7–9B models, LoRA, cached teacher logits and reused saved outputs to make comparisons computationally feasible on a single A100 and minimize redundant computation. Restricting seed replication reduces compute while also limiting generalization.
ETHICAL CONSIDERATIONS
This study evaluates safety degradation and replay mitigations using public models and established benchmarks. The paper presents aggregate metrics, without reproducing harmful prompts or completions. The release includes the results supporting the reported evaluations, including retained prompts and model responses. These records support scrutiny of the evaluations but may contain harmful or disturbing material, and releasing them carries a minor risk of misuse.
REFERENCES
[1] X. Qi, Y. Zeng, T. Xie, P.-Y. Chen, R. Jia, P. Mittal, and P. Henderson, “Fine-tuning aligned language models compromises safety, even when users do not intend to!” In The Twelfth International Conference on Learning Representations (ICLR), 2024. DOI: 10.48550/arXiv.2310.03693 Accessed: Jun. 20, 2026. [Online]. Available: https://proceedings.iclr.cc/paper_files/paper/2024/file/83b7da3ed13f06c13ce82235c8eedf35-PaperConference.pdf
[2] L. He, M. Xia, and P. Henderson, “What is in your safe data? identifying benign data that breaks safety,” in First Conference on Language Modeling, 2024. Accessed: Jun. 24, 2026. [Online]. Available: https://openreview.net/forum?id=Hi8jKh4HE9
[3] J. Kirkpatrick, R. Pascanu, N. Rabinowitz, J. Veness, G. Desjardins, A. A. Rusu, K. Milan, J. Quan, T. Ramalho, A. Grabska-Barwinska, D. Hassabis, C. Clopath, D. Kumaran, and R. Hadsell, “Overcoming catastrophic forgetting in neural networks,” Proceedings of the National Academy of Sciences, vol. 114, no. 13, pp. 3521–3526, 2017. DOI: 10.1073/pnas.1611835114 [Online]. Available: https://www.pnas.org/doi/abs/10.1073/pnas.1611835114
[4] H. Shi, Z. Xu, H. Wang, W. Qin, W. Wang, Y. Wang, Z. Wang, S. Ebrahimi, and H. Wang, “Continual learning of large language models: A comprehensive survey,” ACM Computing Surveys, vol. 58, no. 5, Nov. 2025. DOI: 10.1145/3735633 Accessed: Jun. 20, 2026. [Online]. Available: https://doi.org/10.1145/3735633
[5] E. J. Hu, Y. Shen, P. Wallis, Z. Allen-Zhu, Y. Li, S. Wang, L. Wang, and W. Chen, “LoRA: Low-rank adaptation of large language models,” in International Conference on Learning Representations (ICLR), 2022. Accessed: Jun. 25, 2026. [Online]. Available: https://openreview.net/pdf?id=nZeVKeeFYf9
[6] S. Lermen, C. Rogers-Smith, and J. Ladish, “LoRA fine-tuning efficiently undoes safety training in Llama 2-Chat 70B,” in ICLR 2024 Workshop on Secure and Trustworthy Large Language Models, 2024. Accessed: Jun. 27, 2026. [Online]. Available: https://arxiv.org/abs/2310.20624
[7] P. Buzzega, M. Boschini, A. Porrello, D. Abati, and S. Calderara, “Dark experience for general continual learning: A strong, simple baseline,” in Advances in Neural Information Processing Systems (NeurIPS), 2020. Accessed: Jun. 27, 2026. [Online]. Available: https://dl.acm.org/doi/10.5555/3495724.3497059
[8] T. Scialom, T. Chakrabarty, and S. Muresan, “Fine-tuned language models are continual learners,” in Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing, Association for Computational Linguistics, 2022, pp. 6107–6122. DOI: 10.18653/v1/2022.emnlp-main.410 Accessed: Jun. 20,
- [Online]. Available: https://aclanthology.org/2022.emnlp-main.410/
[9] F. Bianchi, M. Suzgun, G. Attanasio, P. Rottger, D. Jurafsky, T. Hashimoto, and J. Zou, “Safety-tuned LLa-MAs: Lessons from improving the safety of large language models that follow instructions,” in The Twelfth International Conference on Learning Representations, 2024. Accessed: Sep. 20, 2026. [Online]. Available: https://openreview.net/forum?id=gT5hALch9z
[10] L. Alsum, H. Itani, H. A. A. K. Hammoud, P. Torr, A. Bibi, and B. Ghanem, Unforgotten safety: Preserving safety alignment of large language models with continual learning, arXiv preprint, 2025. DOI: 10.48550/arXiv.2512.10150 arXiv: 2512.10150. Accessed: Jun. 20, 2026. [Online]. Available: https://arxiv.org/abs/2512.10150
[11] D. Guo, J. Wu, and S. M. Yiu, SafeAnchor: Preventing cumulative safety erosion in continual domain adaptation of large language models, arXiv preprint, 2026. arXiv: 2604.17691. Accessed: Jul. 7, 2026. [Online]. Available: https://arxiv.org/abs/2604.17691
[12] X. Qi, A. Panda, K. Lyu, X. Ma, S. Roy, A. Beirami, P. Mittal, and P. Henderson, “Safety alignment should be made more than just a few tokens deep,” in The Thirteenth International Conference on Learning Representations (ICLR), 2025. Accessed: Jun. 27, 2026. [Online]. Available: https://openreview.net/forum?id=6Mxhg9PtDE
[13] A. Arditi, O. B. Obeso, A. Syed, D. Paleka, N. Rimsky, W. Gurnee, and N. Nanda, “Refusal in language models is mediated by a single direction,” in Advances in Neural Information Processing Systems (NeurIPS), 2024. Accessed: Jun. 20, 2026. [Online]. Available: https://openreview.net/forum?id=pH3XAQME6c
[14] B. Wei, K. Huang, Y. Huang, T. Xie, X. Qi, M. Xia, P. Mittal, M. Wang, and P. Henderson, “Assessing the brittleness of safety alignment via pruning and low-rank modifications,” in Proceedings of the 41st International Conference on Machine Learning (ICML), 2024. Accessed: Jun. 27, 2026. [Online]. Available: https://dl.acm.org/doi/10.5555/3692070.3694226
[15] Y. Luo, Z. Yang, F. Meng, Y. Li, J. Zhou, and Y. Zhang, “An empirical study of catastrophic forgetting in large language models during continual fine-tuning,” IEEE Transactions on Audio, Speech and Language Processing, vol. 33, pp. 3776–3786, 2025. DOI: 10.1109/TASLPRO.2025.3606231 Accessed: Jul. 2, 2026. [Online]. Available: https://ieeexplore.ieee.org/document/11151751
[16] G. I. Parisi, R. Kemker, J. L. Part, C. Kanan, and S. Wermter, “Continual lifelong learning with neural networks: A review,” Neural Networks, vol. 113, pp. 54–71, 2019. DOI: 10.1016/j.neunet.2019.01.012 Accessed: Jul. 2, 2026. [Online]. Available: https://www.sciencedirect.com/science/article/pii/S0893608019300231
[17] K. C. Fraser, H. Dawkins, I. Nejadgholi, and S. Kiritchenko, “Fine-tuning lowers safety and disrupts evaluation consistency,” in Proceedings of the First Workshop on LLM Security (LLMSEC), L. Derczynski, J. Novikova, and M. Chen, Eds., Association for Computational Linguistics, Aug. 2025, pp. 129–141. Accessed: Jun. 20, 2026. [Online]. Available: https://aclanthology.org/2025.llmsec-1.10/
[18] M. Ung, A. Sun, S. J. Bell, L. Sagun, and A. Williams, “Chained tuning leads to biased forgetting,” in ICML 2024 Next Generation of AI Safety Workshop, 2024. Accessed: Jul. 7, 2026. [Online]. Available: https://openreview.net/forum?id=kmPDgpEi07
[19] C.-Y. Hsu, Y.-L. Tsai, C.-H. Lin, P.-Y. Chen, C.-M. Yu, and C.-Y. Huang, “Safe LoRA: The silver lining of reducing safety risks when finetuning large language models,” in Advances in Neural Information Processing Systems (NeurIPS), 2024. Accessed: Jun. 27, 2026. [Online]. Available: https://openreview.net/forum?id=HcifdQZFZV
[20] M. Li, W. M. Si, M. Backes, Y. Zhang, and Y. Wang, “SaLoRA: Safety-alignment preserved low-rank adaptation,” in The Thirteenth International Conference on Learning Representations (ICLR), 2025. Accessed: Jul. 8, 2026. [Online]. Available: https://openreview.net/forum?id=GOoVzE9nSj
[21] Y. Du, F. Fan, S. Zhao, J. Cao, Q. Lin, K. He, T. Liu, B. Qin, and M. Feng, Anchoring refusal direction: Mitigating safety risks in tuning via projection constraint, arXiv preprint, 2025. DOI: 10.48550/arXiv.2509.06795 arXiv: 2509.06795. [Online]. Available: https://arxiv.org/abs/2509.06795
[22] S. Li, L. Yao, L. Zhang, and Y. Li, “Safety layers in aligned large language models: The key to LLM security,” in The Thirteenth International Conference on Learning Representations (ICLR), 2025. Accessed: Jul. 8, 2026. [Online]. Available: https://arxiv.org/abs/2408.17003
[23] J. Chen, X. Wang, Z. Yao, Y. Bai, L. Hou, and J. Li, “Towards understanding safety alignment: A mechanistic perspective from safety neurons,” in Advances in Neural Information Processing Systems (NeurIPS), 2025. Accessed: Jul. 8, 2026. [Online]. Available: https://proceedings.neurips.cc/paper_files/paper/2025/file/12a00d85a76fe258e1242c3aced03250-PaperConference.pdf
[24] T. Wollschläger, J. Elstner, S. Geisler, V. Cohen-Addad, S. Günnemann, and J. Gasteiger, “The geometry of refusal in large language models: Concept cones and representational independence,” in Proceedings of the 42nd International Conference on Machine Learning (ICML), 2025. Accessed: Jul. 1, 2026. [Online]. Available: https://dl.acm.org/doi/10.5555/3780338.3783003
[25] W. Pan, Z. Liu, Q. Chen, X. Zhou, H. Yu, and X. Jia, “The hidden dimensions of LLM alignment: A multi-dimensional analysis of orthogonal safety directions,”
in Proceedings of the 42nd International Conference on Machine Learning (ICML), 2025. [Online]. Available: https://openreview.net/forum?id=wGFEzfhFae
[26] F. Joad, M. Hawasly, S. Boughorbel, N. Durrani, and H. T. Sencar, There is more to refusal in large language models than a single direction, arXiv preprint, 2026. arXiv: 2602.02132. Accessed: Jul. 1, 2026. [Online]. Available: https://arxiv.org/abs/2602.02132
[27] W. Lan, S. Li, X. Lai, M. Wu, J. Yang, H. Shen, and Y. Yang, Dynamic adversarial fine-tuning reorganizes refusal geometry, arXiv preprint, 2026. arXiv: 2604.27019 [cs.LG]. Accessed: Jul. 7, 2026. [Online]. Available: https://arxiv.org/abs/2604.27019
[28] X. Wang, Y. Zhang, T. Chen, S. Gao, S. Jin, X. Yang, Z. Xi, R. Zheng, Y. Zou, T. Gui, Q. Zhang, and X. Huang, TRACE: A comprehensive benchmark for continual learning in large language models, arXiv preprint, 2023. arXiv: 2310.06762. Accessed: Jun. 20, 2026. [Online]. Available: https://arxiv.org/abs/2310.06762
[29] Y. Xie, Y. Zhang, T. Liu, D. Ma, and T. Liu, “Beyond surface alignment: Rebuilding LLMs safety mechanism via probabilistically ablating refusal direction,” in Findings of the Association for Computational Linguistics: EMNLP 2025, Suzhou, China: Association for Computational Linguistics, 2025, pp. 17620–17632. DOI: 10.18653/v1/2025.findings-emnlp.956 [Online]. Available: https://aclanthology.org/2025.findings-emnlp.956/
[30] L. Jiang, K. Rao, S. Han, A. Ettinger, F. Brahman, S. Kumar, N. Mireshghallah, X. Lu, M. Sap, Y. Choi, and N. Dziri, “WildTeaming at scale: From in-the-wild jailbreaks to (adversarially) safer language models,” in Advances in Neural Information Processing Systems (NeurIPS), 2024. Accessed: Jun. 20, 2026. [Online]. Available: https://arxiv.org/abs/2406.18510
[31] M. Mazeika, L. Phan, X. Yin, A. Zou, Z. Wang, N. Mu, E. Sakhaee, N. Li, S. Basart, B. Li, D. Forsyth, and D. Hendrycks, “HarmBench: A standardized evaluation framework for automated red teaming and robust refusal,” in Proceedings of the 41st International Conference on Machine Learning (ICML), JMLR.org, 2024. Accessed: Jun. 20, 2026. [Online]. Available: https://doi/abs/10.5555/3692070.3693501
[32] A. Zou, Z. Wang, J. Z. Kolter, and M. Fredrikson, Universal and transferable adversarial attacks on aligned language models, arXiv preprint, 2023. arXiv: 2307.15043. Accessed: Jun. 20, 2026. [Online]. Available: https://arxiv.org/abs/2307.15043
[33] P. Chao, E. Debenedetti, A. Robey, M. Andriushchenko, F. Croce, V. Sehwag, E. Dobriban, N. Flammarion, G. J. Pappas, F. Tramèr, H. Hassani, and E. Wong, “JailbreakBench: An open robustness benchmark for jail-breaking large language models,” in Advances in Neural Information Processing Systems (NeurIPS), Datasets and Benchmarks Track, 2024. Accessed: Jun. 20, 2026.
[Online]. Available: https://dl.acm.org/doi/10.5555/3737916.3739661
[34] J. Cui, W.-L. Chiang, I. Stoica, and C.-J. Hsieh, “OR-Bench: An over-refusal benchmark for large language models,” in Proceedings of the 42nd International Conference on Machine Learning (ICML), 2025. Accessed: Jun. 20, 2026. [Online]. Available: https://dl.acm.org/doi/10.5555/3780338.3780782
[35] S. Han, K. Rao, A. Ettinger, L. Jiang, B. Y. Lin, N. Lambert, Y. Choi, and N. Dziri, “WildGuard: Open one-stop moderation tools for safety risks, jailbreaks, and refusals of LLMs,” in Advances in Neural Information Processing Systems (NeurIPS), Datasets and Benchmarks Track, 2024. Accessed: Jun. 20, 2026. [Online]. Available: https://dl.acm.org/doi/10.5555/3737916.3738177
[36] P. Röttger, H. Kirk, B. Vidgen, G. Attanasio, F. Bianchi, and D. Hovy, “XSTest: A test suite for identifying exaggerated safety behaviours in large language models,” in Proceedings of the 2024 Conference of the North American Chapter of the Association for Computational Linguistics (NAACL), K. Duh, H. Gomez, and S. Bethard, Eds., Association for Computational Linguistics, Jun. 2024, pp. 5377–5400. DOI: 10.18653/v1/2024.naacl-long.301 Accessed: Jun. 20, 2026. [Online]. Available: https://aclanthology.org/2024.naacl-long.301/
[37] Gemma Team et al., “Gemma 2: Improving open language models at a practical size,” arXiv pre-print, 2024. Accessed: Aug. 9, 2026. [Online]. Available: https://arxiv.org/abs/2408.00118
VIII. APPENDIX
Meta-Llama-3-8B-Instruct and google/gemma-2-9b-it.
A. Implementation details
LoRA targets the projections with rank 16, scaling 32 and dropout 0.05. Training uses 3 epochs per task, effective batch size 16, peak learning rate , AdamW (weight decay 0.01) and cosine decay with 3% warmup. Python, NumPy and PyTorch are seeded (42 unless stated); deterministic kernels are used. Primary models use SDPA, Gemma uses eager attention, on a single NVIDIA A100 SXM. Each TRACE LLM-CL-Benchmark_5000 split supplies 5000 examples (Py150, 20Minute, ScienceQA), totaling 15,000 per heterogeneous ordering. The homogeneous control uses three disjoint Py150 shards (1667/1667/1666 examples).
B. Batching and training budgets
Section III-B defines the mixed batches, loss normalization and matched control. Both collators pad dynamically and mask prompt and padding labels with -100. Input limits, including responses, are 1024 tokens for code, QA and replay, and 2048 for summarization. Empty task or replay groups contribute zero loss; gradient accumulation combines minibatch losses rather than a global token-weighted mean. The trainer skips logit comparison when .
Original Plain has 936 scheduled updates per task; Matched Plain and replay have 1032. The homogeneous control has 312 per stage (936 total), versus 2808 for heterogeneous Plain.
C. Evaluation coverage and retained records
Table XV lists the reported run sets. ASR uses 240 non-copyright HarmBench, 520 AdvBench, 100 JailbreakBench and 320 OR-Bench-toxic requests. ORR uses 250 benign XSTest and 500 OR-Bench-hard prompts; unsafe XSTest prompts are excluded. Geometry uses 112 prompts per extraction class and 60 held-out ablation prompts.
TABLE XV REPORTED EVALUATION COVERAGE BY MEASUREMENT, TRAINING CONDITION AND MODEL CHECKPOINT.
| Measurement | Conditions | Checkpoints |
|---|---|---|
| Primary HarmBench | Plain/DER++ O1–O6; ER/DER O1–O3; seed 42 | M0–M3 |
| Primary held-out ASR and ORR | Same method/ordering sets | M0, M3 |
| Matched Plain control | Primary models, O1–O3, seed 42 | M0, M3 ASR/ORR |
| Primary geometry/ablation | Four methods, O1–O3, seed 42 | M0–M3 |
| Primary seed replication | Four methods, O1, seeds 42–44 | ASR/geometry chains; held-out ASR/ORR endpoints |
| Gemma check | Plain/DER++ O1–O6; four methods at O1; seed 42 | ASR chains and ORR endpoints; geometry O1–O3 for Plain/DER++ and O1 for ER/DER |
Model identifiers are mistralai/ Mistral-7B-Instruct-v0.2, meta-llama/