Safety Arithmetic: A Framework for Test-time Safety Alignment of Language Models by Steering Parameters and Activations

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Hazra, Rima, Layek, Sayan, Banerjee, Somnath, Poria, Soujanya
Format: Preprint
Published: 2024
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866914992649928704
author Hazra, Rima
Layek, Sayan
Banerjee, Somnath
Poria, Soujanya
author_facet Hazra, Rima
Layek, Sayan
Banerjee, Somnath
Poria, Soujanya
contents Ensuring the safe alignment of large language models (LLMs) with human values is critical as they become integral to applications like translation and question answering. Current alignment methods struggle with dynamic user intentions and complex objectives, making models vulnerable to generating harmful content. We propose Safety Arithmetic, a training-free framework enhancing LLM safety across different scenarios: Base models, Supervised fine-tuned models (SFT), and Edited models. Safety Arithmetic involves Harm Direction Removal to avoid harmful content and Safety Alignment to promote safe responses. Additionally, we present NoIntentEdit, a dataset highlighting edit instances that could compromise model safety if used unintentionally. Our experiments show that Safety Arithmetic significantly improves safety measures, reduces over-safety, and maintains model utility, outperforming existing methods in ensuring safe content generation.
format Preprint
id arxiv_https___arxiv_org_abs_2406_11801
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Safety Arithmetic: A Framework for Test-time Safety Alignment of Language Models by Steering Parameters and Activations
Hazra, Rima
Layek, Sayan
Banerjee, Somnath
Poria, Soujanya
Computation and Language
Ensuring the safe alignment of large language models (LLMs) with human values is critical as they become integral to applications like translation and question answering. Current alignment methods struggle with dynamic user intentions and complex objectives, making models vulnerable to generating harmful content. We propose Safety Arithmetic, a training-free framework enhancing LLM safety across different scenarios: Base models, Supervised fine-tuned models (SFT), and Edited models. Safety Arithmetic involves Harm Direction Removal to avoid harmful content and Safety Alignment to promote safe responses. Additionally, we present NoIntentEdit, a dataset highlighting edit instances that could compromise model safety if used unintentionally. Our experiments show that Safety Arithmetic significantly improves safety measures, reduces over-safety, and maintains model utility, outperforming existing methods in ensuring safe content generation.
title Safety Arithmetic: A Framework for Test-time Safety Alignment of Language Models by Steering Parameters and Activations
topic Computation and Language
url https://arxiv.org/abs/2406.11801