通过对比推理路径检测大模型是否依赖记忆而非检索内容。
RePCS: Diagnosing Data Memorization in LLM-Powered Retrieval-Augmented Generation
- 用查询与检索内容分别生成输出,比较分布差异判断记忆依赖。
- 在Prompt-WNQA上达0.918的ROC-AUC,误报率可控。
- 无需模型访问或重训练,适合安全关键场景部署。
检索增强生成(RAG)常用于让大语言模型(LLM)基于外部信息更新输出。然而,模型可能仍依赖训练数据中的记忆,绕过检索内容,产生污染结果。我们提出检索路径污染评分(RePCS),一种无需模型访问或重训练的诊断方法。RePCS比较两种推理路径:(i) 仅使用查询的参数化路径,(ii) 使用查询与检索上下文的增强路径,通过计算输出分布间的KL散度来评估影响。低散度表明检索内容影响小,暗示可能存在记忆行为。该方法模型无关,无需梯度或内部状态,仅增加一次前向传播。我们进一步推导出类似PAC的保证,将KL阈值与用户设定的假阳性/假阴性率关联。在Prompt-WNQA基准上,RePCS达到0.918的ROC-AUC,优于最强基线6.5个百分点,且在NVIDIA T4 GPU上延迟开销低于4.7%。RePCS提供轻量级、黑盒的保障机制,验证RAG系统是否真正利用检索信息,特别适用于安全关键应用。
原文摘要 · Abstract (English)
Retrieval-augmented generation (RAG) has become a common strategy for updating large language model (LLM) responses with current, external information. However, models may still rely on memorized training data, bypass the retrieved evidence, and produce contaminated outputs. We introduce Retrieval-Path Contamination Scoring (RePCS), a diagnostic method that detects such behavior without requiring model access or retraining. RePCS compares two inference paths: (i) a parametric path using only the query, and (ii) a retrieval-augmented path using both the query and retrieved context by computing the Kullback-Leibler (KL) divergence between their output distributions. A low divergence suggests that the retrieved context had minimal impact, indicating potential memorization. This procedure is model-agnostic, requires no gradient or internal state access, and adds only a single additional forward pass. We further derive PAC-style guarantees that link the KL threshold to user-defined false positive and false negative rates. On the Prompt-WNQA benchmark, RePCS achieves a ROC-AUC of 0.918. This result outperforms the strongest prior method by 6.5 percentage points while keeping latency overhead below 4.7% on an NVIDIA T4 GPU. RePCS offers a lightweight, black-box safeguard to verify whether a RAG system meaningfully leverages retrieval, making it especially valuable in safety-critical applications.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。