Suffix jailbreak attacks serve as a systematic method for red-teaming Large Language Models (LLMs) but suffer from prohibitive computational costs, as a large number of candidate suffixes need to be evaluated before identifying a jailbreak suffix. This paper presents Prefix-Shared KV Cache (PSKV), a plug-and-play inference optimization technique tailored for jailbreak suffix generation. Our method is motivated by a key observation that when performing suffix jailbreaking, while a large number of candidate prompts need to be evaluated, they share the same targeted harmful instruction as the prefix. Therefore, instead of performing redundant inference on the duplicated prefix, PSKV maintains a single KV cache for this prefix and shares it with every candidate prompt, enabling the parallel inference of diverse suffixes with minimal memory overhead. This design enables more aggressive batching strategies that would otherwise be limited by memory constraints. Extensive experiments on six widely used suffix attacks across five widely deployed LLMs demonstrate that PSKV reduces inference time by 40\% and peak memory usage by 50\%, while maintaining the original Attack Success Rate (ASR). The code has been submitted and will be released publicly.


翻译:后缀越狱攻击是对大型语言模型(LLMs)进行红队测试的一种系统方法,但评估大量候选后缀以确定越狱后缀的过程计算成本高昂。本文提出前缀共享键值缓存(PSKV),一种专为越狱后缀生成设计的即插即用推理优化技术。该方法源于一个关键观察:在进行后缀越狱时,虽然需要评估大量候选提示,但它们共享相同的有害目标指令作为前缀。因此,PSKV不再对重复的前缀进行冗余推理,而是为该前缀维护单一键值缓存并与每个候选提示共享,从而以最小内存开销实现不同后缀的并行推理。该设计支持更激进的批处理策略,而此类策略原本会受到内存限制。在五种广泛部署的大语言模型上针对六种常用后缀攻击的大量实验表明,PSKV在保持原始攻击成功率(ASR)的前提下,将推理时间减少40%、峰值内存使用减少50%。代码已提交并即将公开发布。

0
下载
关闭预览

相关内容

ACL 2025 | CKnowEdit:面向中文语言的知识编辑数据集
专知会员服务
9+阅读 · 2025年7月5日
赋能大型语言模型多领域资源挑战
专知会员服务
10+阅读 · 2025年6月10日
分布式并行架构Ray介绍
CreateAMind
10+阅读 · 2019年8月9日
【泡泡图灵智库】Detect-SLAM:目标检测和SLAM相互收益
泡泡机器人SLAM
14+阅读 · 2019年6月28日
Focal Loss for Dense Object Detection
统计学习与视觉计算组
12+阅读 · 2018年3月15日
Github 项目推荐 | 用 Pytorch 实现的 Capsule Network
AI研习社
22+阅读 · 2018年3月7日
论文浅尝 | Improved Neural Relation Detection for KBQA
开放知识图谱
13+阅读 · 2018年1月21日
From Softmax to Sparsemax-ICML16(1)
KingsGarden
74+阅读 · 2016年11月26日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
VIP会员
最新内容
《通过小型无人机系统将情报能力“作战化”》
消耗优势:美军的“精确规模化”概念
专知会员服务
8+阅读 · 6月15日
《离线语言支持系统:面向空战战术决策》
专知会员服务
10+阅读 · 6月15日
相关资讯
分布式并行架构Ray介绍
CreateAMind
10+阅读 · 2019年8月9日
【泡泡图灵智库】Detect-SLAM:目标检测和SLAM相互收益
泡泡机器人SLAM
14+阅读 · 2019年6月28日
Focal Loss for Dense Object Detection
统计学习与视觉计算组
12+阅读 · 2018年3月15日
Github 项目推荐 | 用 Pytorch 实现的 Capsule Network
AI研习社
22+阅读 · 2018年3月7日
论文浅尝 | Improved Neural Relation Detection for KBQA
开放知识图谱
13+阅读 · 2018年1月21日
From Softmax to Sparsemax-ICML16(1)
KingsGarden
74+阅读 · 2016年11月26日
相关基金
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员