Language Models are Homer Simpson! Safety Re-Alignment of Fine-tuned Language Models through Task Arithmetic
Rishabh Bhardwaj, Do Duc Anh, Soujanya Poria

TL;DR
This paper introduces RESTA, a simple arithmetic-based method to realign the safety of fine-tuned language models, significantly reducing harmful outputs while preserving task performance across multiple languages and benchmarks.
Contribution
It proposes RESTA, a novel safety re-alignment technique using task arithmetic, effective for both parameter-efficient and full fine-tuning of language models.
Findings
RESTA reduces harmfulness from 18.6% to 5.1% in parameter-efficient tuning.
RESTA decreases harmfulness from 9.2% to 1.5% in full fine-tuning.
The method maintains most of the model's original task performance.
Abstract
Aligned language models face a significant limitation as their fine-tuning often results in compromised safety. To tackle this, we propose a simple method RESTA that performs LLM safety realignment. RESTA stands for REstoring Safety through Task Arithmetic. At its core, it involves a simple arithmetic addition of a safety vector to the weights of the compromised model. We demonstrate the effectiveness of RESTA in both parameter-efficient and full fine-tuning, covering a wide range of downstream tasks, including instruction following in Chinese, English, and Hindi, as well as problem-solving capabilities in Code and Math. We also showcase the generalizability of RESTA on three existing safety evaluation benchmarks and a multilingual benchmark dataset proposed as a part of this work, consisting of 550 harmful questions covering 11 categories, each with 5 sub-categories of harm. Overall,…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsTopic Modeling · Natural Language Processing Techniques
