[논문 리뷰] ReDeEP: Detecting Hallucination in Retrieval-Augmented Generation via Mechanistic Interpretability
이 논문은 기계적 해석을 통해 외부 지식과 매개변수 지식의 사용을 분리함으로써 Retrieval-Augmented Generation (RAG) 모델에 대한 환각 감지 방법인 ReDeEP를 제안한다. 환각은 지식 피드포워드 네트워크가 내부 지식에 과도하게 초점을 맞출 때와 복사 헤드가 검색된 내용을 유지하지 못할 때 발생함을 규명함에 따라, ReDeEP는 외부 컨텍스트와 매개변수 지식에 대한 별도의 점수를 다변수 회귀 모델의 공변량으로 사용하여, LLaMA2, LLaMA3 및 Dolly 모델 전반에서 환각 감지 정확도를 크게 향상시킨다.
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 모델에서 환각을 탐지하는 데 도전하는 것.
- 특히 매개변수 지식과 외부 컨텍스트 간의 상호작용을 포함한 RAG에서 환각을 유발하는 내부 메커니즘을 조사하는 것.
- 환각 감지에서 매개변수 지식과 외부 컨텍스트의 혼란 요인을 분리함으로써 감지 정확도를 향상시키는 것.
- 실제 산업 적용에 적합한 실용적이고 효율적인 감지 방법을 개발하는 것.
제안 방법
- 외부 컨텍스트 점수(ECS)와 매개변수 지식 점수(PKS)라는 두 가지 새로운 지표를 도입하여, 검색된 내용에 대한 주의 기반 활용 정도를 측정하고, 내부 지식에 대한 피드포워드 네트워크 기반 활용 정도를 측정한다.
- 기계적 해석을 활용해 LLM의 주의 헤드와 피드포워드 네트워크를 분석하여, 지식 피드포워드 네트워크가 매개변수 지식에 과도하게 초점을 맞추고 복사 헤드가 외부 컨텍스트를 유지하지 못할 때 환각이 발생함을 규명한다.
- PKS와 ECS를 독립 공변량으로 간주하는 다변수 회귀 모델인 ReDeEP(Regressing Decoupled External context and Parametric knowledge score)를 제안하여 환각을 감지한다.
- ReDeEP를 두 가지 변형으로 구현한다: 토큰 수준 분석을 위한 ReDeEP (Token)과 LangChain 및 BGE 임베딩을 사용한 문서 세그먼트 분석을 위한 ReDeEP (Chunk).
- 지식 피드포워드 네트워크와 복사 헤드의 기여도를 조절하여 환각을 감소시키는 AARF (Add Attention Reduce FFN) 개선 방법을 개발한다.
- 인과적 간섭과 상관 분석을 적용하여 PKS와 ECS가 환각 생성에 미치는 역할을 검증한다.

실험 결과
연구 질문
- RQ1LLaMA2-13B-Chat에서 외부 컨텍스트가 정확하고 관련성이 있음에도 불구하고 RAG에서 환각을 유발하는 LLM 내부 메커니즘은 무엇인가?
- RQ2지식 피드포워드 네트워크와 복사 헤드는 RAG에서 환각을 유발하거나 방지하는 데 어떻게 기여하거나 실패하는가?
- RQ3매개변수 지식과 외부 컨텍스트의 영향을 분리함으로써 환각 감지 성능을 향상시킬 수 있는가?
- RQ4ReDeEP의 다변수 접근 방식은 두 지식 소스 중 하나를 혼합하거나 忽略하는 방법보다 어떻게 뛰어나게 작용하는가?
- RQ5ReDeEP와 AARF는 실제 RAG 응용 프로그램에서 효율성과 확장성 측면에서 어떻게 작용하는가?
주요 결과
- ReDeEP는 LLaMA2-13B-Chat에서 AUC 0.8244, LLaMA3-8B에서 AUC 0.7285를 기록하여 최신 기술 수준의 환각 감지 성능을 달성했다.
- 제거 실험 결과, PKS와 ECS를 함께 사용하는 전체 ReDeEP가 단일 점수만 사용하는 것보다 유의미하게 뛰어나며, 분리의 필요성을 입증했다.
- ReDeEP (Chunk)는 ReDeEP (Token)보다 더 효율적이며, 산업적 구현에 있어 뛰어난 시간 효율성을 보였다.
- AARF는 지식 피드포워드 네트워크와 복사 헤드의 기여도를 조절하여 환각을 감소시키고, 생성된 응답의 진실성을 향상시켰다.
- LLaMA2-7B, LLaMA2-13B, LLaMA3-8B 및 Dolly를 포함한 여러 LLM에서 강건하게 작동하며, 감지 정확도 향상이 일관되게 관찰되었다.
- ReDeEP는 외부 모델에 의존하는 방법들보다 훨씬 낮은 추론 시간을 기록하여, 환각 감지 모델 중 높은 효율 수준에 위치해 있다.

더 나은 연구,지금 바로 시작하세요
논문 읽기부터 검토까지, 연구 시간을 획기적으로 줄여보세요.
카드 등록 없음 · 무료 플랜 제공
이 리뷰는 AI가 만들고, 인간 에디터가 검토했습니다.