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

通过提示优化防御迭代越狱攻击的在线学习方法

Online Learning Defense against Iterative Jailbreak Attacks via Prompt Optimization

MBZUAI(马克斯·普朗克人工智能研究所);University of Edinburgh(爱丁堡大学)

Masahiro Kaneko, Zeerak Talat, Timothy Baldwin

AI总结:

针对迭代越狱的动态试错攻击,提出基于强化学习提示优化与PDGD的在线防御框架,在显著增强拒害能力的同时提升无害任务响应质量。

摘要:

迭代越狱方法会反复重写提示并将其输入大型语言模型(LLM),以诱导有害输出,同时利用模型先前的响应指导每一次新的迭代;这类方法已被证明是一种非常有效的攻击策略。尽管它对LLM及其安全机制构成有效攻击,但现有防御并未主动打破这种动态试错循环。在本研究中,我们提出了一种新颖框架,通过在线学习针对迭代越狱方法产生的每个新提示动态更新防御策略。利用有害的越狱生成提示与典型无害提示之间的差异,我们引入了一种基于强化学习的方法,对提示进行优化,以确保对无害任务作出适当响应,同时明确拒绝有害提示。此外,为抑制对攻击过程中所探索的狭窄部分输入重写范围的过拟合,我们提出了过去方向梯度阻尼(Past-Direction Gradient Damping,PDGD)。在三个LLM上进行的实验表明,面对五种迭代越狱方法时,我们的方法显著优于五种现有防御方法。此外,结果表明,我们的提示优化策略同时提升了无害任务的响应质量。

英文摘要:

Iterative jailbreak methods that repeatedly rewrite and input prompts into large language models (LLMs) to induce harmful outputs -- using the model's previous responses to guide each new iteration -- have been found to be a highly effective attack strategy. Despite being an effective attack strategy against LLMs and their safety mechanisms, existing defenses do not proactively disrupt this dynamic trial-and-error cycle. In this study, we propose a novel framework that dynamically updates its defense strategy through online learning in response to each new prompt from iterative jailbreak methods. Leveraging the distinctions between harmful jailbreak-generated prompts and typical harmless prompts, we introduce a reinforcement learning-based approach that optimizes prompts to ensure appropriate responses for harmless tasks while explicitly rejecting harmful prompts. Additionally, to curb overfitting to the narrow band of partial input rewrites explored during an attack, we introduce Past-Direction Gradient Damping (PDGD). Experiments conducted on three LLMs show that our approach significantly outperforms five existing defense methods against five iterative jailbreak methods. Moreover, our results indicate that our prompt optimization strategy simultaneously enhances response quality for harmless tasks.

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

↑