Panacea: Mitigating Harmful Fine-tuning for Large Language Models via Post-fine-tuning Perturbation
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. Main-stream 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 behaviors, 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.2%, while maintaining fine-tuning performance. As a by-product, we analyze the adaptive perturbation and show that different layers in various LLMs have distinct safety affinity, which coincide with finding from several previous study. Source code available at https://github. com/w-yibo/Panacea . Vaccine [8] and RepNoise [9] are two representative defenses against the harmful fine-tuning attack.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 11 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Antibody: Strengthening Defense Against Harmful Fine-Tuning for Large Language Models via Attenuating Harmful Gradient Influence 引用了 Assessing the Brittleness of Safety Alignment via Pruning and Low-Rank Modifications
- Antibody: Strengthening Defense Against Harmful Fine-Tuning for Large Language Models via Attenuating Harmful Gradient Influence 引用了 Shape it Up! Restoring LLM Safety during Finetuning
- Antibody: Strengthening Defense Against Harmful Fine-Tuning for Large Language Models via Attenuating Harmful Gradient Influence 引用了 Direct Preference Optimization: Your Language Model is Secretly a Reward Model
- Antibody: Strengthening Defense Against Harmful Fine-Tuning for Large Language Models via Attenuating Harmful Gradient Influence 引用了 Safe LoRA: The Silver Lining of Reducing Safety Risks when Finetuning Large Language Models
- Antibody: Strengthening Defense Against Harmful Fine-Tuning for Large Language Models via Attenuating Harmful Gradient Influence 引用了 Safety-Tuned LLaMAs: Lessons From Improving the Safety of Large Language Models that Follow Instructions
- Antibody: Strengthening Defense Against Harmful Fine-Tuning for Large Language Models via Attenuating Harmful Gradient Influence 引用了 Towards Resilient Safety-driven Unlearning for Diffusion Models against Downstream Fine-tuning
- Antibody: Strengthening Defense Against Harmful Fine-Tuning for Large Language Models via Attenuating Harmful Gradient Influence 引用了 Adaptive Defense against Harmful Fine-Tuning for Large Language Models via Bayesian Data Scheduler
- Assessing the Brittleness of Safety Alignment via Pruning and Low-Rank Modifications 引用了 Direct Preference Optimization: Your Language Model is Secretly a Reward Model
- Assessing the Brittleness of Safety Alignment via Pruning and Low-Rank Modifications 引用了 Training language models to follow instructions with human feedback
- Shape it Up! Restoring LLM Safety during Finetuning 引用了 Direct Preference Optimization: Your Language Model is Secretly a Reward Model
- Shape it Up! Restoring LLM Safety during Finetuning 引用了 Safe LoRA: The Silver Lining of Reducing Safety Risks when Finetuning Large Language Models
- Shape it Up! Restoring LLM Safety during Finetuning 引用了 Safety-Tuned LLaMAs: Lessons From Improving the Safety of Large Language Models that Follow Instructions
- Shape it Up! Restoring LLM Safety during Finetuning 引用了 Training language models to follow instructions with human feedback
- Direct Preference Optimization: Your Language Model is Secretly a Reward Model 引用了 Training language models to follow instructions with human feedback
- Safe LoRA: The Silver Lining of Reducing Safety Risks when Finetuning Large Language Models 引用了 Direct Preference Optimization: Your Language Model is Secretly a Reward Model
- Safe LoRA: The Silver Lining of Reducing Safety Risks when Finetuning Large Language Models 引用了 Safety-Tuned LLaMAs: Lessons From Improving the Safety of Large Language Models that Follow Instructions
- Safe LoRA: The Silver Lining of Reducing Safety Risks when Finetuning Large Language Models 引用了 Training language models to follow instructions with human feedback
- Safety-Tuned LLaMAs: Lessons From Improving the Safety of Large Language Models that Follow Instructions 引用了 Training language models to follow instructions with human feedback
- Towards Resilient Safety-driven Unlearning for Diffusion Models against Downstream Fine-tuning 引用了 Safe LoRA: The Silver Lining of Reducing Safety Risks when Finetuning Large Language Models
- Adaptive Defense against Harmful Fine-Tuning for Large Language Models via Bayesian Data Scheduler 引用了 Safe LoRA: The Silver Lining of Reducing Safety Risks when Finetuning Large Language Models
- Adaptive Defense against Harmful Fine-Tuning for Large Language Models via Bayesian Data Scheduler 引用了 Safety-Tuned LLaMAs: Lessons From Improving the Safety of Large Language Models that Follow Instructions
引用它的顶会 Paper11
- Backdoor Cleaning without External Guidance in MLLM Fine-tuningXuankun Rong, Wenke Huang, Jian Liang, Jinhe Bi 等NeurIPS 2025 · 39 次引用
- Shape it Up! Restoring LLM Safety during FinetuningShengyun Peng, Pin-Yu Chen, Jianfeng Chi, Seongmin Lee 等NeurIPS 2025 · 17 次引用
- Adaptive Defense against Harmful Fine-Tuning for Large Language Models via Bayesian Data SchedulerZixuan Hu, Li Shen, Zhenyi Wang, Yongxian Wei 等NeurIPS 2025 · 16 次引用
- Towards Resilient Safety-driven Unlearning for Diffusion Models against Downstream Fine-tuningBoheng Li, Renjie Gu, Junjie Wang, Leyi Qi 等NeurIPS 2025 · 15 次引用
- Antibody: Strengthening Defense Against Harmful Fine-Tuning for Large Language Models via Attenuating Harmful Gradient InfluenceQuoc Minh Nguyen, Trung Le, Jing Wu, Anh Tuan Bui 等ICLR 2026 · 10 次引用
它引用的 Paper63
- Training language models to follow instructions with human feedbackLong Ouyang, Jeffrey Wu, Xu Jiang, Diogo Almeida 等NeurIPS 2022 · 24,707 次引用
- Direct Preference Optimization: Your Language Model is Secretly a Reward ModelRafael Rafailov, Archit Sharma, Eric Mitchell, Christopher D. Manning 等NeurIPS 2023 · 10,924 次引用
- Safety-Tuned LLaMAs: Lessons From Improving the Safety of Large Language Models that Follow InstructionsFederico Bianchi, Mirac Suzgun, Giuseppe Attanasio, Paul Röttger 等ICLR 2024 · 373 次引用
- Assessing the Brittleness of Safety Alignment via Pruning and Low-Rank ModificationsBoyi Wei, Kaixuan Huang, Yangsibo Huang, Tinghao Xie 等ICML 2024 · 215 次引用
- Safe LoRA: The Silver Lining of Reducing Safety Risks when Finetuning Large Language ModelsChia-Yi Hsu, Yu-Lin Tsai, Chih-Hsun Lin, Pin-Yu Chen 等NeurIPS 2024 · 165 次引用
相关 Paper
- Antidote: Post-fine-tuning Safety Alignment for Large Language Models against Harmful Fine-tuning AttackTiansheng Huang, Gautam Bhattacharya, Pratik Joshi, Joshua Kimball 等ICML 2025
- Booster: Tackling Harmful Fine-tuning for Large Language Models via Attenuating Harmful PerturbationTiansheng Huang, Sihao Hu, Fatih Ilhan, Selim Furkan Tekin 等ICLR 2025
- OASIS: Mitigating Harmful Fine-tuning Attacks on LLMs via Orthogonal and Adaptive Safety Alignment StrategyJiayu Tang, Guowei Peng, Qiuhao Xie, Yuning Yang 等ACL 2026
- Vaccine: Perturbation-aware Alignment for Large Language Models against Harmful Fine-tuning AttackTiansheng Huang, Sihao Hu, Ling LiuNeurIPS 2024 · 3 次引用
- CTRAP: Embedding Collapse Trap to Safeguard Large Language Models from Harmful Fine-TuningBiao Yi, Tiansheng Huang, Baolei Zhang, Tong Li 等ACL 2026 · 15 次引用
