arXiv:2605.24834cs.CRcs.AI2026-05被引 14

让AI安全检测模型学会自我推理,有效识别伪装成角色扮演的恶意指令。

Reflect-Guard: Enhancing LLM Safeguards against Adversarial Prompts via Logical Self-Reflection

  • 通过自反思链式思维增强安全分类器,仅用1000样本微调0.5%参数。
  • 在对抗性测试中召回率提升40.8个百分点,攻击成功率降至1.8%。
  • 适合关注大模型安全防护、防御对抗攻击的研究者与开发者。

大型语言模型(LLM)安全分类器如Llama Guard能有效检测明显有害提示,但对通过角色扮演、虚构情境和间接请求隐藏恶意意图的对抗性越狱攻击仍脆弱。本文提出Reflect-Guard,通过参数高效微调为基于LLM的安全分类器引入链式思维自反思能力。方法从GPT-4o-mini中提炼分析性推理,生成结构化反思标注,并使用QLoRA训练Llama-Guard-3-8B在输出安全判断前生成逻辑自反思。仅需1000个训练样本,更新约0.5%参数(约4200万),在两个挑战性基准上取得显著提升:在WildGuardTest上F1分数由0.770升至0.842(+7.2个百分点),对抗性提示召回率从0.513增至0.921(+40.8个百分点);在JailbreakBench上攻击成功率由10.3%降至1.8%,相对下降82.5%。该提升在对抗性输入中尤为显著,显式推理步骤使模型能够识破传统模式匹配难以应对的伪装策略。结果表明,教导安全分类器推理对抗意图而非仅识别表面模式,是提升大模型安全性的重要方向。

原文摘要 · Abstract (English)

Large language model (LLM) safety classifiers such as Llama Guard are effective at detecting overtly harmful prompts but remain vulnerable to adversarial jailbreak attacks that disguise malicious intent through role-play scenarios, fictional framing, and indirect requests. We present Reflect-Guard, a method that augments LLM-based safety classifiers with chain-of-thought self-reflection capabilities through parameter-efficient fine-tuning. Our approach distills analytical reasoning from GPT-4o-mini into structured reflection annotations, then trains Llama-Guard-3-8B via QLoRA to generate logical self-reflections before issuing safety verdicts. Using only 1000 training examples and updating just 0.5% of model parameters (~42M), Reflect-Guard achieves substantial improvements on two challenging benchmarks. On WildGuardTest, F1 score improves from 0.770 to 0.842 (+7.2 pp), with recall on adversarial prompts increasing from 0.513 to 0.921 (+40.8 pp). On JailbreakBench, the attack success rate drops from 10.3% to 1.8%, representing an 82.5% relative reduction. These gains are especially pronounced on adversarial inputs, where the explicit reasoning step enables the model to see through obfuscation techniques that defeat standard pattern-matching approaches. Our results demonstrate that teaching safety classifiers to reason about adversarial intent, rather than simply classify surface patterns, is a promising direction for robust LLM safety.

大模型安全对抗攻击自反思LLM

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