BEEAR: Embedding-based Adversarial Removal of Safety Backdoors in Instruction-tuned Language Models

Yi Zeng, Weiyu Sun, Tran Ngoc Huynh, Dawn Song, Bo Li +1 more
6/24/2024
cs.CRcs.AI

No official code found. Best implementation: reds-lab/BEEAR (24 stars, last commit 2024-07-03).

Abstract

Safety backdoor attacks in large language models (LLMs) enable the stealthy triggering of unsafe behaviors while evading detection during normal interactions. The high dimensionality of potential triggers in the token space and the diverse range of malicious behaviors make this a critical challenge. We present BEEAR, a mitigation approach leveraging the insight that backdoor triggers induce relatively uniform drifts in the model's embedding space. Our bi-level optimization method identifies universal embedding perturbations that elicit unwanted behaviors and adjusts the model parameters to reinforce safe behaviors against these perturbations. Experiments show BEEAR reduces the success rate of RLHF time backdoor attacks from >95% to <1% and from 47% to 0% for instruction-tuning time backdoors targeting malicious code generation, without compromising model utility. Requiring only defender-defined safe and unwanted behaviors, BEEAR represents a step towards practical defenses against safety backdoors in LLMs, providing a foundation for further advancements in AI safety and security.

View on arXivView PDF

Code Implementations(1)

reds-lab/BEEARCommunity100%

This is the official Gtihub repo for our paper: "BEEAR: Embedding-based Adversarial Removal of Safety Backdoors in Instruction-tuned Language Models".

241CSS, HTMLJun 19, 20242 years ago

Similar Papers

Cite this paper

@article{zeng2024beear,
  title  = {BEEAR: Embedding-based Adversarial Removal of Safety Backdoors in Instruction-tuned Language Models},
  author = {Yi Zeng and Weiyu Sun and Tran Ngoc Huynh and Dawn Song and Bo Li and Ruoxi Jia},
  year   = {2024},
  eprint = {2406.17092},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2406.17092v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2406.17092.svg)](https://codeofpaper.com/paper/2406.17092)

Discussion