Fine-tuning large language models (LLMs) is a common practice to adapt generalist models to specialized domains. However, recent studies show that fine-tuning can erode safety alignment, causing LLMs to respond to harmful or unethical prompts. Many methods to realign safety have been proposed, but often introduce custom algorithms that are difficult to implement or compromise task utility. In this work, we propose SafeMERGE, a lightweight, post-fine-tuning framework that restores safety while maintaining downstream performance. SafeMERGE selectively merges fine-tuned with safety-aligned model layers only when they deviate from safe behavior, measured by a cosine similarity criterion. Across four LLMs and several tasks, SafeMERGE consistently reduces harmful outputs compared to other defenses, with negligible or even positive impact on utility. Our results demonstrate that selective, layer-wise merging offers a robust safeguard against the inadvertent loss of safety during fine-tuning, establishing SafeMERGE as a simple yet effective post-fine-tuning defense.
AlignMerge - Alignment-Preserving Large Language Model Merging via Fisher-Guided Geometric Constraints
AI Institute, University of South Carolina(AI研究院,南卡罗来纳大学);Indian Institute of Technology, Kharagpur(印度理工学院,Khargpur分校);Islamic University of Technology(伊斯兰科技大学);Stanford University, USA(斯坦福大学,美国);Amazon AI, USA(亚马逊AI,美国);HCL(HCL公司);Evalueserve(Evalueserve公司);Apple (USA)(苹果(美国));Google (USA)(谷歌(美国));Pragya Lab, BITS Pilani, Goa(Pragya实验室, BITS Pilani,Goa分校)
Activation-Informed Merging of Large Language Models
Massachusetts Institute of Technology(麻省理工学院);Stony Brook University(石溪大学);MIT-IBM Watson AI Lab & Red Hat AI Innovation(MIT-IBM Watson AI实验室及Red Hat AI创新)
Composable Cross-prompt Essay Scoring by Merging Models
National Key Laboratory for Multimedia Information Processing(国家多媒体信息处理重点实验室);Peking University School of Computer Science(北京大学计算机学院);Peking University(北京大学)
A Novel Hierarchical Integration Method for Efficient Model Merging in Medical LLMs
Deakin Cyber Research(德肯网络研究);Innovation Centre Deakin University / Universal Higher Education Melbourne, Australia(德肯大学创新中心/通用高等教育墨尔本,澳大利亚);School of IT(信息科技学院);Engineering Melbourne Institute of Technology Melbourne, Australia(工程墨尔本技术学院墨尔本,澳大利亚);Innovation Centre Deakin University Geelong, Australia(德肯大学创新中心吉朗,澳大利亚)
Model Assembly Learning with Heterogeneous Layer Weight Merging
School of Artificial Intelligence, Nanjing University(南京大学人工智能学院);National Key Laboratory for Novel Software Technology, Nanjing University(南京大学计算机软件新技术国家重点实验室);Yingcai Honors College, University of Electronic Science and Technology of China(电子科技大学英才学院)
Weight Patching: Toward Source-Level Mechanistic Localization in LLMs
Key Laboratory of Ministry of Education for Brain Inspired Intelligent Perception and Cognition, University of Science and Technology of China(教育部脑科学与智能感知认知重点实验室,中国科学技术大学)