Traceback of Poisoning Attacks to Retrieval-Augmented Generation

Baolei Zhang, Haoran Xin, Minghong Fang, Zhuqing Liu, Biao Yi +2 more
4/30/2025
cs.CRcs.IRcs.LG

Official code: zhangbl6618/RAG-Responsibility-Attribution (21 stars, MIT, last commit 2025-12-24).

Abstract

Large language models (LLMs) integrated with retrieval-augmented generation (RAG) systems improve accuracy by leveraging external knowledge sources. However, recent research has revealed RAG's susceptibility to poisoning attacks, where the attacker injects poisoned texts into the knowledge database, leading to attacker-desired responses. Existing defenses, which predominantly focus on inference-time mitigation, have proven insufficient against sophisticated attacks. In this paper, we introduce RAGForensics, the first traceback system for RAG, designed to identify poisoned texts within the knowledge database that are responsible for the attacks. RAGForensics operates iteratively, first retrieving a subset of texts from the database and then utilizing a specially crafted prompt to guide an LLM in detecting potential poisoning texts. Empirical evaluations across multiple datasets demonstrate the effectiveness of RAGForensics against state-of-the-art poisoning attacks. This work pioneers the traceback of poisoned texts in RAG systems, providing a practical and promising defense mechanism to enhance their security. Our code is available at: https://github.com/zhangbl6618/RAG-Responsibility-Attribution

View on arXivView PDF

Code Implementations(1)

MIT

Official Implementation of "Who Taught the Lie? Responsibility Attribution for Poisoned Knowledge in Retrieval-Augmented Generation" and "Traceback of Poisoning Attacks to Retrieval-Augmented Generation".

211PythonOct 15, 202510 months agoMIT

Similar Papers

Cite this paper

@article{zhang2025traceback,
  title  = {Traceback of Poisoning Attacks to Retrieval-Augmented Generation},
  author = {Baolei Zhang and Haoran Xin and Minghong Fang and Zhuqing Liu and Biao Yi and Tong Li and Zheli Liu},
  year   = {2025},
  eprint = {2504.21668},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2504.21668v2}
}

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/2504.21668.svg)](https://codeofpaper.com/paper/2504.21668)

Discussion