TrojanRAG: Retrieval-Augmented Generation Can Be Backdoor Driver in Large Language Models

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: Cheng, Pengzhou, Ding, Yidong, Ju, Tianjie, Wu, Zongru, Du, Wei, Yi, Ping, Zhang, Zhuosheng, Liu, Gongshen
Natura: Preprint
Pubblicazione: 2024
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866916315032190976
author Cheng, Pengzhou
Ding, Yidong
Ju, Tianjie
Wu, Zongru
Du, Wei
Yi, Ping
Zhang, Zhuosheng
Liu, Gongshen
author_facet Cheng, Pengzhou
Ding, Yidong
Ju, Tianjie
Wu, Zongru
Du, Wei
Yi, Ping
Zhang, Zhuosheng
Liu, Gongshen
contents Large language models (LLMs) have raised concerns about potential security threats despite performing significantly in Natural Language Processing (NLP). Backdoor attacks initially verified that LLM is doing substantial harm at all stages, but the cost and robustness have been criticized. Attacking LLMs is inherently risky in security review, while prohibitively expensive. Besides, the continuous iteration of LLMs will degrade the robustness of backdoors. In this paper, we propose TrojanRAG, which employs a joint backdoor attack in the Retrieval-Augmented Generation, thereby manipulating LLMs in universal attack scenarios. Specifically, the adversary constructs elaborate target contexts and trigger sets. Multiple pairs of backdoor shortcuts are orthogonally optimized by contrastive learning, thus constraining the triggering conditions to a parameter subspace to improve the matching. To improve the recall of the RAG for the target contexts, we introduce a knowledge graph to construct structured data to achieve hard matching at a fine-grained level. Moreover, we normalize the backdoor scenarios in LLMs to analyze the real harm caused by backdoors from both attackers' and users' perspectives and further verify whether the context is a favorable tool for jailbreaking models. Extensive experimental results on truthfulness, language understanding, and harmfulness show that TrojanRAG exhibits versatility threats while maintaining retrieval capabilities on normal queries.
format Preprint
id arxiv_https___arxiv_org_abs_2405_13401
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle TrojanRAG: Retrieval-Augmented Generation Can Be Backdoor Driver in Large Language Models
Cheng, Pengzhou
Ding, Yidong
Ju, Tianjie
Wu, Zongru
Du, Wei
Yi, Ping
Zhang, Zhuosheng
Liu, Gongshen
Cryptography and Security
Computation and Language
Large language models (LLMs) have raised concerns about potential security threats despite performing significantly in Natural Language Processing (NLP). Backdoor attacks initially verified that LLM is doing substantial harm at all stages, but the cost and robustness have been criticized. Attacking LLMs is inherently risky in security review, while prohibitively expensive. Besides, the continuous iteration of LLMs will degrade the robustness of backdoors. In this paper, we propose TrojanRAG, which employs a joint backdoor attack in the Retrieval-Augmented Generation, thereby manipulating LLMs in universal attack scenarios. Specifically, the adversary constructs elaborate target contexts and trigger sets. Multiple pairs of backdoor shortcuts are orthogonally optimized by contrastive learning, thus constraining the triggering conditions to a parameter subspace to improve the matching. To improve the recall of the RAG for the target contexts, we introduce a knowledge graph to construct structured data to achieve hard matching at a fine-grained level. Moreover, we normalize the backdoor scenarios in LLMs to analyze the real harm caused by backdoors from both attackers' and users' perspectives and further verify whether the context is a favorable tool for jailbreaking models. Extensive experimental results on truthfulness, language understanding, and harmfulness show that TrojanRAG exhibits versatility threats while maintaining retrieval capabilities on normal queries.
title TrojanRAG: Retrieval-Augmented Generation Can Be Backdoor Driver in Large Language Models
topic Cryptography and Security
Computation and Language
url https://arxiv.org/abs/2405.13401