arXiv:2510.27055cs.CLcs.AI2025-10被引 8

通过上下文学习检测大模型训练数据泄露,判断哪些数据被记忆。

Detecting Data Contamination in LLMs via In-Context Learning

  • 利用上下文学习对模型表现的影响差异,区分训练中记忆的数据与外部数据。
  • 在训练数据上,上下文会降低模型置信度;在未见数据上则提升置信度。
  • 无需额外标注,可自动运行,适合评估开源模型的数据安全风险。

我们提出 CoDeC,一种实用且准确的方法,用于检测和量化大语言模型中的训练数据污染。CoDeC 通过测量上下文学习对模型性能的影响,区分训练过程中记忆的数据与训练分布外的数据。实验发现,对于未见数据,上下文示例通常提升模型置信度;而当数据属于训练集时,置信度可能下降,因记忆模式被破坏。结果表明,CoDeC 能生成可解释的污染评分,清晰分离已见与未见数据,并揭示了无公开训练语料的开源模型中存在强烈记忆证据。该方法简单、自动化,且不依赖模型或数据集,易于集成到基准评测中。

原文摘要 · Abstract (English)

We present Contamination Detection via Context (CoDeC), a practical and accurate method to detect and quantify training data contamination in large language models. CoDeC distinguishes between data memorized during training and data outside the training distribution by measuring how in-context learning affects model performance. We find that in-context examples typically boost confidence for unseen datasets but may reduce it when the dataset was part of training, due to disrupted memorization patterns. Experiments show that CoDeC produces interpretable contamination scores that clearly separate seen and unseen datasets, and reveals strong evidence of memorization in open-weight models with undisclosed training corpora. The method is simple, automated, and both model- and dataset-agnostic, making it easy to integrate with benchmark evaluations.

大模型安全数据泄露上下文学习模型评估

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。