Adaptive Pre-training Data Detection for Large Language Models via Surprising Tokens

📄 arXiv: 2407.21248v1 📥 PDF

作者: Anqi Zhang, Chaofeng Wu

分类: cs.CL, cs.CR, cs.LG

发布日期: 2024-07-30


💡 一句话要点

提出基于Surprising Tokens的大语言模型预训练数据自适应检测方法

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 大语言模型 预训练数据检测 成员推理攻击 Surprising Tokens 模型安全 隐私保护 数据溯源

📋 核心要点

  1. 现有预训练数据检测方法依赖于LLM的逐字记忆能力,在大规模数据和有限训练轮数下效果受限。
  2. 论文提出一种基于Surprising Tokens的自适应检测方法,通过衡量模型对token的Surprising程度来判断数据是否被见过。
  3. 实验表明,该方法在多个基准测试和模型上均优于现有方法,最高提升达29.5%,并提出了新的评估基准。

📝 摘要(中文)

由于大语言模型(LLM)训练数据的不透明性,引发了关于隐私、安全和版权的担忧,预训练数据检测问题日益重要。现有解决方案主要依赖于机器学习隐私中的成员推理攻击(MIA)等技术,而这些技术严重依赖于LLM对文本的逐字记忆能力。然而,考虑到海量的训练数据和有限的有效训练轮数,这种依赖带来了挑战。本文提出了一种自适应预训练数据检测方法,减轻了这种依赖,并有效放大了识别效果。该方法自适应地定位输入的“Surprising Tokens”。如果LLM对某个token的预测是“确定但错误”的,即概率分布的香农熵较低,但真实token的概率较低,则该token对LLM来说是Surprising的。通过使用Surprising Tokens的预测概率来衡量“Surprising”,该检测方法基于一个简单的假设:对于模型来说,看到见过的数据比看到没见过的数据更不Surprising。该方法无需访问预训练数据语料库或额外的训练(如参考模型)即可应用。在各种基准和模型上进行的大量实验表明,与现有方法相比,我们的方法表现出持续的增强,最大改进幅度为29.5%。我们还引入了一个基于新框架开发的Dolma-Book新基准,该框架采用模型训练前后收集的书籍数据,以提供进一步的评估。

🔬 方法详解

问题定义:论文旨在解决大语言模型预训练数据检测问题。现有方法,如基于成员推理攻击(MIA)的方法,依赖于模型对训练数据的精确记忆。然而,由于训练数据量巨大且训练轮数有限,模型难以完全记住所有数据,导致现有方法效果不佳。

核心思路:论文的核心思路是,模型对于见过的数据的预测应该比没见过的数据更“不Surprising”。具体来说,如果模型对某个token的预测概率分布熵较低(即模型很确定),但真实token的概率也很低(即模型预测错误),则该token被认为是“Surprising”。通过衡量模型对输入文本中Surprising Tokens的预测概率,可以判断该文本是否属于训练数据。

技术框架:该方法无需访问预训练数据或训练额外的参考模型。其流程如下:1. 输入一段文本。2. 使用LLM预测文本中每个token的概率分布。3. 计算每个token的Surprising程度,即概率分布的熵和真实token概率的函数。4. 根据Surprising程度的聚合值(例如平均值)来判断该文本是否属于训练数据。

关键创新:该方法的核心创新在于使用“Surprising Tokens”的概念来衡量模型对数据的熟悉程度,从而避免了对模型精确记忆的依赖。与传统的MIA方法相比,该方法更加关注模型预测的置信度和准确性之间的差异,而不是简单地判断模型是否能记住某个特定的token。

关键设计:Surprising程度的计算是关键。论文中可能使用了香农熵来衡量概率分布的确定性,并结合真实token的预测概率来计算Surprising程度。具体的聚合方式(例如平均值、最大值等)也可能影响最终的检测效果。此外,如何选择合适的阈值来判断文本是否属于训练数据也是一个重要的设计细节。

🖼️ 关键图片

fig_0
fig_1
fig_2

📊 实验亮点

实验结果表明,该方法在多个基准测试和模型上均优于现有方法,最高提升达29.5%。特别是在Dolma-Book新基准上,该方法也取得了显著的性能提升。这些结果表明,该方法能够有效地检测大语言模型的预训练数据,并且具有良好的泛化能力。

🎯 应用场景

该研究成果可应用于大语言模型的安全评估,帮助识别模型训练数据中可能存在的隐私泄露或版权侵犯风险。同时,该方法可以用于评估不同预训练数据集对模型性能的影响,指导预训练数据的选择和清洗。此外,该方法还可以用于检测模型是否被用于生成恶意内容,例如虚假新闻或仇恨言论。

📄 摘要(原文)

While large language models (LLMs) are extensively used, there are raising concerns regarding privacy, security, and copyright due to their opaque training data, which brings the problem of detecting pre-training data on the table. Current solutions to this problem leverage techniques explored in machine learning privacy such as Membership Inference Attacks (MIAs), which heavily depend on LLMs' capability of verbatim memorization. However, this reliance presents challenges, especially given the vast amount of training data and the restricted number of effective training epochs. In this paper, we propose an adaptive pre-training data detection method which alleviates this reliance and effectively amplify the identification. Our method adaptively locates \textit{surprising tokens} of the input. A token is surprising to a LLM if the prediction on the token is "certain but wrong", which refers to low Shannon entropy of the probability distribution and low probability of the ground truth token at the same time. By using the prediction probability of surprising tokens to measure \textit{surprising}, the detection method is achieved based on the simple hypothesis that seeing seen data is less surprising for the model compared with seeing unseen data. The method can be applied without any access to the the pre-training data corpus or additional training like reference models. Our approach exhibits a consistent enhancement compared to existing methods in diverse experiments conducted on various benchmarks and models, achieving a maximum improvement of 29.5\%. We also introduce a new benchmark Dolma-Book developed upon a novel framework, which employs book data collected both before and after model training to provide further evaluation.