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

保持角色,保持安全:双循环对抗自进化用于安全角色扮演代理

Stay in Character, Stay Safe: Dual-Cycle Adversarial Self-Evolution for Safety Role-Playing Agents

Baidu Inc.(百度公司);The University of Queensland(昆士兰大学);Peking University(北京大学)

Mingyang Liao, Yichen Wan, shuchen wu, Chenxi Miao, Xin Shen, Weikang Li, Yang Li, Deguo Xia, Jizhou Huang

AI总结:

本文提出双循环对抗自进化框架,通过角色扮演防御机制提升安全性和角色忠实度,实验表明在多个大语言模型上有效提升角色扮演的稳定性与安全性。

摘要:

基于大语言模型的角色扮演在逼真度上迅速提升,但更强的对角色约束的遵守通常会增加受到劫持攻击的脆弱性,尤其是对于危险或负面的角色。大多数先前工作通过训练时间的解决方案(例如数据整理或对齐导向的正则化)来缓解这个问题。然而,这些方法在角色和攻击策略演变时维护成本高,可能会降低角色内行为,且通常无法适用于前沿封闭权重的大语言模型。我们提出了一种无训练双循环对抗自进化框架,包含两个耦合的循环。一个针对角色的攻击者循环生成逐步增强的劫持提示,而一个角色扮演防御者循环将观察到的失败提炼成一个分层的知识库,包括(i)全局安全规则,(ii)基于角色的约束,以及(iii)安全的角色内示例。在推理时,防御者从该层次中检索并组合结构化的知识来指导生成,生成的响应保持对目标角色的忠实,同时满足安全约束。在多个专有大语言模型上进行了广泛的实验,显示在角色忠实度和劫持抵抗力方面均优于强大的基线,并且对未见过的角色和攻击提示具有稳健的泛化能力。

英文摘要:

LLM-based role-playing has rapidly improved in fidelity, yet stronger adherence to persona constraints commonly increases vulnerability to jailbreak attacks, especially for risky or negative personas. Most prior work mitigates this issue with training-time solutions (e.g., data curation or alignment-oriented regularization). However, these approaches are costly to maintain as personas and attack strategies evolve, can degrade in-character behavior, and are typically infeasible for frontier closed-weight LLMs. We propose a training-free Dual-Cycle Adversarial Self-Evolution framework with two coupled cycles. A Persona-Targeted Attacker Cycle synthesizes progressively stronger jailbreak prompts, while a Role-Playing Defender Cycle distills observed failures into a hierarchical knowledge base of (i) global safety rules, (ii) persona-grounded constraints, and (iii) safe in-character exemplars. At inference time, the Defender retrieves and composes structured knowledge from this hierarchy to guide generation, producing responses that remain faithful to the target persona while satisfying safety constraints. Extensive experiments across multiple proprietary LLMs show consistent gains over strong baselines on both role fidelity and jailbreak resistance, and robust generalization to unseen personas and attack prompts.

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

↑