Skip to content

Safety Preservation in Sequential Fine-Tuning: Factorial and Geometric Analysis of ReplayPreserving Safety During Sequential Fine-Tuning: A Factorial and Geometric Analysis of Replay

arXiv: Jailbreaks, Prompt Injection, Poisoning & Defenses· arXiv:2610.38001· George Ruellan, Diana Benavides-PradoSchool of Electronic Engineering and Computer Science, Queen Mary University of LondonIndexed by this site · 24 days ago· Originally publishedDefenses

Quick read

Defenses

Based on the paper PDF (AI-generated); refer to the original

The authors decompose the safety exposure and distillation signals of replay in sequential LoRA fine-tuning: on Mistral, exposure lowers mean ASR to 1.0% but the OR-Bench-hard refusal rate reaches 66.4%.

Threat modelThis work studies how sequential fine-tuning on benign downstream data erodes safety alignment: no attacker is present, and the risk comes from the training process itself. The victim system is an instruction model sequentially fine-tuned with LoRA on three TRACE tasks; the mitigation goal is to limit harmful compliance (ASR) and benign refusal (ORR) while preserving task learning.

Questions
Sequential fine-tuning on benign data erodes the safety alignment of LLMs, and the respective roles and costs of the two signals in replay mitigation—supervised exposure and logit distillation—had not previously been studied separately.
Methods
Sequentially LoRA fine-tune three TRACE tasks on Mistral-7B and Llama-3-8B, using a 2×2 factorial design to decompose replay: supervised exposure (ER), base-model logit distillation (DER), their combination (DER++), and Plain, jointly measuring ASR, over-refusal, task performance, and refusal-direction geometry.
Experiments and results
Under all six task orderings, Plain makes ASR higher than the base model; ER lowers Mistral's mean HarmBench ASR to 1.0% but raises the OR-Bench-hard refusal rate to 66.4%, and DER largely preserves base-model behavior; DER++ has lower ASR than the base model under all six orderings with similar task scores; geometrically, preserving the base model's refusal direction does not correspond to lower ASR.
Limitations and future work
The authors note: only two 7–8B models and a three-task chain are covered; adaptive attacks are not tested; ASR/ORR rely entirely on automatic review with no human auditing; ablations use only a single extraction layer and 60 prompts; adapter rank and buffer size are fixed with no sensitivity ablation.
Experimental setupMistral-7B-Instruct-v0.2、Meta-Llama-3-8B-Instruct et al. · TRACE (Py150, 20Minuten, ScienceQA)、HarmBench DirectRequest et al. · ASR、ORR et al.
Evaluated models
Mistral-7B-Instruct-v0.2Meta-Llama-3-8B-InstructGemma-2-9B-IT
Benchmarks
TRACE (Py150, 20Minuten, ScienceQA)HarmBench DirectRequestAdvBenchJailbreakBenchOR-Bench (toxic / or-bench-hard-1k)XSTestWildJailbreak
Metrics
ASRORRedit similarityROUGE-Lanswer accuracyforgettingcosine similarity∆Refusal
AI summaryThe researchers split safety replay into two strategies, supervised exposure and logit distillation, and compare their effects on safety behavior and refusal geometry in sequential LoRA fine-tuning of Mistral-7B and Llama-3-8B, with task sequences covering code generation, German summarization and science question answering. On Mistral, supervised replay exposure makes the HarmBench attack success rate on average 51.1 points lower than the base model, but OR-Bench-hard over-refusal on average 53.4 points higher than the base model; logit distillation, without using the supervised replay loss, lowers ASR by an average of 5.4 points, with over-refusal rising by only 5.1 points, and the two strategies show the same asymmetry on Llama. Combining exposure and distillation can mitigate the over-refusal brought by exposure, while downstream task scores are basically unaffected.

