Min-K%++: Improved Baseline for Pre-Training Data Detection from Large Language Models

Jingyang Zhang, Jingwei Sun, Eric Yeats, Yang Ouyang, Martin Kuo, Jianyi Zhang, Hao Frank Yang, Hai Li

TL;DR

Min-K%++ is a new, theoretically grounded method for detecting whether a specific text was part of a Large Language Model's (LLM) pre-training data. By treating training samples as "local maxima" in the model's probability distribution and applying a dynamic z-score normalization to token probabilities, it achieves state-of-the-art detection accuracy without requiring expensive reference models.

Introduction

As LLMs are trained on trillions of tokens, two major issues have emerged: copyright infringement (did the model memorize a protected book?) and benchmark contamination (is the model "cheating" on an evaluation because it saw the test questions during training?).

Detecting this is a specific type of Membership Inference Attack (MIA). However, standard MIA techniques struggle with LLMs because these models are typically trained for only one or two epochs on massive, diverse datasets. Existing detection methods, like the original Min-K%, rely on simple heuristics—such as the assumption that training data will have higher-than-average probabilities. While useful, these heuristics often fail on "difficult" or rare sequences that naturally have low probabilities even if the model has seen them before.

Overview of the Min-K%++ pipeline and its superior ROC performance compared to baselines.

Methods: Beyond Simple Probabilities

The authors introduce Min-K%++, which moves beyond simple probability scores by leveraging a deeper theoretical understanding of model training.

  1. The Theoretical Insight: Using the lens of "score matching," the authors prove that maximum likelihood training implicitly forces training samples to become local maxima (peaks) in the model's probability distribution along each input dimension.
  2. The Scoring Function: Instead of just looking at the absolute log-probability of a token, $\log p(x_t|x_{<t})$, Min-K%++ calculates a normalized score for each token: $$s = \frac{\log p(x_t|x_{<t}) - \mu}{\sigma}$$ Where $\mu$ is the expected log-probability across the entire vocabulary for that position, and $\sigma$ is the standard deviation.

  3. Aggregation: Like its predecessor, the method selects the $k\%$ of tokens in a sequence with the lowest (most "outlier-ish") scores and averages them to produce a final "membership" score for the entire text.

Crucially, this method is reference-free. It doesn't require running a second "reference" model to calibrate scores, making it computationally efficient as it only requires the information generated during a standard single forward pass.

Key Insights

  • Training leaves "footprints": The most important realization is that training doesn't just raise the probability of a sample; it shapes the local geometry of the distribution, turning a training sample into a "mode" or peak.
  • Relative vs. Absolute Probability: A token might have a low absolute probability (e.g., a rare technical term), but if it is significantly more probable than all other possible tokens in that specific context, it is likely training data. Min-K%++ captures this by comparing the target token to the rest of the vocabulary distribution using $\mu$ and $\sigma$.
  • Dynamic Calibration: By using the standard deviation ($\sigma$) as a scaling factor, the method performs a "dynamic temperature scaling." This makes the score comparable across different contexts and models, allowing it to outperform static heuristics.

Datasets and Key Results

The researchers evaluated their method across 10 different models from 5 families (including LLaMA, Pythia, GPT-NeoX, OPT, and the non-transformer state-space model, Mamba) using two primary benchmarks:

  • WikiMIA: A dataset using Wikipedia events occurring before and after specific model training cutoffs to create clear "seen" vs. "unseen" categories. Here, Min-K%++ outperformed the previous state-of-the-art (Min-K%) by 6.2% to 10.5% in AUROC (Area Under the Receiver Operating Characteristic) across various models.
  • MIMIR: A more challenging benchmark based on the Pile dataset. On MIMIR, Min-K%++ performed on par with "Reference" methods that require an additional LLM for calibration, despite Min-K%++ being much faster and simpler to implement.

Notably, the method proved to be architecture agnostic. It worked exceptionally well on Mamba, proving that the "local maxima" footprint is a fundamental property of maximum likelihood training, not just a quirk of Transformer architectures.

Limitations and Future Work

While highly effective, the authors note a few areas for further exploration:

  • Rare/Difficult Samples: Extremely rare training samples remain a challenge. The model may not have "memorized" them enough to create a distinct local maximum.
  • The "k" Hyperparameter: The choice of which percentage of tokens to average ($k\%$) still requires some tuning, though Min-K%++ is less sensitive to this than previous methods.
  • Generalization: The theoretical grounding assumes continuous distributions for the proof. While it translates well to the discrete token space of LLMs, there is room to further refine the mathematical bridge between these two domains.

Summary updated

BibTeX
@inproceedings{zhang2025min,
  author = {Jingyang Zhang and Jingwei Sun and Eric Yeats and Yang Ouyang and Martin Kuo and Jianyi Zhang and Hao Frank Yang and Hai Li},
  title = {{Min-K\%++: Improved Baseline for Pre-Training Data Detection from Large Language Models}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=ZGkfoufDaU},
}
Figure