LRP4RAG: Detecting Hallucinations in Retrieval-Augmented Generation via Layer-wise Relevance Propagation

Haichuan Hu, Congqing He, Xiaochen Xie, Quanjun Zhang
8/28/2024
cs.CLcs.AI

No official code found. Best implementation: Jeryi-Sun/ReDEeP-ICLR (69 stars, last commit 2025-06-03). 1 more below.

Abstract

Retrieval-Augmented Generation (RAG) has become a primary technique for mitigating hallucinations in large language models (LLMs). However, incomplete knowledge extraction and insufficient understanding can still mislead LLMs to produce irrelevant or even contradictory responses, which means hallucinations persist in RAG. In this paper, we propose LRP4RAG, a method based on the Layer-wise Relevance Propagation (LRP) algorithm for detecting hallucinations in RAG. Specifically, we first utilize LRP to compute the relevance between the input and output of the RAG generator. We then apply further extraction and resampling to the relevance matrix. The processed relevance data are input into multiple classifiers to determine whether the output contains hallucinations. To the best of our knowledge, this is the first time that LRP has been used for detecting RAG hallucinations, and extensive experiments demonstrate that LRP4RAG outperforms existing baselines.

View on arXivView PDF

Code Implementations(2)

Tomsawyerhu/LRP4RAGCommunity100%

RAG Hallucination Detecting By LRP.

120Python, Jupyter NotebookAug 28, 20241 years ago
large-language-modelslayer-wise-relevance-propagationllm-hallucinationrag

The implement of paper:"ReDeEP: Detecting Hallucination in Retrieval-Augmented Generation via Mechanistic Interpretability"

698C, C++Jan 21, 20251 years ago

Similar Papers

Cite this paper

@article{hu2024lrprag,
  title  = {LRP4RAG: Detecting Hallucinations in Retrieval-Augmented Generation via Layer-wise Relevance Propagation},
  author = {Haichuan Hu and Congqing He and Xiaochen Xie and Quanjun Zhang},
  year   = {2024},
  eprint = {2408.15533},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2408.15533v3}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2408.15533.svg)](https://codeofpaper.com/paper/2408.15533)

Discussion