Who Stole Your Data? A Method for Detecting Unauthorized RAG Theft
Peiyang Liu, Ziqiang Cui, Di Liang, Wei Ye
TL;DR
This work tackles unauthorized data use in retrieval-augmented generation by introducing the RAG Plagiarism Detection Dataset (RPD) and a dual-layer watermarking framework. The semantic (knowledge-based) and lexical (red-green token distribution) watermarks, combined with an Interrogator-Detective framework and statistical hypothesis testing, enable robust detection even under fact redundancy and adversarial evasion. Across extensive experiments, the dual-layer approach achieves near-perfect detection under diverse conditions, with an ablation study showing complementary strengths and a synergy that raises the barrier for evaders. The results support a practical, privacy-preserving paradigm for guarding IP in RAG-enabled AI systems while maintaining text quality and utility.
Abstract
Retrieval-augmented generation (RAG) enhances Large Language Models (LLMs) by mitigating hallucinations and outdated information issues, yet simultaneously facilitates unauthorized data appropriation at scale. This paper addresses this challenge through two key contributions. First, we introduce RPD, a novel dataset specifically designed for RAG plagiarism detection that encompasses diverse professional domains and writing styles, overcoming limitations in existing resources. Second, we develop a dual-layered watermarking system that embeds protection at both semantic and lexical levels, complemented by an interrogator-detective framework that employs statistical hypothesis testing on accumulated evidence. Extensive experimentation demonstrates our approach's effectiveness across varying query volumes, defense prompts, and retrieval parameters, while maintaining resilience against adversarial evasion techniques. This work establishes a foundational framework for intellectual property protection in retrieval-augmented AI systems.
