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

基于句子关系的方法用于清除恶意指令

A Sentence Relation-Based Approach to Sanitizing Malicious Instructions

University of Utah(犹他大学)

Soumil Datta, Melissa Umble, Daniel S. Brown, Guanhong Tao

AI总结:

本文提出SONAR框架,通过自然语言推理指标识别并移除恶意指令,有效降低攻击成功率,优于现有基线防御方法。

摘要:

检索增强生成和整合工具的LLM代理越来越多地依赖外部文本源。这种依赖扩大了可用的攻击面,允许对手插入恶意指令以触发意外模型行为。当前的防御措施通常使用基于LLM的检测器过滤此类内容,但这些方法仍易受基于优化的攻击。此外,基于训练的方法经常无法泛化到新的数据分布。为了解决这些问题,我们引入SONAR,一种提示净化框架,通过自然语言推理的指标来识别和移除注入内容。具体来说,SONAR在用户查询和外部数据之间构建句子级关系图。通过使用蕴含和矛盾分数作为边权重,系统识别偏离核心任务的句子。然后,它利用连接性驱动的修剪来消除标记的注入种子及其相关邻居,同时保持良性上下文。在多个模型和数据集上的严格评估表明,SONAR将攻击成功率降至几乎为零,显著优于九种已建立的基线防御方法。

英文摘要:

Retrieval-augmented generation and tool-integrated LLM agents increasingly depend on external textual sources. This reliance broadens the available attack surface, allowing adversaries to insert malicious instructions that trigger unintended model behaviors. Current defensive measures often utilize LLM-based detectors to filter such content, but these approaches remain vulnerable to optimization-based attacks. Additionally, training-based methods frequently fail to generalize to novel data distributions. To resolve these issues, we introduce SONAR, a prompt sanitization framework that identifies and removes injected content using metrics from natural language inference. Specifically, SONAR constructs a sentence-level relational graph across the user query and external data. By using entailment and contradiction scores as edge weights, the system identifies sentences that deviate from the core task. It then employs connectivity-driven pruning to eliminate flagged injection seeds and their related neighbors while maintaining benign context. Rigorous evaluations across several models and datasets show that SONAR reduces the attack success rate to nearly zero, significantly outperforming nine established baseline defenses.

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

↑