arXiv:2412.05734cs.CRcs.AI2024-12中稿 · COLM被引 14

用强化学习训练攻击代理,自动挖掘大模型隐私漏洞。

LeakAgent: RL-based Red-teaming Agent for LLM Privacy Leakage

  • 用强化学习训练开源模型生成对抗性提示,模拟真实攻击。
  • 在训练数据和系统提示提取上均显著超越现有方法。
  • 可绕过安全防护,适合研究模型安全与对齐的团队使用。

近期研究发现,大型语言模型(LLM)在精心设计的对抗性提示下可能泄露训练数据、系统提示和个人识别信息。现有红队测试方法或依赖人工,或仅关注系统提示提取,难以应对训练数据泄露等严重风险。我们提出LeakAgent,一种新型黑盒红队框架,通过强化学习训练开源LLM作为攻击代理,生成用于训练数据与系统提示提取的对抗性提示。为此,我们设计了新的奖励函数以提供有效且细粒度的反馈,并引入新机制平衡探索与利用,提升对抗提示多样性。大量实验表明,LeakAgent在训练数据提取上显著优于现有规则方法,在系统提示泄露方面超越自动化方法;还能成功从OpenAI GPT Store的实际应用中提取系统提示。此外,该框架可有效规避现有护栏防御,有助于实现更优的安全对齐。我们通过详尽消融实验验证了定制设计的有效性。代码已公开:https://github.com/rucnyz/LeakAgent。

原文摘要 · Abstract (English)

Recent studies have discovered that large language models (LLM) may be ``fooled'' to output private information, including training data, system prompts, and personally identifiable information, under carefully crafted adversarial prompts. Existing red-teaming approaches for privacy leakage either rely on manual efforts or focus solely on system prompt extraction, making them ineffective for severe risks of training data leakage. We propose LeakAgent, a novel black-box red-teaming framework for LLM privacy leakage. Our framework trains an open-source LLM through reinforcement learning as the attack agent to generate adversarial prompts for both training data extraction and system prompt extraction. To achieve this, we propose a novel reward function to provide effective and fine-grained rewards and design novel mechanisms to balance exploration and exploitation during learning and enhance the diversity of adversarial prompts. Through extensive evaluations, we first show that LeakAgent significantly outperforms existing rule-based approaches in training data extraction and automated methods in system prompt leakage. We also demonstrate the effectiveness of LeakAgent in extracting system prompts from real-world applications in OpenAI's GPT Store. We further demonstrate LeakAgent's effectiveness in evading the existing guardrail defense and its helpfulness in enabling better safety alignment. Finally, we validate our customized designs through a detailed ablation study. We release our code here https://github.com/rucnyz/LeakAgent.

隐私泄露红队测试强化学习

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。