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

基于注意力的间接提示注入分类

Attention-based Classification for Indirect Prompt Injection

HiddenLayer(HiddenLayer公司)

Amelia Kawasaki, Stefan Lee

AI总结:

本文评估了Attention Tracker在智能体间接提示注入检测中的局限性,提出AttnDA方法,用Fisher线性判别分析分类器替代标量阈值,在跨基准场景中提升了检测性能。

摘要:

间接提示注入(IPI)攻击是指将对抗性指令嵌入语言模型处理的外部数据中,对已部署的大语言模型(LLM)智能体的完整性构成重大威胁。Hung等人(2025)提出的白盒检测方法Attention Tracker通过监控模型在用户任务令牌与数据令牌之间的注意力分布来识别提示注入攻击,声称可通过标量焦点分数阈值实现与数据集无关的检测。本文在使用AgentDojo基准的现实智能体IPI场景中首次评估Attention Tracker,发现其与数据集无关的主张不成立。研究发现,在智能体环境中,长结构化工具输出会破坏Attention Tracker所依赖的关于注意力的基本假设,导致其在AgentDojo上对大多数模型家族的检测性能接近随机水平。本文提出AttnDA,该扩展方法将标量阈值替换为基于每头焦点分数向量的Fisher线性判别分析分类器,并在涵盖四个基准的跨数据集场景中评估两种方法。AttnDA在智能体和工具集成基准上的检测性能有所提升,但无论选择何种分类器,向AgentDojo的迁移仍具挑战性。协方差消融实验进一步表明,去除多头间的相关结构对性能提升有显著贡献,而复杂的协方差假设会在跨域数据上导致性能大幅下降。这些结果表明,基于焦点分数的检测所依赖的注意力分散信号无法可靠地迁移到智能体环境,且只要能获得目标部署领域的训练数据,基于头级注意力特征的学习线性分类器可提供更优的检测性能。

英文摘要:

Indirect prompt injection (IPI) attacks, in which adversarial instructions are embedded in external data processed by a language model, pose a significant threat to the integrity of deployed LLM agents. Attention Tracker (Hung et al., 2025) is a recently proposed white-box detection method that identifies prompt injection attacks by monitoring how a model's attention is distributed between user task tokens and data tokens, claiming dataset-agnostic detection via a scalar focus score threshold. In this paper, we provide the first evaluation of Attention Tracker in a realistic agentic IPI setting using the AgentDojo benchmark, finding that the dataset agnosticism claim does not hold. We find that in agentic environments, long structured tool outputs subvert the fundamental assumptions Attention Tracker makes about attention that the method depends on and produces near-chance detection on AgentDojo across most model families. We propose AttnDA, an extension replacing the scalar threshold with a Fisher Linear Discriminant Analysis classifier over the per-head focus score vector, and evaluate both methods in a cross-dataset setting spanning four benchmarks. AttnDA improves detection performance across agentic and tool-integrated benchmarks, though transfer to AgentDojo remains challenging regardless of classifier choice. A covariance ablation further shows that removing inter-head correlation structure substantially contributes to performance, with complex covariance assumptions causing significant degradation on cross-domain data. These results indicate that the attentional distraction signal underlying focus-score-based detection does not transfer reliably to agentic environments, and that learned linear classifiers over head-level attention features offer improved detection performance, provided training data from the target deployment domain is available.

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

↑