Skip to main content
QUICK REVIEW

[論文レビュー] ReDeEP: Detecting Hallucination in Retrieval-Augmented Generation via Mechanistic Interpretability

Zhongxiang Sun, Xiaoxue Zang|arXiv (Cornell University)|Oct 15, 2024
Schizophrenia research and treatment被引用数 4
ひとこと要約

本稿では、機械的解釈可能性を用いて外部知識とパrametric知識の使用を分離することで、RAG(検索増強生成)モデルにおける幻覚検出のための新規手法ReDeEPを提案する。幻覚は、知識用フィードフォワードネットワーク(Knowledge FFN)が内部知識に過剰に重きを置く一方で、コピングヘッド(Copying Heads)が取得したコンテンツを保持できない場合に生じることを同定した。ReDeEPは、外部コンテキストとパrametric知識のスコアを、多変量回帰モデルにおける独立変数として別々に用いることで、LLaMA2、LLaMA3、Dollyモデルにおいて幻覚検出の精度を顕著に向上させた。

ABSTRACT

Retrieval-Augmented Generation (RAG) models are designed to incorporate external knowledge, reducing hallucinations caused by insufficient parametric (internal) knowledge. However, even with accurate and relevant retrieved content, RAG models can still produce hallucinations by generating outputs that conflict with the retrieved information. Detecting such hallucinations requires disentangling how Large Language Models (LLMs) utilize external and parametric knowledge. Current detection methods often focus on one of these mechanisms or without decoupling their intertwined effects, making accurate detection difficult. In this paper, we investigate the internal mechanisms behind hallucinations in RAG scenarios. We discover hallucinations occur when the Knowledge FFNs in LLMs overemphasize parametric knowledge in the residual stream, while Copying Heads fail to effectively retain or integrate external knowledge from retrieved content. Based on these findings, we propose ReDeEP, a novel method that detects hallucinations by decoupling LLM's utilization of external context and parametric knowledge. Our experiments show that ReDeEP significantly improves RAG hallucination detection accuracy. Additionally, we introduce AARF, which mitigates hallucinations by modulating the contributions of Knowledge FFNs and Copying Heads.

研究の動機と目的

  • 検索された外部コンテキストが正確で関連性がある場合でも、RAGモデルにおける幻覚を検出する課題に対処すること。
  • 特にパrametric知識と外部コンテキストの間の相互作用を含め、RAGにおける幻覚を引き起こす内部メカニズムを調査すること。
  • 幻覚検出におけるパrametric知識と外部コンテキストの混同効果を分離し、検出精度を向上させること。
  • 産業的展開に適した実用的で効率的な検出手法を開発すること。

提案手法

  • 外部コンテキストスコア(ECS)を導入し、検索されたコンテンツの注意メカニズムに基づく利用度を定量化する。また、パrametric知識スコア(PKS)を導入し、内部知識のフィードフォワードネットワーク(FFN)駆動による利用度を測定する。
  • LLMにおける注意ヘッドとフィードフォワードネットワークの機械的解釈可能性を分析し、幻覚が知識用FFNがパrametric知識に過剰に重きを置く場合、およびコピングヘッドが外部コンテキストを保持できない場合に生じることを同定した。
  • ReDeEP(Regressing Decoupled External context and Parametric knowledge score)を提案し、PKSとECSを独立変数として扱う多変量回帰モデルを用いて幻覚を検出する。
  • ReDeEPを2つのバージョンで実装した:ReDeEP(トークン)はトークンレベルの分析に、ReDeEP(チャンク)はLangChainとBGE埋め込みを用いた文書セグメントごとの分析に適している。
  • AARF(Add Attention Reduce FFN)を提案し、知識用FFNとコピングヘッドの寄与度を調整することで幻覚を低減する。
  • 因果的干渉と相関分析を用いて、PKSとECSが幻覚生成に果たす役割を検証した。
Figure 1: Two examples of RAG where the retrieved document is correct but conflicts with parametric knowledge. The left example shows a correct response based on external knowledge, while the right example demonstrates hallucination despite accurate external context.
Figure 1: Two examples of RAG where the retrieved document is correct but conflicts with parametric knowledge. The left example shows a correct response based on external knowledge, while the right example demonstrates hallucination despite accurate external context.

実験結果

リサーチクエスチョン

  • RQ1LLaMA2-13B-ChatやLLaMA3-8Bを含む複数のモデルで、検索されたコンテキストが正確である場合でも、LLMの内部メカニズムが幻覚を引き起こす理由は何か?
  • RQ2知識用フィードフォワードネットワークとコピングヘッドは、RAGにおける幻覚にどのように寄与するか、あるいは防げないか?
  • RQ3パrametric知識と外部コンテキストの影響を分離することで、幻覚検出のパフォーマンスが向上するか?
  • RQ4ReDeEPの多変量アプローチは、2つの知識源の一方を混同または無視する手法よりも優れているか?
  • RQ5ReDeEPとAARFは、実世界のRAGアプリケーションにおいて、効率的かつスケーラブルか?

主な発見

  • ReDeEPは、チャネルレベルのバージョンを用いて、LLaMA2-13B-ChatではAUC 0.8244、LLaMA3-8BではAUC 0.7285を達成し、最先端の幻覚検出パフォーマンスを実現した。
  • アブレーションスタディにより、PKSとECSを併用した完全なReDeEPが、片方のスコアのみを使用する場合よりも顕著に優れていることが確認され、分離の必要性が裏付けられた。
  • ReDeEP(チャンク)はReDeEP(トークン)よりも効率的であり、産業的展開に適した優れた時間効率を示した。
  • AARFは、知識用FFNとコピングヘッドの寄与度を調整することで幻覚を低減し、生成応答の真実性を向上させた。
  • 本手法はLLaMA2-7B、LLaMA2-13B、LLaMA3-8B、Dollyなど複数のLLMで安定した検出精度の向上を示し、一貫性のある性能向上を確認した。
  • ReDeEPは、外部モデルに依存する手法と比較して、顕著に低い推論時間を実現しており、幻覚検出モデルの中でも高い効率性を示している。
Figure 2: Causal perspectives on hallucination detection methods. (i) : parametric knowledge is confounded by external context, (ii) : external context is confounded by parametric knowledge, and (iii) : mixes both without decoupling their contributions. (Ours) : decouple these confounders using mech
Figure 2: Causal perspectives on hallucination detection methods. (i) : parametric knowledge is confounded by external context, (ii) : external context is confounded by parametric knowledge, and (iii) : mixes both without decoupling their contributions. (Ours) : decouple these confounders using mech

より良い研究を、今すぐ始めましょう

論文の読解から最終レビューまで、研究時間を劇的に削減しましょう。

クレジットカード登録不要

このレビューはAIが作成し、人間の編集者が確認しました。