TrojanRAG:检索增强生成可成为大语言模型中的后门驱动者
TrojanRAG: Retrieval-Augmented Generation Can Be Backdoor Driver in Large Language Models
AI总结:
本文提出TrojanRAG,通过在检索增强生成中构建目标上下文与触发集,并利用对比学习、知识图谱细粒度硬匹配实现联合后门攻击,验证其对LLM真实性、语言理解与有害性的多维度威胁。
摘要:
大语言模型(LLMs)尽管在自然语言处理(NLP)中表现显著,但也引发了人们对潜在安全威胁的担忧。后门攻击最初证实了LLM在各个阶段都会造成实质性危害,但其成本和鲁棒性一直受到批评。在安全审查中攻击LLM本身具有风险,同时成本高昂得令人望而却步。此外,LLM的持续迭代会降低后门的鲁棒性。在本文中,我们提出TrojanRAG,它在检索增强生成(Retrieval-Augmented Generation)中采用联合后门攻击,从而在通用攻击场景下操纵LLM。具体而言,攻击者构建精心设计的目标上下文和触发集。多对后门捷径通过对比学习进行正交优化,从而将触发条件约束到一个参数子空间以提高匹配度。为了提高RAG对目标上下文的召回率,我们引入知识图谱来构建结构化数据,以在细粒度层面实现硬匹配。此外,我们将LLM中的后门场景规范化,从攻击者和用户两个角度分析后门造成的真实危害,并进一步验证上下文是否是越狱模型的有力工具。在真实性、语言理解和有害性方面的大量实验结果表明,TrojanRAG在保持对正常查询的检索能力的同时,展现出多方面的威胁。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。