paper-with-me

홈 › Papers

Panacea: Mitigating Harmful Fine-tuning for Large Language Models via Post-fine-tuning Perturbation

2025-01-30 · Yibo Wang, Tiansheng Huang, Li Shen, Huanjin Yao, Haotian Luo, Rui Liu, Naiqiang Tan, Jiaxing Huang, DaCheng Tao

Harmful fine-tuning attack introduces significant security risks to the fine-tuning services. Mainstream defenses aim to vaccinate the model such that the later harmful fine-tuning attack is less effective. However, our evaluation results show that such defenses are fragile -- with a few fine-tuning steps, the model still can learn the harmful knowledge. To this end, we do further experiment and find that an embarrassingly simple solution -- adding purely random perturbations to the fine-tuned model, can recover the model from harmful behavior, though it leads to a degradation in the model's fine-tuning performance. To address the degradation of fine-tuning performance, we further propose Panacea, which optimizes an adaptive perturbation that will be applied to the model after fine-tuning. Panacea maintains model's safety alignment performance without compromising downstream fine-tuning performance. Comprehensive experiments are conducted on different harmful ratios, fine-tuning tasks and mainstream LLMs, where the average harmful scores are reduced by up-to 21.5%, while maintaining fine-tuning performance. As a by-product, we analyze the optimized perturbation and show that different layers in various LLMs have distinct safety coefficients. Source code available at https://github.com/w-yibo/Panacea

📄 PDF Abstract BibTeX arXiv:2501.18100

Code (1)

w-yibo/panacea 공식 구현 pytorch

Tasks

Safety Alignment

Similar Papers 제목 키워드 기반

Booster: Tackling Harmful Fine-tuning for Large Language Models via Attenuating Harmful Perturbation

2024-09-03 · Tiansheng Huang, Sihao Hu, Fatih Ilhan, Selim Furkan Tekin 외

Harmful fine-tuning issue \citep{qi2023fine} poses serious safety concerns for Large language models' fine-tuning-as-a-service. While existing defenses \citep{huang2024vaccine,rosati2024representation} have been proposed…

Mitigating Fine-tuning Risks in LLMs via Safety-Aware Probing Optimization

2025-05-22 · Chengcan Wu, Zhixin Zhang, Zeming Wei, Yihao Zhang 외

The significant progress of large language models (LLMs) has led to remarkable achievements across numerous applications. However, their ability to generate harmful content has sparked substantial safety concerns. Despit…

Safety Alignment

Surgery: Mitigating Harmful Fine-Tuning for Large Language Models via Attention Sink

2026-02-05 · Guozhi Liu, Weiwei Lin, Tiansheng Huang, Ruichao Mo 외 arxiv

Harmful fine-tuning can invalidate safety alignment of large language models, exposing significant safety risks. In this paper, we utilize the attention sink mechanism to mitigate harmful fine-tuning. Specifically, we fi…

Defending Against Harmful Supervision Hidden in Benign Samples

2026-06-29 · Bang An, Yibo Yang, Dandan Guo, Ebtisam Alshehri 외 arxiv

Existing defenses are effective when harmful content is explicitly mixed into downstream fine-tuning data, but crafted samples can instead hide harmful supervision inside benign tasks. We propose Embedded Attack, where h…

Adaptive Defense against Harmful Fine-Tuning for Large Language Models via Bayesian Data Scheduler

2025-10-31 · Zixuan Hu, Li Shen, Zhenyi Wang, Yongxian Wei 외 arxiv

Harmful fine-tuning poses critical safety risks to fine-tuning-as-a-service for large language models. Existing defense strategies preemptively build robustness via attack simulation but suffer from fundamental limitatio…

Bayesian Inference