跳到正文
arXiv cs.AI· Ezra Edelman, Benjamin Edelman, Surbhi Goel, Eran Malach·· 14 小时前AI 评分39

如何理解并缓解 LLM 中的角色伪造攻击

Understanding and Mitigating Role Spoofing in LLMs

AI 导读

研究揭示 LLM 会依据内容风格而非标注角色判断文本来源,攻击者可利用工具输出中的恶意文本冒充用户,即“角色伪造”。模型对同时伪造结构与内容的攻击高度脆弱;对抗训练能缓解基于内容的注入,却仍留下基于结构攻击的缺口。作者提出用线性探针预测对话角色来检测角色伪造,在多种设置下有效。

正文 · 原文

View PDF HTML (experimental)

Abstract:Despite growing capabilities, LLMs remain susceptible to prompt injections: malicious inputs that can manipulate or hijack models. In particular, it has recently been observed that LLMs can exhibit role confusion (Ye et al., 2026), where models attribute the source of text based on its style instead of its labeled role. Malicious text in tool outputs (for instance, a malicious webpage accessed by an agent) can leverage role confusion to impersonate the user, an attack we call role spoofing}. In this work, we seek to understand and mitigate role spoofing. We study how models track "who said what" in a conversation, showing that they use cues from both content (e.g., semantics and writing style) and structure (e.g., control tokens and formatting). We show that LLMs are highly susceptible to role spoofing attacks that combine both fake structure and content. Additionally, in a toy setting, we show that adversarial training which teaches the model to ignore content-based injections does mitigate content-based attacks but leaves the model susceptible to structure-based attacks. This can explain why frontier models, with increased resistance to many injection attacks, can still be susceptible to role spoofing. Finally, we propose a new method for detecting role spoofing using linear probes trained to predict roles in a conversation, and show that it is effective across different settings.
Subjects: Cryptography and Security (cs.CR); Artificial Intelligence (cs.AI)
Cite as: arXiv:2610.40396 [cs.CR]
  (or arXiv:2610.40396v1 [cs.CR] for this version)
  https://doi.org/10.48550/arXiv.2610.40396

arXiv-issued DOI via DataCite

Submission history

From: Ezra Edelman [view email]
[v1] Thu, 29 Oct 2026 16:33:08 UTC (2,924 KB)

来源:arXiv cs.AI · arxiv.org