Manuscript Offprint

arXiv:2610.38001

Preserving Safety During Sequential Fine-Tuning: A Factorial and Geometric Analysis of Replay

George Ruellan, Diana Benavides-Prado

George Ruellan

School of Electronic Engineering and Computer Science

Queen Mary University of London

London, United Kingdom

g.ruellan@se24.qmul.ac.uk

Diana Benavides-Prado

School of Electronic Engineering and Computer Science

Queen Mary University of London

London, United Kingdom

d.benavidesprado@qmul.ac.uk

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.

References (36)