From Unfamiliar to Familiar: Detecting Pre-training Data via Gradient Deviations in Large Language Models
Title: From Unfamiliar to Familiar: Detecting Pre-training Data via Gradient Deviations in Large Language Models
Abstract:
Identifying pre-training data within Large Language Models (LLMs) is a critical step for resolving copyright issues and preventing benchmark contamination. Current detection techniques primarily rely on likelihood-based statistical indicators or heuristic signals observed before and after the fine-tuning phase. However, these approaches have notable limitations: likelihood-based metrics are often skewed by word frequency biases present in the training corpora, while heuristic methods are heavily contingent on the similarity between the fine-tuning and pre-training datasets.
From an optimization standpoint, we note that samples evolve from being unfamiliar to familiar during the training process, a transition that manifests as systematic variations in gradient behavior. Specifically, familiar samples are characterized by reduced update magnitudes, distinct update locations within model components, and more intensely activated neurons. Leveraging this observation, we introduce GDS, a novel approach that detects pre-training data by analyzing Gradient Deviation Scores.
GDS operates by constructing gradient profiles for each sample, which encapsulate the magnitude, location, and concentration of parameter updates across both Feed-Forward Network (FFN) and Attention modules. These profiles highlight consistent differences between member and non-member data. The extracted features are subsequently processed by a lightweight classifier to execute binary membership inference.
Evaluations across five public datasets demonstrate that GDS delivers state-of-the-art results, offering substantially better cross-dataset transferability compared to strong baseline methods. Additionally, interpretability studies uncover disparities in gradient distributions, while semi-supervised experiments provide a viable, practical solution for pre-training data detection.
Source: arXiv Generated at: 2026-06-02 00:00:00 UTC





