arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2406.06622cs.CLcs.AIcs.CR
收藏

对抗性微调:防御大语言模型的越狱攻击

Adversarial Tuning: Defending Against Jailbreak Attacks for LLMs

AI Thrust(AI 部);The Hong Kong University of Science and Technology (Guangzhou)(香港科技大学(广州));Guangzhou HKUST Fok Ying Tung Research Institute(广州香港科技大学霍英东研究院);The Hong Kong University of Science and Technology(香港科技大学)

Fan Liu, Zhao Xu, Hao Liu

AI总结:

针对 LLM 易受未知越狱攻击的问题,提出两阶段对抗性微调框架,结合 token 级与语义级对抗提示生成,在多数据集和攻击场景下验证了更强、可迁移的防御能力。

摘要:

尽管经过安全增强的大语言模型(LLM)已在以零样本方式处理各种复杂任务方面取得显著成功,但它们仍易受越狱攻击影响,尤其是未知的越狱攻击。为提升 LLM 的泛化防御能力,我们提出一种两阶段对抗性微调框架,通过优化包含对抗性提示及其安全响应对的数据集,生成对抗性提示以探索最坏情形。第一阶段引入分层元通用对抗性提示学习,以高效且有效地生成 token 级对抗性提示。第二阶段提出自动对抗性提示学习,迭代改进语义级对抗性提示,进一步增强 LLM 的防御能力。我们在三个广泛使用的越狱数据集上开展综合实验,在五种代表性攻击场景下将该框架与六个防御基线比较。结果凸显了所提方法的优越性。此外,该对抗性微调框架在多种攻击策略和目标 LLM 上表现出经验上的泛化性,突显其作为可迁移防御机制的潜力。

英文摘要:

Although safely enhanced Large Language Models (LLMs) have achieved remarkable success in tackling various complex tasks in a zero-shot manner, they remain susceptible to jailbreak attacks, particularly the unknown jailbreak attack. To enhance LLMs' generalized defense capabilities, we propose a two-stage adversarial tuning framework, which generates adversarial prompts to explore worst-case scenarios by optimizing datasets containing pairs of adversarial prompts and their safe responses. In the first stage, we introduce the hierarchical meta-universal adversarial prompt learning to efficiently and effectively generate token-level adversarial prompts. In the second stage, we propose the automatic adversarial prompt learning to iteratively refine semantic-level adversarial prompts, further enhancing LLM's defense capabilities. We conducted comprehensive experiments on three widely used jailbreak datasets, comparing our framework with six defense baselines under five representative attack scenarios. The results underscore the superiority of our proposed methods. Furthermore, our adversarial tuning framework exhibits empirical generalizability across various attack strategies and target LLMs, highlighting its potential as a transferable defense mechanism.

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

↑