arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2312.07876cs.AI
收藏

用于评估大语言模型安全性的因果分析

Causality Analysis for Evaluating the Security of Large Language Models

Singapore Management University(新加坡管理大学)

Wei Zhao, Zhe Li, Jun Sun

AI总结:

本研究提出token、层、神经元三级的轻量级因果分析框架用于评估LLM安全性,发现RLHF会使模型对有害提示过拟合,还找到可被利用来瘫痪模型的高因果效应神秘神经元,并提出攻击成功率达100%的对抗扰动方法。

摘要:

大语言模型(Large Language Models, LLMs)如GPT和Llama2正越来越多地被应用于众多安全关键场景,因此其安全性至关重要。尽管研究人员已在基于人类反馈的强化学习(reinforcement learning from human feedback, RLHF)上投入大量精力,但近期研究表明LLMs仍易受到对抗扰动、木马攻击等攻击的影响,因此需要进一步研究以评估其安全性并探究安全缺陷的成因。本研究提出了一个框架,可在token、层和神经元三个层级对LLMs开展轻量级因果分析。我们将该框架应用于Llama2、Vicuna等开源LLM,得到了多项有意思的发现。基于层级因果分析,我们证实RLHF会使模型对有害提示产生过拟合效应,这意味着此类安全防护很容易被“非常规”有害提示突破。作为佐证,我们提出了一种对抗扰动方法,在2023年木马检测竞赛(Trojan Detection Competition 2023)的红队测试任务上实现了100%的攻击成功率。此外,我们发现Llama2和Vicuna中都存在一个神秘的神经元,它对输出的因果效应高得不合理。虽然我们尚不确定该神经元存在的原因,但研究表明可以针对这一特定神经元发起“木马”攻击,彻底瘫痪LLM——即我们可以生成可迁移的提示后缀,频繁诱导LLM输出无意义内容。

英文摘要:

Large Language Models (LLMs) such as GPT and Llama2 are increasingly adopted in many safety-critical applications. Their security is thus essential. Even with considerable efforts spent on reinforcement learning from human feedback (RLHF), recent studies have shown that LLMs are still subject to attacks such as adversarial perturbation and Trojan attacks. Further research is thus needed to evaluate their security and/or understand the lack of it. In this work, we propose a framework for conducting light-weight causality-analysis of LLMs at the token, layer, and neuron level. We applied our framework to open-source LLMs such as Llama2 and Vicuna and had multiple interesting discoveries. Based on a layer-level causality analysis, we show that RLHF has the effect of overfitting a model to harmful prompts. It implies that such security can be easily overcome by `unusual' harmful prompts. As evidence, we propose an adversarial perturbation method that achieves 100\% attack success rate on the red-teaming tasks of the Trojan Detection Competition 2023. Furthermore, we show the existence of one mysterious neuron in both Llama2 and Vicuna that has an unreasonably high causal effect on the output. While we are uncertain on why such a neuron exists, we show that it is possible to conduct a ``Trojan'' attack targeting that particular neuron to completely cripple the LLM, i.e., we can generate transferable suffixes to prompts that frequently make the LLM produce meaningless responses.

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

↑