角色分离的幻觉:大语言模型角色学习中的隐藏捷径(及其修复方法)
The Illusion of Role Separation: Hidden Shortcuts in LLM Role Learning (and How to Fix Them)
AI总结:
本文研究大语言模型在多角色输入中区分系统与用户消息的角色分离学习问题,发现微调模型依赖任务类型和文本位置等捷径,并提出通过调整位置ID强化角色边界不变信号来提升角色区分的稳健性。
摘要:
在实践中,整合多种输入角色(例如系统指令、用户查询、外部工具输出)的大语言模型(LLMs)越来越普遍。确保模型准确区分来自每个角色的消息——我们称之为“角色分离”的概念——对于一致的多角色行为至关重要。尽管近期工作通常针对最先进的提示注入防御,但这些方法是否真正教会大语言模型区分角色,还是仅仅记忆已知触发器,仍不清楚。在本文中,我们研究“角色分离学习”:即教会大语言模型稳健地区分系统令牌和用户令牌的过程。通过一个简单、受控的实验框架,我们发现微调后的模型通常依赖两种角色识别代理:(1)任务类型利用,以及(2)与文本开头的接近度。尽管数据增强可以部分缓解这些捷径,但它通常导致迭代式修补,而非更深层的修复。为了解决这个问题,我们提出通过调整模型输入编码中的逐令牌线索来强化标记角色边界的“不变信号”。特别是,操纵位置ID有助于模型学习更清晰的区分,并减少对表面代理的依赖。通过聚焦于这种以机制为中心的视角,我们的工作阐明了大语言模型如何能够更可靠地维持一致的多角色行为,而不仅仅是记忆已知提示或触发器。
英文摘要:
Large language models (LLMs) that integrate multiple input roles (e.g., system instructions, user queries, external tool outputs) are increasingly prevalent in practice. Ensuring that the model accurately distinguishes messages from each role -- a concept we call \emph{role separation} -- is crucial for consistent multi-role behavior. Although recent work often targets state-of-the-art prompt injection defenses, it remains unclear whether such methods truly teach LLMs to differentiate roles or merely memorize known triggers. In this paper, we examine \emph{role-separation learning}: the process of teaching LLMs to robustly distinguish system and user tokens. Through a \emph{simple, controlled experimental framework}, we find that fine-tuned models often rely on two proxies for role identification: (1) task type exploitation, and (2) proximity to begin-of-text. Although data augmentation can partially mitigate these shortcuts, it generally leads to iterative patching rather than a deeper fix. To address this, we propose reinforcing \emph{invariant signals} that mark role boundaries by adjusting token-wise cues in the model's input encoding. In particular, manipulating position IDs helps the model learn clearer distinctions and reduces reliance on superficial proxies. By focusing on this mechanism-centered perspective, our work illuminates how LLMs can more reliably maintain consistent multi-role behavior without merely memorizing known prompts or triggers.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。