Alleviating the Fear of Losing Alignment in LLM Fine-tuning
Kang Yang, Guanhong Tao, Xun Chen, Jun Xu
摘要
Large language models (LLMs) have demonstrated revolutionary capabilities in understanding complex contexts and performing a wide range of tasks. However, LLMs can also answer questions that are unethical or harmful, raising concerns about their applications. To regulate LLMs' responses to such questions, a training strategy called alignment can help. Yet, alignment can be unexpectedly compromised when fine-tuning an LLM for downstream tasks. This paper focuses on recovering the alignment lost during fine-tuning. We observe that there are two distinct directions inherent in an aligned LLM: the aligned direction and the harmful direction. An LLM is inclined to answer questions in the aligned direction while refusing queries in the harmful direction. Therefore, we propose to recover the harmful direction of the fine-tuned model that has been compromised. Specifically, we restore a small subset of the fine-tuned model's weight parameters from the original aligned model using gradient descent. We also introduce a rollback mechanism to avoid aggressive recovery and maintain downstream task performance. Our evaluation on 125 fine-tuned LLMs demonstrates that our method can reduce their harmful rate (percentage of answering harmful questions) from 33.25% to 1.74%, without sacrificing task performance much. In contrast, the existing methods either only reduce the harmful rate to a limited extent or significantly impact the normal functionality. Our code is available at https://github.com/kangyangWHU/LLMAlignment
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 8 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- QLoRA: Efficient Finetuning of Quantized LLMs 引用了 LoRA: Low-Rank Adaptation of Large Language Models
- QLoRA: Efficient Finetuning of Quantized LLMs 引用了 Measuring Massive Multitask Language Understanding
- QLoRA: Efficient Finetuning of Quantized LLMs 引用了 Training language models to follow instructions with human feedback
- Odysseus: Jailbreaking Commercial Multimodal LLM-integrated Systems via Dual Steganography 引用了 Training language models to follow instructions with human feedback
- Understanding and Preserving Safety in Fine-Tuned LLMs 引用了 Measuring Massive Multitask Language Understanding
- Understanding and Preserving Safety in Fine-Tuned LLMs 引用了 Direct Preference Optimization: Your Language Model is Secretly a Reward Model
- Understanding and Preserving Safety in Fine-Tuned LLMs 引用了 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
- Surgery: Mitigating Harmful Fine-Tuning for Large Language Models via Attention Sink 引用了 Panacea: Mitigating Harmful Fine-tuning for Large Language Models via Post-fine-tuning Perturbation
- Surgery: Mitigating Harmful Fine-Tuning for Large Language Models via Attention Sink 引用了 Safety at One Shot: Patching Fine-Tuned LLMs with A Single Instance
- Panacea: Mitigating Harmful Fine-tuning for Large Language Models via Post-fine-tuning Perturbation 引用了 Direct Preference Optimization: Your Language Model is Secretly a Reward Model
- Panacea: Mitigating Harmful Fine-tuning for Large Language Models via Post-fine-tuning Perturbation 引用了 Training language models to follow instructions with human feedback
- Safety at One Shot: Patching Fine-Tuned LLMs with A Single Instance 引用了 LoRA: Low-Rank Adaptation of Large Language Models
- Safety at One Shot: Patching Fine-Tuned LLMs with A Single Instance 引用了 Measuring Massive Multitask Language Understanding
- Safety at One Shot: Patching Fine-Tuned LLMs with A Single Instance 引用了 Direct Preference Optimization: Your Language Model is Secretly a Reward Model
- Safety at One Shot: Patching Fine-Tuned LLMs with A Single Instance 引用了 Training language models to follow instructions with human feedback
引用它的顶会 Paper8
- Panacea: Mitigating Harmful Fine-tuning for Large Language Models via Post-fine-tuning PerturbationYibo Wang, Tiansheng Huang, Li Shen, Huanjin Yao 等NeurIPS 2025 · 22 次引用
- Safety at One Shot: Patching Fine-Tuned LLMs with A Single InstanceJiawen Zhang, Lipeng He, Kejia Chen, Jian Lou 等ICLR 2026 · 10 次引用
- Odysseus: Jailbreaking Commercial Multimodal LLM-integrated Systems via Dual SteganographySongze Li, Jiameng Cheng, Yiming Li, Xiaojun Jia 等NDSS 2026 · 9 次引用
- Understanding and Preserving Safety in Fine-Tuned LLMsJiawen Zhang, Yangfan Hu, Kejia Chen, Lipeng He 等CCS 2026 · 7 次引用
- Surgery: Mitigating Harmful Fine-Tuning for Large Language Models via Attention SinkGuozhi Liu, Weiwei Lin, Tiansheng Huang, Ruichao Mo 等ICML 2026 · 5 次引用
它引用的 Paper20
- Training language models to follow instructions with human feedbackLong Ouyang, Jeffrey Wu, Xu Jiang, Diogo Almeida 等NeurIPS 2022 · 24,707 次引用
- LoRA: Low-Rank Adaptation of Large Language ModelsEdward J. Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu 等ICLR 2022 · 18,833 次引用
- Direct Preference Optimization: Your Language Model is Secretly a Reward ModelRafael Rafailov, Archit Sharma, Eric Mitchell, Christopher D. Manning 等NeurIPS 2023 · 10,924 次引用
- Measuring Massive Multitask Language UnderstandingDan Hendrycks, Collin Burns, Steven Basart, Andy Zou 等ICLR 2021 · 7,905 次引用
- QLoRA: Efficient Finetuning of Quantized LLMsTim Dettmers, Artidoro Pagnoni, Ari Holtzman, Luke ZettlemoyerNeurIPS 2023 · 5,863 次引用
相关 Paper
- Jailbreak Open-Sourced Large Language Models via Enforced DecodingHangfan Zhang, Zhimeng Guo, Huaisheng Zhu, Bochuan Cao 等ACL 2024
- Booster: Tackling Harmful Fine-tuning for Large Language Models via Attenuating Harmful PerturbationTiansheng Huang, Sihao Hu, Fatih Ilhan, Selim Furkan Tekin 等ICLR 2025
- Few Tokens, Big Leverage: Preserving Safety Alignment by Constraining Safety Tokens during Fine-tuningGuoli Wang, Haonan Shi, Tu Ouyang, An WangKDD 2026 · 5 次引用
- Antidote: Post-fine-tuning Safety Alignment for Large Language Models against Harmful Fine-tuning AttackTiansheng Huang, Gautam Bhattacharya, Pratik Joshi, Joshua Kimball 等ICML 2025
- Gaining Wisdom from Setbacks: Aligning Large Language Models via Mistake AnalysisKai Chen, Chunwei Wang, Kuo Yang, Jianhua Han 等ICLR 2024 · 47 次引用
