通过梯度差异识别大模型训练数据,提升版权与数据污染检测能力
From Unfamiliar to Familiar: Detecting Pre-training Data via Gradient Deviations in Large Language Models
- 基于梯度行为差异,构建样本从陌生到熟悉的变化特征
- 在5个数据集上超越现有方法,跨数据集迁移能力显著增强
- 适用于版权审查与基准污染防范,支持半监督部署
大语言模型的预训练数据检测对解决版权问题和缓解基准污染至关重要。现有方法主要依赖似然统计特征或微调前后的启发式信号,前者易受语料词频偏差影响,后者高度依赖微调数据相似性。从优化视角出发,我们发现训练过程中样本从陌生到熟悉的过程体现为梯度行为的系统性差异:熟悉样本更新幅度更小、更新位置更集中、神经元激活更尖锐。基于此,提出GDS方法,通过探测目标样本的梯度偏离度(Gradient Deviation Score)识别其是否属于预训练数据。具体地,用包含前馈网络与注意力模块参数更新幅度、位置和集中度的梯度特征表示样本,揭示成员与非成员数据的一致差异,并输入轻量级分类器进行二分类。在五个公开数据集上的实验表明,GDS性能达到当前最优,且跨数据集迁移能力显著优于强基线。可解释性分析进一步揭示梯度分布差异,半监督结果也提供了实用的数据检测路径。
原文摘要 · Abstract (English)
Pre-training data detection for LLMs is essential for addressing copyright concerns and mitigating benchmark contamination. Existing methods mainly focus on the likelihood-based statistical features or heuristic signals before and after fine-tuning, but the former are susceptible to word frequency bias in corpora, and the latter strongly depend on the similarity of fine-tuning data. From an optimization perspective, we observe that during training, samples transition from unfamiliar to familiar in a manner reflected by systematic differences in gradient behavior. Familiar samples exhibit smaller update magnitudes, distinct update locations in model components, and more sharply activated neurons. Based on this insight, we propose GDS, a method that identifies pre-training data by probing Gradient Deviation Scores of target samples. Specifically, we first represent each sample using gradient profiles that capture the magnitude, location, and concentration of parameter updates across FFN and Attention modules, revealing consistent distinctions between member and non-member data. These features are then fed into a lightweight classifier to perform binary membership inference. Experiments on five public datasets show that GDS achieves state-of-the-art performance with significantly improved cross-dataset transferability over strong baselines. Further interpretability analyses reveal differences in gradient distributions, and the semi-supervised results offer a practical way to detect pre-training data.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。