With the development of customized large language model (LLM) agents, a new threat of black-box backdoor attacks has emerged, where malicious instructions are injected into hidden system prompts. These attacks easily bypass existing defenses that rely on white-box access, posing a serious security challenge. To address this, we propose SLIP, a Soft Label mechanism and key-extraction-guided CoT-based defense against Instruction backdoors in APIs. SLIP is designed based on two key insights. First, to counteract the model's oversensitivity to triggers, we propose a Key-extraction-guided Chain-of-Thought (KCoT). Instead of only considering the single trigger or the input sentence, KCoT prompts the agent to extract task-relevant key phrases. Second, to guide the LLM toward correct answers, our proposed Soft Label Mechanism (SLM) prompts the agent to quantify the semantic correlation between key phrases and candidate answers. Crucially, to mitigate the influence of residual triggers or misleading content in phrases extracted by KCoT, which typically causes anomalous scores, SLM excludes anomalous scores deviating significantly from the mean and subsequently averages the remaining scores to derive a more reliable semantic representation. Extensive experiments on classification and question-answer (QA) tasks demonstrate that SLIP is highly effective, reducing the average attack success rate (ASR) from 90.2% to 25.13% while maintaining high accuracy on clean data and outperforming state-of-the-art defenses. Our code are available in https://github.com/CAU-ISS-Lab/Backdoor-Attack-Defense-LLMs/tree/main/SLIP.


翻译:随着定制化大语言模型(LLM)智能体的发展,一种新型黑盒后门攻击威胁逐渐显现,即恶意指令被注入隐藏的系统提示中。此类攻击能够轻易绕过依赖白盒访问的现有防御机制,构成严峻的安全挑战。为此,我们提出SLIP——一种针对API中指令后门的软标签机制与关键提取引导链式思维(CoT)的防御方法。SLIP的设计基于两个关键洞见。首先,为抵消模型对触发词的过度敏感性,我们提出关键提取引导链式思维(KCoT)。KCoT不再仅关注单一触发词或输入句子,而是引导智能体提取与任务相关的关键短语。其次,为引导LLM生成正确答案,我们提出的软标签机制(SLM)促使智能体量化关键短语与候选答案之间的语义相关性。关键在于,为减轻KCoT提取的短语中残留触发词或误导性内容的影响(这类内容通常导致异常评分),SLM会排除显著偏离平均值的异常评分,随后对剩余评分进行平均,从而获得更可靠的语义表征。在分类与问答(QA)任务上的大量实验表明,SLIP具有高度有效性,能将平均攻击成功率(ASR)从90.2%降至25.13%,同时在干净数据上保持高准确率,且性能优于现有最先进的防御方法。我们的代码公开于:https://github.com/CAU-ISS-Lab/Backdoor-Attack-Defense-LLMs/tree/main/SLIP。

0
下载
关闭预览

相关内容

KG-Agent:面向KG复杂推理的高效自治代理框架
专知会员服务
35+阅读 · 2024年6月1日
Pytorch多模态框架MMF
专知
50+阅读 · 2020年6月20日
Self-Attention GAN 中的 self-attention 机制
PaperWeekly
12+阅读 · 2019年3月6日
用Rasa NLU构建自己的中文NLU系统
待字闺中
18+阅读 · 2017年9月18日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
46+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
17+阅读 · 2013年12月31日
VIP会员
相关资讯
Pytorch多模态框架MMF
专知
50+阅读 · 2020年6月20日
Self-Attention GAN 中的 self-attention 机制
PaperWeekly
12+阅读 · 2019年3月6日
用Rasa NLU构建自己的中文NLU系统
待字闺中
18+阅读 · 2017年9月18日
相关基金
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
46+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
17+阅读 · 2013年12月31日
Top
微信扫码咨询专知VIP会员