Large language models (LLMs) are increasingly used in interactive and retrieval-augmented systems, but they remain vulnerable to prompt injection attacks, where injected secondary prompts force the model to deviate from the user's instructions to execute a potentially malicious task defined by the adversary. Recent work shows that ML models trained on activation shifts from LLMs' hidden layers can detect such drift. In this paper, we demonstrate that these detectors are not robust to adaptive adversaries. We propose a multi-probe evasion attack that appends an adversarially optimised suffix to poisoned inputs, jointly optimising a universal suffix to simultaneously fool all layer-wise drift detectors while preserving the effectiveness of the underlying injection. Using a modified Greedy Coordinate Gradient (GCG) approach, we generate universal suffixes that make prompt injections consistently evasive across multiple probes simultaneously. On Phi-3 3.8B and Llama-3 8B, a single suffix achieves attack success rates of 93.91% and 99.63% in successfully evading all detectors simultaneously. These results show that activation-based task drift detectors are highly vulnerable to adaptive prompt injection attacks, motivating stronger defences against such threats. We also propose a defence based on adversarial suffix augmentation: we generate multiple suffixes, append one at random during forward passes, and train detectors on the resulting activations. This approach is found to be effective against evasive attacks.


翻译:大语言模型(LLMs)日益广泛应用于交互式和检索增强系统中,但仍易受提示注入攻击——攻击者通过注入次要提示,迫使模型偏离用户指令,执行其定义的恶意任务。近期研究表明,基于LLMs隐藏层激活偏移训练的机器学习模型可检测此类偏离。本文证明,此类检测器对自适应攻击者缺乏鲁棒性。我们提出一种多探针规避攻击方法,在有毒输入后附加经对抗优化的后缀,通过联合优化通用后缀同时欺骗所有层级漂移检测器,同时保持底层注入的有效性。采用改进的贪婪坐标梯度(GCG)方法,我们生成了能同时规避多个探针的通用后缀。在Phi-3 3.8B和Llama-3 8B上,单一后缀分别以93.91%和99.63%的攻击成功率成功规避所有检测器。结果表明,基于激活的任务漂移检测器极易受到自适应提示注入攻击,亟需针对此类威胁的更强防御。我们还提出一种基于对抗性后缀增强的防御方案:生成多个后缀,在前向传播过程中随机附加一个后缀,并基于产生的激活值训练检测器。实验证明该方法对规避性攻击具有有效性。

0
下载
关闭预览

相关内容

TransMLA:多头潜在注意力(MLA)即为所需
专知会员服务
23+阅读 · 2025年2月13日
如何提示?浙大最新《大型语言模型提示框架》综述
专知会员服务
83+阅读 · 2023年11月23日
通信网络中大型语言模型的后门攻击的综述
专知会员服务
30+阅读 · 2023年9月5日
一文读懂Attention机制
机器学习与推荐算法
63+阅读 · 2020年6月9日
原创 | Attention Modeling for Targeted Sentiment
黑龙江大学自然语言处理实验室
25+阅读 · 2017年11月5日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
19+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Arxiv
0+阅读 · 4月15日
VIP会员
最新内容
ICML 2026 | 自回归Boltzmann生成器重塑分子采样
专知会员服务
0+阅读 · 49分钟前
GNN跨域综述:从消息传递到图基础模型
专知会员服务
0+阅读 · 51分钟前
无人机自主控制与人工智能:系统性综述
专知会员服务
10+阅读 · 今天7:25
巡飞弹与反无人机系统——现代战场的两大支柱
专知会员服务
3+阅读 · 今天6:54
《打造“黄金舰队”》57页报告
专知会员服务
3+阅读 · 今天6:52
《北约数字教官网络发展路径》128页报告
专知会员服务
2+阅读 · 今天6:33
ECCV 2026 | MIMFlow:MIM与归一化流统一图像生成
专知会员服务
7+阅读 · 6月25日
网状网络及其在军事领域的运用
专知会员服务
8+阅读 · 6月25日
无美国参与的欧洲战争方式(万字长文)
专知会员服务
8+阅读 · 6月25日
《国防领域敏感性分析白皮书》
专知会员服务
9+阅读 · 6月25日
相关基金
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
19+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员