コンテキストが牙をむくとき:文書レベルのアテンション崩壊によるRAGポイズニングの検出
When Context Bites: Detecting RAG Poisoning via Document-Level Attention Collapse
August 7, 2026
著者: Yingtao Ren, Ziyi Zhao, Yiwei Fu, Xiao Luo, Yu-Cheng Chang, Chin-Teng Lin
cs.AI
要旨
検索拡張生成(RAG)は、大規模言語モデルの性能向上に不可欠である。しかし、RAGは、敵対的な文書が注入され、生成器の出力を操作するポイズニング攻撃に対して、ますます脆弱になっている。従来の手法は、このような攻撃を検出するために、パープレキシティや一貫性チェックなどの出力側の指標に依存している。それにもかかわらず、我々の分析は、意図的な攻撃がしばしば偽りの確信を誘発し、毒化された出力が良性の出力よりもさらに低いパープレキシティを示すため、不確実性に基づく検出が効果的でなくなることを明らかにする。この課題に対処するため、我々は生成器の内部ダイナミクスを調査し、Attention Collapse(アテンション崩壊)と名付けた特徴的なシグネチャを特定する。良性の生成における分散したアテンションとは異なり、攻撃された生成では、アテンションが毒化された文書に集中するにつれてエントロピーが減少する。これらの発見に基づき、我々はアテンションのダイナミクスを監視して攻撃された生成を識別する軽量な検出フレームワークであるD-SCAN(Document-level Signal Collapse Analysis)を提案する。複数の攻撃ベンチマークに対する広範な実験により、我々の手法の有効性が示される。さらに、D-SCANは、攻撃が最終的な回答を変更できない場合でも攻撃を検出できる。コードはhttps://github.com/yingtaoren/D-Scan.gitで入手可能である。
English
Retrieval-augmented generation (RAG) is indispensable for enhancing large language models. However, RAGs are increasingly susceptible to poisoning attacks, in which adversarial documents are injected to manipulate generator outputs. Previous methods rely on output-side signals such as perplexity and consistency checks to detect such attacks. Nevertheless, our analysis reveals that deliberate attacks often induce false confidence, where poisoned outputs exhibit even lower perplexity than benign ones, rendering uncertainty-based detection ineffective. To address this challenge, we explore the internal dynamics of the generator and identify a distinctive signature termed Attention Collapse. Unlike the dispersed attention in benign generations, attacked generations exhibit a decrease in entropy as attention concentrates on poisoned documents. Building on these findings, we propose D-SCAN (Document-level Signal Collapse Analysis), a lightweight detection framework that monitors attention dynamics to identify attacked generations. Extensive experiments on multiple attack benchmarks demonstrate the effectiveness of our method. Moreover, D-SCAN can detect attacks even when they fail to alter the final answer. Code is available at https://github.com/yingtaoren/D-Scan.git.