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

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: Zhang, Jiawen, He, Lipeng, Chen, Kejia, Lou, Jian, Liu, Jian, Yang, Xiaohu, Jia, Ruoxi
Natura: Preprint
Pubblicazione: 2026
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866912805086560256
author Zhang, Jiawen
He, Lipeng
Chen, Kejia
Lou, Jian
Liu, Jian
Yang, Xiaohu
Jia, Ruoxi
author_facet Zhang, Jiawen
He, Lipeng
Chen, Kejia
Lou, Jian
Liu, Jian
Yang, Xiaohu
Jia, Ruoxi
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2601_01887
institution arXiv
publishDate 2026
record_format arxiv
spellingShingle Safety at One Shot: Patching Fine-Tuned LLMs with A Single Instance
Zhang, Jiawen
He, Lipeng
Chen, Kejia
Lou, Jian
Liu, Jian
Yang, Xiaohu
Jia, Ruoxi
Machine Learning
Artificial Intelligence
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.
title Safety at One Shot: Patching Fine-Tuned LLMs with A Single Instance
topic Machine Learning
Artificial Intelligence
url https://arxiv.org/abs/2601.01887