The researchers split safety replay into two strategies, supervised exposure and logit distillation, and compare their effects on safety behavior and refusal geometry in sequential LoRA fine-tuning of Mistral-7B and Llama-3-8B, with task sequences covering code generation, German summarization and science question answering. On Mistral, supervised replay exposure makes the HarmBench attack success rate on average 51.1 points lower than the base model, but OR-Bench-hard over-refusal on average 53.4 points higher than the base model; logit distillation, without using the supervised replay loss, lowers ASR by an average of 5.4 points, with over-refusal rising by only 5.1 points, and the two strategies show the same asymmetry on Llama. Combining exposure and distillation can mitigate the over-refusal brought by exposure, while downstream task scores are basically unaffected.

Paper analysis

6 questions; open one to read the full answer

  1. What problem does this paper attempt to solve?

    Sequential fine-tuning erodes safety alignment; the paper decomposes the behavioral and geometric effects of the two replay signals, exposure and distillation.

    Core question: sequential fine-tuning on benign data erodes safety alignment, and the respective contributions and costs of the two training signals in replay mitigation—supervised exposure and logit distillation—are not yet clear.

    • Setting and importance: continual learning requires the model to retain safety constraints while learning new tasks; the authors cite prior work stating that fine-tuning harms alignment even when downstream data is benign, and that LoRA does not guarantee safety preservation.
    • Shortcomings of existing methods: the authors state that prior work mixes harmful-prompt refusals and benign-compliance samples into replay, or uses distillation to match base-model logits, but the separate contributions of the two signals to safety behavior and refusal geometry have not been separated; differences across tasks varying in format, domain, and language have also been overlooked.
    • Core observation: the base model itself may already comply with harmful requests or refuse benign requests, so matching base-model logits and training on given safe responses may produce different safety outcomes from the same batch of replay samples.
    • Paper's approach: on Mistral-7B and Llama-3-8B, a 2×2 factorial design decomposes the two signals, jointly measuring harmful compliance, benign refusal, and task performance, and refusal-direction tracking and direction ablation test whether geometric preservation corresponds to behavioral safety.
    • Threat model:
      • Risk source: sequential LoRA fine-tuning on benign downstream data (continual learning setting); the paper does not posit an external attacker.
      • Victim system: instruction-aligned Mistral-7B-Instruct-v0.2 and Meta-Llama-3-8B-Instruct (with an additional Gemma-2-9B-IT check).
      • Success criteria: HarmBench ASR measures harmful compliance, ORR measures over-refusal of benign requests, and task scores measure downstream learning.
  2. What related research exists?

    Related work is divided into four groups: continual learning and forgetting, fragility of safety alignment, mitigation of safety degradation, and refusal geometry and causal intervention.

    Continual learning and catastrophic forgetting

    • Shi et al. (2025) distinguish vertical from horizontal continual learning; this paper studies the latter, i.e., sequential fine-tuning, in which catastrophic forgetting is a specific risk.
    • Classic mitigation work such as Kirkpatrick et al. (2017) and Parisi et al. (2019) falls into three categories: regularization, replay, and model-based methods; the paper notes that their retention of safety alignment has received less attention.

    Fragility of safety alignment

    • Qi et al. (2024) state that benign fine-tuning can impair aligned instruction models; Fraser et al. (2025) reproduced this finding on the Mistral-7B family used in this paper.
    • Qi et al. (2025) attribute the fragility to alignment being concentrated in the first few output tokens; Ung et al. (2024) found in two-task sequences that safety degradation is greater when task fine-tuning follows safety fine-tuning, and this paper extends that setting to all six permutations of three heterogeneous tasks.

    Mitigating safety degradation

    • SafeLoRA (2024) projects LoRA updates onto the safety alignment subspace; SaLoRA (2025) freezes safety modules; ProCon (2025) penalizes hidden-state drift along the refusal direction.
    • Unforgotten Safety (2025) states that DER reduces harmful compliance after a single downstream task but over-refusal rises relatively; SafeAnchor (2026) combines replay, projection, and distribution anchoring across six domain orderings.
    • The paper notes that these works act on weight updates, hidden representations, or model responses respectively, whereas this paper separates the respective effects of exposure and distillation, and uses SafeLoRA for a safety and over-refusal comparison under weight-space projection.

    Refusal geometry and causal intervention

    • Arditi et al. (2024) state that a single vector mediates refusal across 13 open-source models, and ablating this direction almost eliminates refusal; other work localizes safety to a narrow band of middle layers or about 5% of neurons.
    • The single-direction claim is disputed: Wollschläger et al. (2025) propose multi-dimensional concept cones, Pan et al. identify multiple orthogonal safety directions, and Joad et al. (2026) find representations to be more distributed than a single vector.

    Baselines and benchmarks: The compared methods are Plain, Matched Plain, ER, DER, DER++, and post-hoc SafeLoRA; the benchmarks are TRACE (Py150, 20Minuten, ScienceQA), HarmBench, AdvBench, JailbreakBench, OR-Bench, and XSTest, with the replay buffer drawn from WildJailbreak. Authors' positioning: this paper is the first study to factorize the two replay signals in heterogeneous sequential adaptation and jointly analyze behavior and geometry (this is the authors' stated contribution positioning; the original source does not use the word "first" and says this aspect "has been neglected by prior research").

  3. How does the paper address this problem?

    A 2×2 factorial decomposition with a fixed replay buffer, combined with behavioral evaluation and geometric tracking and causal ablation of the refusal direction.

    Overall approach: with a fixed replay buffer, the two signals—supervised exposure and base-model logit distillation—are independently switched on and off, forming a 2×2 factorial design, with sequential LoRA fine-tuning on six orderings of three TRACE tasks, measuring both behavioral outcomes and refusal-direction geometry.

    Training setup

    • Tasks and adapters: Three TRACE tasks—Py150 (code generation), 20Minuten (German summarization), and ScienceQA (science QA)—with 5000 samples per task; LoRA rank 16 applied to q/k/v/o projections, scaling 32, dropout 0.05; 3 epochs per task, effective batch size 16, peak learning rate 2×10⁻⁴, AdamW, cosine decay.
    • Sequential protocol: Adapters are cumulatively merged task by task; the model Mk after task k is the base model M0 plus adapters 1…k; the six task orderings are denoted O1–O6 (Table I).
    • Core comparisons: The 2×2 factorial covers Mistral and Llama on O1–O3; Plain and DER++ cover all six orderings; additional analyses include a homogeneous sequence (three Py150 shards), SafeLoRA projection, and a Gemma check.

    Factorial decomposition of replay

    • Replay buffer: A fixed 500 WildJailbreak samples (350 harmful paired with refusal completions + 150 adversarial benign paired with compliance completions, 70:30), concatenated and shuffled with the 5000 task samples, with replay accounting for 500/5500 of each epoch; candidates were filtered by M0 behavior when constructing the buffer.
    • Loss configuration: L = CE(fθ(X), Y) + β · CE(fθ(Xr), Yr) + α · MSE(fθ(Xr), Zr), where α controls distillation against precomputed logits from the base model (teacher) and β controls supervised cross-entropy on replay samples; ER is α=0, β=1, DER is α=1, β=0, DER++ is α=1, β=1, and Plain uses only task cross-entropy.
    • Control design: Matched Plain uses the replay trainer, batch mixing, and a 1032-update budget but with both replay losses set to zero, isolating pipeline differences from the original Plain (length grouping, 936 updates).
    • Interaction estimate: The interaction is defined as (DER++−DER)−(ER−Plain), computed on the percentage-point scale for ASR and ORR respectively, with Matched Plain substituted for Plain as a sensitivity check.

    Behavioral evaluation

    • ASR: The HarmBench DirectRequest test set after excluding copyright categories, n=240, with the cais/HarmBench-Llama-2-13b-cls classifier judging whether completions are harmful; M3 is also evaluated on three English jailbreak sets—AdvBench, JailbreakBench, and OR-Bench-toxic—using the same judge to compute ASR.
    • ORR: On 500 samples from OR-Bench-hard-1k and 250 hard negatives from XSTest, WildGuard judges refusal/compliance, and the refusal proportion is the ORR.
    • Task performance: Py150 uses edit similarity, ScienceQA uses answer accuracy, and 20Minuten uses ROUGE-L; forgetting is the mean drop from peak to final score on the two tasks not trained last.

    Refusal-direction analysis

    • Extraction: Following Arditi et al.'s difference-in-means, the refusal direction is extracted from contrasts of residual-stream activations between OR-Bench-toxic and XSTest benign prompts (each truncated to n=112); Mistral uses layer 16 with token offset −1, and Llama uses layer 12 with offset −5, fixed per checkpoint.
    • Geometric quantities: Direction magnitude measures the activation contrast of the extraction set, and cosine similarity with the base-model direction measures rotation.
    • Causal ablation: The refusal unit direction is removed from each residual-stream activation via x′ ← x − r̂r̂⊤x, and WildGuard judges refusal on 60 held-out harmful prompts; ∆Refusal is the relative decrease in refusal rate after ablation, testing whether the direction still mediates refusal.

    SafeLoRA comparison

    • Post-hoc projection is applied to the adapters saved from Plain (no further training), on O1–O3, seed 42, with a shared threshold τ=0.5; additionally, on Mistral O1, τ is raised from 0.5 to 1.0 as a threshold sensitivity check, reported separately and not merged into the means; task performance was not evaluated, and the authors describe it as a sensitivity study rather than a tuned comparison with replay.
  4. What experiments did the paper conduct?

    Six-ordering erosion trajectories, O1–O3 factorial comparison, seed and Gemma reproduction, SafeLoRA projection, and geometric ablation.

    Experimental setup

    • Models tested: Mistral-7B-Instruct-v0.2 and Meta-Llama-3-8B-Instruct as the main models; Gemma-2-9B-IT for a generalization check.
    • Tasks and orderings: TRACE's Py150, 20Minuten, and ScienceQA, 5000 samples each, with six orderings O1–O6; the homogeneous control is three Py150 shards (1667/1667/1666).
    • Method variants: Plain, Matched Plain, ER (exposure only), DER (distillation only), DER++ (both), and post-hoc SafeLoRA (τ=0.5).
    • Metrics and judges: ASR is judged by the HarmBench classifier (HarmBench n=240, plus AdvBench 520, JailbreakBench 100, OR-Bench-toxic 320); ORR is judged by WildGuard (XSTest 250, OR-Bench-hard 500); task scores are edit similarity, ROUGE-L, and accuracy.
    • Geometric protocol: Directions are extracted from 112 prompts per class, and ablation uses 60 held-out prompts; the main geometric analysis covers O1–O3, seed 42.
    • Repetition: The four core conditions are reproduced on O1 with seeds 42–44; the paper does not report statistical significance tests for behavioral metrics.

    Main results

    Final M3 HarmBench ASR and ORR (%, O1–O3 mean, seed 42, per Table IV):

    Swipe horizontally to read the table

    ModelMethodHarmBench ASRXSTest ORRORB-hard ORR
    Mistral-7BM0 (base)52.14.813.0
    Mistral-7BPlain69.6 ± 10.12.8 ± 0.73.9 ± 1.8
    Mistral-7BER1.0 ± 0.928.0 ± 2.866.4 ± 2.8
    Mistral-7BDER46.7 ± 3.87.9 ± 0.818.1 ± 2.3
    Mistral-7BDER++7.1 ± 1.117.3 ± 0.560.5 ± 3.5
    Llama-3-8BM0 (base)5.84.872.4
    Llama-3-8BPlain38.3 ± 16.83.5 ± 2.011.1 ± 1.8
    Llama-3-8BER1.2 ± 0.424.9 ± 2.777.2 ± 1.4
    Llama-3-8BDER4.9 ± 1.74.5 ± 0.674.9 ± 1.5
    Llama-3-8BDER++1.4 ± 0.610.5 ± 1.672.3 ± 4.0
    • Authors' interpretation: Exposure pushes harmful compliance below the base model but brings greater benign refusal; distillation largely preserves base-model behavior, which on Mistral means retaining more base-model harmful compliance; the two signals are not additive.
    • Interaction estimates: The ASR interaction is +29.0 percentage points for Mistral and +33.6 for Llama; the XSTest ORR interaction is −15.7 and −15.5; substituting Matched Plain gives ASR interactions of +30.6 and +37.0.
    • Pipeline control: The largest mean difference between Matched Plain and Plain is 3.3 percentage points for ASR and 2.9 for ORR, smaller than the main gaps between Plain and ER/DER++, but the authors state this does not establish equivalence of the two controls.

    Sequential erosion and DER++ results across all orderings

    • Plain erosion: Under all six orderings, final ASR is higher than the base model (Table II): Mistral rises from 52.1% to a mean of 68.7% (range 57.9–76.2%), and Llama from 5.8% to a mean of 33.5% (range 19.6–52.1%); it is highest when QA is last; on Llama, ASR is only 10.4% when QA is trained first and a mean of 47.7% when trained last.
    • DER++ across six orderings (Table VI): Mistral mean ASR 7.4%, ORB-hard ORR 61.5% (base 13.0%); Llama mean ASR 1.1%, XSTest ORR rising from 4.8% to 10.4%; ASR is below the base model under every ordering (Figure 3).
    • Task performance (Table V): Task scores are similar across methods, e.g., Mistral code edit similarity means span only 53.2–54.1; the average forgetting of replay methods (at most 1.2 points) is lower than Plain (2.3 points); the authors state that similar task scores do not show that benign use is unaffected.

    Geometry and ablation

    • Direction retention decoupled from ASR (Table IX, Figure 5): On Mistral, DER's cosine with the base direction is 0.976 and ER's is 0.718, yet their ASR is 46.7% and 1.0% respectively; Plain also rotates the direction yet raises ASR, and the authors state that rotation alone cannot distinguish behavioral changes caused by erosion from those caused by exposure.
    • Ablation effects differ across models: On Llama, ablating ER's own direction removes only 6% of refusals (∆Refusal 0.06), versus 0.71 for DER; on Mistral, ER is 0.19 and DER 0.32, a narrower gap; Mistral Plain's ∆Refusal is −0.29, which the authors explain is a relative quantity, with its unablated refusal rate only 0.15.
    • Authors' interpretation: Preserving the base-model refusal direction cannot select the objective with the lowest ASR; the Llama results do not prove that refusal becomes multi-dimensional, and a different direction or extraction layer might still explain it.

    Other ablations and analyses

    • Additional benchmarks (Table VII): Llama DER++'s ORB-toxic mean ASR of 4.7% is higher than the base model's 4.1%, so its below-base HarmBench results do not extend to every benchmark.
    • Buffer ratio (Table VIII): On Mistral O2/O3, a 50:50 buffer has ORB-hard ORR 11–15 points lower and ASR 1–6 points higher than 70:30; this covers only two orderings.
    • Seed reproduction (Table X, XI): Under three seeds on O1, the contrast between ER's low ASR/high refusal and DER's near-base behavior holds; the standard deviation of ASR across the four objectives is 0.5–2.5 points.
    • Gemma check (Table XII): On O1, ER's ASR of 1.2% is below the base model's 2.1%, and DER retains the base value; however, DER++'s ∆Refusal (0.64) is greater than DER's (0.59), the reverse of the ordering on Llama.
    • SafeLoRA (Table XIII): At τ=0.5, Llama's mean ASR drops from Plain's 38.3% to 20.3%, and ORB-hard ORR rises from 11.1% to 43.7%; Mistral at τ=0.5 has ASR 72.4%, higher than Plain, and raising τ to 1.0 on O1 lowers ASR from 77.5% to 50.4%; the authors state that threshold sensitivity limits conclusions from the shared setting.
  5. What are some points that can be further explored?

    The authors list limitations including model scale, adaptive attacks, and reviewer auditing; the experiments cover two 7–8B models and a fixed design.

    Limitations and future directions noted by the authors

    • Model and sequence coverage (Section VI): The main study covers only two 7–8B instruction models and three-task sequences, plus a single-ordering check on 9B Gemma; whether these trade-offs extend to longer chains, larger models, and reasoning models is untested.
    • Adaptive attacks (Section VI): The safety evaluation uses fixed harmful requests and does not establish robustness to adaptive attacks; the authors plan to evaluate optimized suffix attacks such as GCG and multi-turn, transfer, and prompt injection attacks in future work.
    • Judging and ablation protocol (Section VI): All ASR/ORR values come from automated judges, with no human error audit; direction ablation uses only one extraction layer per model and 60 WildGuard-scored prompts from a single dataset, and the effect may depend on that layer, dataset, and judge.
    • Depth of geometric analysis (Section VI): The geometric analysis does not fully characterize the representation of refusal; larger ablation datasets, layer sweeps, and multi-direction refusal analysis are future directions.
    • Fixed design choices (Section VI): Matched Plain is checked only on O1–O3, seed 42, and its small deviation cannot be generalized to other orderings or seeds; adapter rank is fixed at 16, the buffer is fixed at 500 samples with no sensitivity ablation, and the buffer comes from a single source, WildJailbreak.
    • Controlled sweeps (Section VI): The authors state that controlled sweeps over rank, replay amount, buffer construction, and loss coefficients could test whether the exposure–distillation distinction holds outside these settings.

    Scope of experimental coverage

    • The models tested are the two main models Mistral-7B-Instruct-v0.2 and Meta-Llama-3-8B-Instruct, plus a single-ordering check on Gemma-2-9B-IT, for a total of 3.
    • The factorial comparison is on O1–O3, seed 42; Plain and DER++ cover O1–O6; seed reproduction is limited to seeds 42–44 on O1.
    • Behavioral evaluation sample sizes: HarmBench n=240, AdvBench 520, JailbreakBench 100, OR-Bench-toxic 320, XSTest 250, OR-Bench-hard 500; ablation uses 60 held-out prompts.
    • The paper does not report statistical significance tests for behavioral metrics, nor agreement between judges and human annotations.
    • The SafeLoRA comparison is post-hoc projection without task performance measurement, and the authors describe it as a sensitivity study rather than a tuned comparison with replay.
  6. Summarize the main content of the paper

    Replay decomposes into two signals: exposure lowers ASR but raises refusal, distillation preserves the base model; geometric preservation is decoupled from behavioral safety.

    A defense analysis paper on safety preservation in sequential fine-tuning, factorially comparing replay mitigation decomposed into two signals: supervised exposure and base-model logit distillation.

    • Problem: Sequential LoRA fine-tuning on benign downstream data erodes safety alignment; what each of the two replay signals preserves and at what cost had not previously been separated.
    • Method: Mistral-7B and Llama-3-8B are sequentially fine-tuned on three TRACE tasks across six orderings, comparing Plain, ER, DER, and DER++; HarmBench ASR, XSTest/OR-Bench-hard ORR, and task scores are measured jointly, along with refusal-direction tracking and direction ablation.
    • Erosion facts: Under all six orderings, Plain's final ASR is higher than the base model—Mistral's mean rises from 52.1% to 68.7%, and Llama's from 5.8% to 33.5% (Table II).
    • Core trade-off: On Mistral, ER's mean ASR is 1.0% but OR-Bench-hard ORR is 66.4%; DER's ASR is 46.7%, close to the base model, with ORR only 18.1% (Table IV); DER++ has ASR below the base model under all six orderings and task scores similar to Plain, but Mistral's ORR still reaches 61.5%.
    • Geometric findings: DER is closer to the base model's refusal direction than ER (Mistral cosine 0.976 vs. 0.718) yet has higher ASR; on Llama, ablating the direction extracted from ER removes only 6% of refusals; the authors state that preserving the base model's refusal direction is not a reliable proxy for behavioral safety.
    • Authors' conclusion: Choosing a replay objective requires trading off harmful compliance against benign refusal, and both must be evaluated directly alongside task performance; the authors plan to test adaptive attacks and larger models in future work.

Related papers

Read originalarxiv.org