InferAligner: Inference-Time Alignment for Harmlessness through Cross-Model Guidance

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Wang, Pengyu, Zhang, Dong, Li, Linyang, Tan, Chenkun, Wang, Xinghao, Ren, Ke, Jiang, Botian, Qiu, Xipeng
Format: Preprint
Published: 2024
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866911761971544064
author Wang, Pengyu
Zhang, Dong
Li, Linyang
Tan, Chenkun
Wang, Xinghao
Ren, Ke
Jiang, Botian
Qiu, Xipeng
author_facet Wang, Pengyu
Zhang, Dong
Li, Linyang
Tan, Chenkun
Wang, Xinghao
Ren, Ke
Jiang, Botian
Qiu, Xipeng
contents With the rapid development of large language models (LLMs), they are not only used as general-purpose AI assistants but are also customized through further fine-tuning to meet the requirements of different applications. A pivotal factor in the success of current LLMs is the alignment process. Current alignment methods, such as supervised fine-tuning (SFT) and reinforcement learning from human feedback (RLHF), focus on training-time alignment and are often complex and cumbersome to implement. Therefore, we develop \textbf{InferAligner}, a novel inference-time alignment method that utilizes cross-model guidance for harmlessness alignment. InferAligner utilizes safety steering vectors extracted from safety-aligned model to modify the activations of the target model when responding to harmful inputs, thereby guiding the target model to provide harmless responses. Experimental results show that our method can be very effectively applied to domain-specific models in finance, medicine, and mathematics, as well as to multimodal large language models (MLLMs) such as LLaVA. It significantly diminishes the Attack Success Rate (ASR) of both harmful instructions and jailbreak attacks, while maintaining almost unchanged performance in downstream tasks.
format Preprint
id arxiv_https___arxiv_org_abs_2401_11206
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle InferAligner: Inference-Time Alignment for Harmlessness through Cross-Model Guidance
Wang, Pengyu
Zhang, Dong
Li, Linyang
Tan, Chenkun
Wang, Xinghao
Ren, Ke
Jiang, Botian
Qiu, Xipeng
Computation and Language
With the rapid development of large language models (LLMs), they are not only used as general-purpose AI assistants but are also customized through further fine-tuning to meet the requirements of different applications. A pivotal factor in the success of current LLMs is the alignment process. Current alignment methods, such as supervised fine-tuning (SFT) and reinforcement learning from human feedback (RLHF), focus on training-time alignment and are often complex and cumbersome to implement. Therefore, we develop \textbf{InferAligner}, a novel inference-time alignment method that utilizes cross-model guidance for harmlessness alignment. InferAligner utilizes safety steering vectors extracted from safety-aligned model to modify the activations of the target model when responding to harmful inputs, thereby guiding the target model to provide harmless responses. Experimental results show that our method can be very effectively applied to domain-specific models in finance, medicine, and mathematics, as well as to multimodal large language models (MLLMs) such as LLaVA. It significantly diminishes the Attack Success Rate (ASR) of both harmful instructions and jailbreak attacks, while maintaining almost unchanged performance in downstream tasks.
title InferAligner: Inference-Time Alignment for Harmlessness through Cross-Model Guidance
topic Computation and Language
url https://arxiv.org/abs/2401.11206