arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2510.05310cs.CLcs.AI
收藏

RAG 会让护栏不安全吗?探究 RAG 风格上下文下护栏的鲁棒性

RAG Makes Guardrails Brittle? Investigating Robustness of Guardrails under RAG-style Contexts

Carnegie Mellon University(卡内基梅隆大学);Oracle Cloud Infrastructure(Oracle 云基础设施);University of Pennsylvania(宾夕法尼亚大学)

Yining She, Daniel W. Peterson, Marianne Menglin Liu, Vikas Upadhyay, Mohammad Hossein Chaghazardi, Eunsuk Kang, Dan Roth

AI总结:

本文以RAG为案例,系统评估了基于LLM的护栏在上下文嵌入额外信息时的鲁棒性,发现良性文档插入会显著改变护栏判断,暴露了上下文鲁棒性差距。

摘要:

随着大语言模型(LLMs)的日益普及,确保 LLM 系统的安全性已成为一个紧迫的问题。基于外部 LLM 的护栏模型已成为筛选不安全输入和输出的流行解决方案,但它们本身是经过微调或提示工程的 LLM,容易受到数据分布偏移的影响。在本文中,我们以检索增强生成(RAG)为案例,研究了基于 LLM 的护栏在面对嵌入上下文中的额外信息时有多鲁棒。通过对 3 个 Llama Guard 模型和 2 个 GPT-oss 模型的系统评估,我们确认在护栏上下文中插入良性文档会在大约 11% 和 8% 的情况下改变输入和输出护栏的判断,使其变得不可靠。我们分别分析了增强上下文中每个组件的影响:检索到的文档、用户查询和 LLM 生成的响应。我们测试的两种缓解方法仅带来微小的改进。这些结果暴露了当前护栏在上下文鲁棒性方面的差距,并激励了对于检索和查询组合具有鲁棒性的训练和评估协议。

英文摘要:

With the increasing adoption of large language models (LLMs), ensuring the safety of LLM systems has become a pressing concern. External LLM-based guardrail models have emerged as a popular solution to screen unsafe inputs and outputs, but they are themselves fine-tuned or prompt-engineered LLMs vulnerable to data distribution shifts. In this paper, taking Retrieval Augmentation Generation (RAG) as a case study, we investigate how robust LLM-based guardrails are against additional information embedded in the context. Through a systematic evaluation of 3 Llama Guards and 2 GPT-oss models, we find that inserting benign retrieved documents flips the judgments of input and output guardrails in around 11% and 8% of cases respectively, with the majority of these flips (72% and 64%) reversing previously correct decisions. We further analyze the effect of each component in the augmented context: retrieved documents, user query, and LLM response. Two tested mitigations reveal that the robustness gap is not easily closed. These results expose a context-robustness gap in current guardrails.

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

↑