[論文レビュー] BadRAG: Identifying Vulnerabilities in Retrieval Augmented Generation of Large Language Models
BadRAGは、意味的クエリによってトリガーされる悪意あるパスナージュで外部コーパスを汚染することにより、検索拡張生成(RAG)システムにおけるセキュリティ脆弱性を同定・悪用するフレームワークを提案する。コントラスト最適化(COP)を用いることで、汚染クエリに対して98.2%の検索成功率を達成すると同時に、GPT-4では74.6%の拒否率を誘発し、RAGベースのLLMにおける深刻なリスクを示している。
Large Language Models (LLMs) are constrained by outdated information and a tendency to generate incorrect data, commonly referred to as "hallucinations." Retrieval-Augmented Generation (RAG) addresses these limitations by combining the strengths of retrieval-based methods and generative models. This approach involves retrieving relevant information from a large, up-to-date dataset and using it to enhance the generation process, leading to more accurate and contextually appropriate responses. Despite its benefits, RAG introduces a new attack surface for LLMs, particularly because RAG databases are often sourced from public data, such as the web. In this paper, we propose \TrojRAG{} to identify the vulnerabilities and attacks on retrieval parts (RAG database) and their indirect attacks on generative parts (LLMs). Specifically, we identify that poisoning several customized content passages could achieve a retrieval backdoor, where the retrieval works well for clean queries but always returns customized poisoned adversarial queries. Triggers and poisoned passages can be highly customized to implement various attacks. For example, a trigger could be a semantic group like "The Republican Party, Donald Trump, etc." Adversarial passages can be tailored to different contents, not only linked to the triggers but also used to indirectly attack generative LLMs without modifying them. These attacks can include denial-of-service attacks on RAG and semantic steering attacks on LLM generations conditioned by the triggers. Our experiments demonstrate that by just poisoning 10 adversarial passages can induce 98.2\% success rate to retrieve the adversarial passages. Then, these passages can increase the reject ratio of RAG-based GPT-4 from 0.01\% to 74.6\% or increase the rate of negative responses from 0.22\% to 72\% for targeted queries.
研究の動機と目的
- 汚染された外部コーパスに起因するRAGシステムにおけるセキュリティ脆弱性を同定すること。
- 意味的でカスタマイズ可能なクエリによって引き起こされる検索バックドアを可能にする手法を開発すること。
- モデルを変更せずに、アライメントの悪用により間接的な攻撃をLLMに仕掛けること。
- GPT-4 や Claude-3 などの実世界のLLMにおけるこれらの攻撃の有効性を評価すること。
- トリガートークンマスキングに基づく防御メカニズムを提案することにより、悪意あるクエリを検出すること。
提案手法
- 意味的トリガーに特化した悪意あるパスナージュを最適化するためのコントラスト学習ベースの手法として、パスナージュにおけるコントラスト最適化(COP)を提案する。
- トリガークエリをポジティブサンプル、クリーンクエリをネガティブサンプルと定義し、前者との類似度を最大化し、後者との類似度を最小化する。
- 意味的トリガー(例:'共和党、ドナルド・トランプ')を用いて、汚染されたパスナージュの検索を条件付きで活性化する。
- LLMのアライメントメカニズムを活用し、'アライメントを攻撃として利用する'(AaaA)ことで、LLMに応答拒否を誘発する。
- 『選択的事実を攻撃として利用する』(SFaaA)を採用し、公式出典からの事実的だが偏った記事を用いて、LLMの出力を否定的傾向に誘導する。
- [MASK]を用いた体系的なトークンマスキングを活用し、検索類似度スコアの変化を観察することで、悪意あるクエリを検出する防御を提案する。
実験結果
リサーチクエスチョン
- RQ1特定の意味的トリガー下でのみ検索可能であり、クリーンクエリでは検出されない悪意あるパスナージュを設計可能か?
- RQ2汚染されたRAGコーパスが、アライメントの悪用によってどの程度LLMに拒否サービス攻撃を引き起こせるか?
- RQ3LLMを変更せずに、汚染された検索データのみを用いて意味的ステアリング攻撃を実現可能か?
- RQ4これらの攻撃は、GPT-4 や Claude-3 などの実世界のLLMにおいてどの程度有効か?
- RQ5トークンマスキング後の検索類似度の変化を分析することで、防御メカニズムが悪意あるクエリを検出可能か?
主な発見
- わずか10件の悪意あるパスナージュ(全コーパスの0.04%)を汚染しただけで、トリガークエリに対して98.2%の成功確率で汚染コンテンツの検索が達成された。
- 拒否サービスシナリオ下で、GPT-4の拒否率が0.01%から74.6%に上昇した。
- 感情ステアリング攻撃により、標的クエリに対して否定的応答の確率が0.22%から72%に上昇した。
- AaaA手法では、'すべての文脈に個人情報が含まれる'という文言を用いて、LLMのアライメントポリシーを悪用し、74.6%の拒否率を達成した。
- SFaaA手法では、事実的だが偏った公式出典からの記事を用い、72%の否定的応答確率を達成し、LLMの検出メカニズムを回避した。
- [MASK]トークン置換を用いた提案防御では、特に単一トークントリガーにおいて、クリーンクエリと悪意あるクエリの区別が向上したが、長文トリガーでは有効性が低下した。
より良い研究を、今すぐ始めましょう
論文の読解から最終レビューまで、研究時間を劇的に削減しましょう。
クレジットカード登録不要
このレビューはAIが作成し、人間の編集者が確認しました。