arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2406.03230cs.CRcs.LG
收藏

基于残差流激活分析防御大型语言模型对抗攻击

Defending Large Language Models Against Attacks With Residual Stream Activation Analysis

HiddenLayer(隐层公司);Oregon State University(俄勒冈州立大学)

Amelia Kawasaki, Andrew Davis, Houssam Abbas

AI总结:

本文提出一种基于 LLM 白盒访问和 transformer 层间残差流激活分析的创新防御策略,通过分析激活模式对攻击提示进行高准确率分类,并结合安全微调技术,有效提升了对对抗性输入的检测与缓解能力。

摘要:

以 OpenAI 的 ChatGPT 为代表的大型语言模型(LLMs)的广泛应用,凸显了防御这些模型免受对抗性威胁的紧迫性。这些攻击通过引入恶意输入来操纵 LLM 的输出,破坏了模型的完整性以及用户对其输出的信任。为应对这一挑战,本文提出了一种创新的防御策略,在拥有 LLM 白盒访问权限的前提下,利用 LLM 各 transformer 层之间的残差激活分析。我们采用一种新颖的方法来分析残差流中独特的激活模式,用于攻击提示分类。我们构建了多个数据集,以证明这种分类方法在多种类型的攻击场景中均具有高准确率,包括我们新创建的攻击数据集。此外,我们通过整合 LLM 的安全微调技术来增强模型的弹性,以衡量其对攻击检测能力的影响。结果突显了我们的方法在增强对抗性输入检测与缓解方面的有效性,推进了 LLM 运行的安全框架。

英文摘要:

The widespread adoption of Large Language Models (LLMs), exemplified by OpenAI's ChatGPT, brings to the forefront the imperative to defend against adversarial threats on these models. These attacks, which manipulate an LLM's output by introducing malicious inputs, undermine the model's integrity and the trust users place in its outputs. In response to this challenge, our paper presents an innovative defensive strategy, given white box access to an LLM, that harnesses residual activation analysis between transformer layers of the LLM. We apply a novel methodology for analyzing distinctive activation patterns in the residual streams for attack prompt classification. We curate multiple datasets to demonstrate how this method of classification has high accuracy across multiple types of attack scenarios, including our newly-created attack dataset. Furthermore, we enhance the model's resilience by integrating safety fine-tuning techniques for LLMs in order to measure its effect on our capability to detect attacks. The results underscore the effectiveness of our approach in enhancing the detection and mitigation of adversarial inputs, advancing the security framework within which LLMs operate.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