Automatic Calibration for Membership Inference Attack on Large Language Models

Saleh Zare Zade, Yao Qiang, Xiangyu Zhou, Hui Zhu, Mohammad Amin Roshani, Prashant Khanduri, Dongxiao ZhuarXiv 2025 · DOI

TL;DR

This paper introduces ACMIA, a novel framework for Membership Inference Attacks (MIAs) on Large Language Models (LLMs). ACMIA effectively calibrates LLM output probabilities using a tunable temperature, significantly improving the accuracy of identifying training data and reducing false positives compared to existing methods. This work is crucial for understanding and mitigating privacy risks in LLMs.

What Problem Does This Paper Address?

Large Language Models (LLMs) are trained on massive datasets, and a critical concern is whether specific pieces of text from these datasets are "memorized" by the model. Membership Inference Attacks (MIAs) aim to determine if a given text was part of the LLM's training data. However, existing MIA techniques for LLMs struggle with a high rate of false positives (misclassifying non-training data as training data) and often require additional models for calibration, limiting their practicality. This paper addresses these limitations by proposing a more robust and self-contained calibration method for MIAs on LLMs.

Methods

The core of the proposed ACMIA framework is a novel calibration mechanism inspired by the maximum likelihood estimation (MLE) principle used in LLM pre-training. The authors introduce a "tunable temperature" parameter that is applied to the LLM's output probabilities. This temperature scaling effectively reshapes the probability distribution of tokens, amplifying the separation between genuine training data and non-training data.

ACMIA is presented in three configurations to accommodate different levels of model access:

  • AC (Automatic Calibration): This variant uses the temperature-scaled probabilities and a sign function based on the temperature to infer membership. It's designed to work even with limited access, relying on sample-level losses.
  • DerivAC (Derivative Automatic Calibration): This method further refines the AC score by incorporating the derivative of the temperature-scaled log probability with respect to temperature. This aims to better capture sample difficulty.
  • NormAC (Normalized Automatic Calibration): This is the most sophisticated variant, using the mean and variance of the temperature-scaled log probabilities to normalize scores, providing a robust measure of membership. This variant requires access to token-level log probabilities.

Datasets

The authors evaluated their ACMIA framework on three established benchmarks:

  • WikiMIA: Contains Wikipedia event texts, split by publication date, with both original and paraphrased versions to test robustness.
  • MIMIR: Sourced from The Pile dataset, this benchmark presents a more challenging scenario with minimal distribution shifts between training and non-training data.
  • PatentMIA: A Chinese-language benchmark that uses patent priority dates to distinguish training from non-training data.

They also tested their methods on various open-source LLMs, including Baichuan, Qwen1.5, OPT, Pythia, and GPT-NeoX.

Key Insights and Ideas

  • Temperature as a Calibration Tool: The core insight is that a tunable temperature can effectively "calibrate" LLM output probabilities to better distinguish between members and non-members, even when their raw scores are similar. This is inspired by how LLMs learn to assign high probabilities to training data during MLE.
  • Self-Contained Calibration: Unlike previous methods that relied on external reference models, ACMIA performs calibration internally using the target LLM's own outputs, making it more practical and efficient.
  • Robustness to Text Variations: ACMIA demonstrates strong performance even on paraphrased texts, indicating its ability to capture deeper structural and probabilistic signals beyond superficial word choices.
  • Model Size Matters: Larger LLMs consistently show higher susceptibility to MIAs, reinforcing the trend that increased model capacity leads to greater memorization and thus greater privacy risk.
  • Text Length Increases Vulnerability: Longer input texts significantly improve MIA effectiveness, highlighting the need for enhanced privacy protections for longer sequences.

Key Results

ACMIA consistently outperformed state-of-the-art baselines across all three benchmarks and various LLMs.

  • AUROC Scores: ACMIA methods achieved the highest AUROC scores, indicating superior ability to distinguish between members and non-members. For instance, on the challenging MIMIR benchmark, ACMIA variants consistently outperformed baselines, often by a significant margin.
  • TPR@5%FPR: ACMIA also demonstrated superior performance in controlling false positives while maintaining high true positive rates. On the MIMIR benchmark, ACMIA achieved notably higher TPR@5%FPR scores compared to the best baselines, especially in low-overlap scenarios.
  • Robustness: The proposed methods showed strong robustness to temperature variations, meaning precise tuning isn't always necessary for effective performance. They also performed well on both original and paraphrased texts.

Limitations and Future Work

  • Model Access: While ACMIA offers variants for different access levels (loss-only vs. token probabilities), the most powerful version (NormAC) still requires access to token-level log probabilities.
  • Generalizability: The authors suggest extending ACMIA to other generative and classification models trained under similar objectives, which could be a promising future direction.
  • Ethical Implications: The paper emphasizes that the goal is to raise awareness of LLM vulnerabilities and promote defenses, not to facilitate malicious attacks.

Summary updated

BibTeX
@misc{zade2025automatic,
  author = {Saleh Zare Zade and Yao Qiang and Xiangyu Zhou and Hui Zhu and Mohammad Amin Roshani and Prashant Khanduri and Dongxiao Zhu},
  title = {{Automatic Calibration for Membership Inference Attack on Large Language Models}},
  year = {2025},
  eprint = {2505.03392},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2505.03392},
}
Figure