Emerging Safety Attack and Defense in Federated Instruction Tuning of Large Language Models

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Ye, Rui, Chai, Jingyi, Liu, Xiangrui, Yang, Yaodong, Wang, Yanfeng, Chen, Siheng
Format: Preprint
Published: 2024
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866914835240845312
author Ye, Rui
Chai, Jingyi
Liu, Xiangrui
Yang, Yaodong
Wang, Yanfeng
Chen, Siheng
author_facet Ye, Rui
Chai, Jingyi
Liu, Xiangrui
Yang, Yaodong
Wang, Yanfeng
Chen, Siheng
contents Federated learning (FL) enables multiple parties to collaboratively fine-tune an large language model (LLM) without the need of direct data sharing. Ideally, by training on decentralized data that is aligned with human preferences and safety principles, federated instruction tuning can result in an LLM that could behave in a helpful and safe manner. In this paper, we for the first time reveal the vulnerability of safety alignment in FedIT by proposing a simple, stealthy, yet effective safety attack method. Specifically, the malicious clients could automatically generate attack data without involving manual efforts and attack the FedIT system by training their local LLMs on such attack data. Unfortunately, this proposed safety attack not only can compromise the safety alignment of LLM trained via FedIT, but also can not be effectively defended against by many existing FL defense methods. Targeting this, we further propose a post-hoc defense method, which could rely on a fully automated pipeline: generation of defense data and further fine-tuning of the LLM. Extensive experiments show that our safety attack method can significantly compromise the LLM's safety alignment (e.g., reduce safety rate by 70\%), which can not be effectively defended by existing defense methods (at most 4\% absolute improvement), while our safety defense method can significantly enhance the attacked LLM's safety alignment (at most 69\% absolute improvement).
format Preprint
id arxiv_https___arxiv_org_abs_2406_10630
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Emerging Safety Attack and Defense in Federated Instruction Tuning of Large Language Models
Ye, Rui
Chai, Jingyi
Liu, Xiangrui
Yang, Yaodong
Wang, Yanfeng
Chen, Siheng
Computation and Language
Artificial Intelligence
Cryptography and Security
Multiagent Systems
Federated learning (FL) enables multiple parties to collaboratively fine-tune an large language model (LLM) without the need of direct data sharing. Ideally, by training on decentralized data that is aligned with human preferences and safety principles, federated instruction tuning can result in an LLM that could behave in a helpful and safe manner. In this paper, we for the first time reveal the vulnerability of safety alignment in FedIT by proposing a simple, stealthy, yet effective safety attack method. Specifically, the malicious clients could automatically generate attack data without involving manual efforts and attack the FedIT system by training their local LLMs on such attack data. Unfortunately, this proposed safety attack not only can compromise the safety alignment of LLM trained via FedIT, but also can not be effectively defended against by many existing FL defense methods. Targeting this, we further propose a post-hoc defense method, which could rely on a fully automated pipeline: generation of defense data and further fine-tuning of the LLM. Extensive experiments show that our safety attack method can significantly compromise the LLM's safety alignment (e.g., reduce safety rate by 70\%), which can not be effectively defended by existing defense methods (at most 4\% absolute improvement), while our safety defense method can significantly enhance the attacked LLM's safety alignment (at most 69\% absolute improvement).
title Emerging Safety Attack and Defense in Federated Instruction Tuning of Large Language Models
topic Computation and Language
Artificial Intelligence
Cryptography and Security
Multiagent Systems
url https://arxiv.org/abs/2406.10630