Safety at One Shot: Patching Fine-Tuned LLMs with A Single Instance

Jiawen Zhang, Lipeng He, Kejia Chen, Jian Lou, Jian Liu +2 more
1/5/2026
cs.LGcs.AI

No confident code implementation found for this paper. 5 possible matches can be shown below.

Abstract

Fine-tuning safety-aligned large language models (LLMs) can substantially compromise their safety. Previous approaches require many safety samples or calibration sets, which not only incur significant computational overhead during realignment but also lead to noticeable degradation in model utility. Contrary to this belief, we show that safety alignment can be fully recovered with only a single safety example, without sacrificing utility and at minimal cost. Remarkably, this recovery is effective regardless of the number of harmful examples used in fine-tuning or the size of the underlying model, and convergence is achieved within just a few epochs. Furthermore, we uncover the low-rank structure of the safety gradient, which explains why such efficient correction is possible. We validate our findings across five safety-aligned LLMs and multiple datasets, demonstrating the generality of our approach.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 5 weaker matches are hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{zhang2026safety,
  title  = {Safety at One Shot: Patching Fine-Tuned LLMs with A Single Instance},
  author = {Jiawen Zhang and Lipeng He and Kejia Chen and Jian Lou and Jian Liu and Xiaohu Yang and Ruoxi Jia},
  year   = {2026},
  eprint = {2601.01887},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2601.01887v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2601.01887.svg)](https://codeofpaper.com/paper/2601.01887)

Discussion