Abstract
Recent work has shown that Large Language Models (LLMs) can unintentionally leak sensitive information present in their training data. In this paper, we present Model Perturbations (MoPe), a new method to identify with high confidence if a given text is in the training data of a pre-trained language model, given white-box access to the model's parameters. MoPe adds noise to the model in parameter space and measures the drop in log-likelihood at a given point $x$, a statistic we show approximates the trace of the Hessian matrix with respect to model parameters. Across language models ranging from 70M to 12B parameters, we show that MoPe is more effective than existing loss-based attacks and recently proposed perturbation-based methods. We also examine the role of training point order and model size in attack success, and empirically demonstrate that MoPe accurately approximates the trace of the Hessian in practice. Our results show that the loss of a point alone is insufficient to determine extractability—there are training points we can recover using our method that have average loss. This casts some doubt on prior works that use the loss of a point as evidence of memorization or unlearning.
Introduction
Large Language Models (LLMs) are known to "memorize" portions of their training data, posing significant privacy risks if that data contains sensitive or proprietary information. To quantify this risk, researchers use Membership Inference Attacks (MIAs): given a model and a snippet of text, can an adversary determine if that text was part of the training set?
Most existing MIAs rely on loss thresholding—the intuition that a model will have lower loss on data it has seen before. However, loss is an imperfect proxy; many training points have average loss, while some test points have naturally low loss. We argue that a more sophisticated "fingerprint" of memorization is needed than just the absolute depth of the loss.
Methodology
The core idea of MoPe is to analyze the curvature of the loss landscape rather than just its value. We hypothesize that training points reside in "sharper" local minima than test points. To measure this without the astronomical cost of computing a full Hessian matrix, we introduce a perturbation-based approach:
- Perturb the Model: Add small amounts of Gaussian noise to the model parameters $\theta$.
- Measure the Change: Calculate how much the log-likelihood of a candidate point $x$ drops under these perturbed models.
- Approximate the Hessian: We prove that this expected change in loss is mathematically equivalent to the trace of the Hessian matrix (via the Hutchinson Trace Estimator).
Unlike previous methods like DetectGPT, which perturb the input text, MoPe perturbs the model weights themselves. This requires "white-box" access to the model parameters but provides a much stronger signal of whether the model has specifically optimized for that data point.
Experimental Setup
We evaluated MoPe across a wide range of scales using the Pythia Suite, which includes eight models ranging from 70M to 12B parameters, all trained on the de-duplicated "Pile" dataset. This allowed for a principled study of how model size affects privacy. Additionally, MNIST was used as a sanity check to compare MoPe’s approximation against the exact calculated Hessian trace.
Results and Discussion
MoPe consistently outperforms standard loss-based attacks and DetectGPT across most model sizes. For the 160M and 410M Pythia models, MoPe achieved an AUC of ~0.65, roughly 27% higher than the loss-based baseline (~0.51), which performed only slightly better than random guessing.
Key Insights
- Sharpness as a Signal: Training points are located in "sharper" regions of the loss landscape. Even if a training point has an unremarkable loss value, it can still be identified by MoPe because the model's performance on that point is highly sensitive to parameter changes.
- Challenging Unlearning Metrics: Many current methods for "unlearning" data simply check if the loss on that point has returned to an average level. MoPe suggests this is insufficient; a point might have average loss but still retain the "sharpness" signature of memorization.
- Scaling and Ensembling: MoPe performs best on smaller models (70M to 410M parameters). For the largest models (12B), where MoPe and loss-based attacks both struggle individually, an ensemble of the two methods significantly boosted performance (AUC ~0.544).
Conclusion
MoPe demonstrates that the local geometry of the loss landscape provides a more robust signal for membership inference than loss magnitude alone. While the method requires white-box access and carries a computational cost for multiple forward passes, it reveals critical vulnerabilities in how LLMs memorize data. Future work will explore whether MoPe can be integrated into data extraction attacks to recover training text directly.
Summary updated