Assessing Data Leakage Risk in Fine-Tuned LLMs via Membership Inference Attacks

Mohamed-Jalal Baim, Léa Deleris, Myriam Tami, Mariam Barry, El-Mahdi El-MhamdiarXiv 2026

TL;DR

When you fine-tune a large language model (LLM) on private data, how do you know if it’s going to spill secrets? Instead of playing whack-a-mole with individual privacy attacks, this paper derives mathematical upper bounds on how much any membership inference attack (MIA) can possibly reveal—both for entire sequences and down to individual tokens.

What Problem Does This Paper Address?

Organizations love fine-tuning off-the-shelf LLMs on proprietary data like clinical notes, customer records, or internal emails. The catch? LLMs memorize things, and fine-tuning concentrates that memorization on small, sensitive datasets. While regulations like GDPR and the EU AI Act require providers to govern data responsibly, neither specifies how to practically verify that a model isn't leaking its training data.

Traditionally, researchers test for memorization using Membership Inference Attacks (MIAs)—asking whether a specific data point was in the training set. But testing a single MIA only tells you what that specific attack can extract. It doesn't tell you if a cleverer adversary could extract more. The authors flip the question around: what is the absolute ceiling on what the best possible black-box MIA can reveal?

Methods

The authors consider a realistic black-box audit setup: an attacker has access to the log-probabilities of both the fine-tuned model ($P_{\theta_{\text{ft}}}$) and its publicly available pretrained base ($P_{\theta_{\text{pre}}}$), but no access to weights, gradients, or training data.

  1. The Risk Ceiling (Total Variation): The authors show that the advantage of the optimal MIA is exactly equal to the Total Variation (TV) distance between the fine-tuned and pretrained model distributions. This turns an open-ended attack space into a single, measurable property of the model pair.
  2. Making It Computable (Theorem 3.1): Computing TV directly over all possible token sequences is intractable. So, the authors bound it using KL divergence, which can be estimated by sampling. Because fine-tuning can be either light (R1) (small KL) or heavy (R2) (large KL), they take the minimum of two classical inequalities:
  3. Pinsker’s inequality: Sharp when KL is small (R1), but becomes uselessly > 1 when KL grows.
  4. Bretagnolle-Huber (BH) inequality: Stays strictly below 1 for any finite KL, making it informative in heavy fine-tuning (R2).
  5. Zooming In (Theorem 3.2): A single sequence-level number is coarse. By exploiting the autoregressive nature of LLMs, the authors decompose the bound into a token-level bound using the conditional next-token KL divergence ($\text{KL}_t$). This pinpoints where in a generated sequence leakage is most likely to happen.
  6. Causal Evaluation: To ensure their experiments measure true memorization rather than just distribution shift between datasets, the authors randomly assign membership within a single corpus using a coin flip ($\text{Bernoulli}(1/2)$).

Datasets

  • Model: GPT-Neo 125M, pretrained on The Pile.
  • Dataset: Enron email bodies (after standard preprocessing).
  • Splits: 2,000 sequences are held out as a fixed non-member set ($D_{\text{non}}$), while the fine-tuning member set ($D_{\text{mem}}$) is tested at sizes $N \in \{500, 2000, 6000\}$.

Key Insights and Ideas

  • Model-centric vs. Attack-centric: Privacy risk doesn't have to be measured by running an endless arms race of new attacks. The gap between the fine-tuned model and its pretrained base inherently caps what any MIA can achieve.
  • Regime Switching: Neither Pinsker nor BH alone is enough. Combining them ($\min\{\text{Pinsker}, \text{BH}\}$) smoothly bridges light and heavy fine-tuning regimes.
  • Leakage is Spiky, Not Uniform: The token-level bound reveals that divergence stays low across most of a generated sequence, spiking only at specific positions—which turn out to be verbatim memorized spans from the training data.

Key Results

  • Sequence-Level Validation: Across all corpus sizes ($N \in \{500, 2000, 6000\}$), training epochs, and random seeds, the empirical MIA advantage never violates the $\min\{\text{Pinsker}, \text{BH}\}$ bound, and closely tracks the empirical TV.
Figure 1: Validity of the sequence-level bounds. Left: empirical advantage vs. KL divergence; one marker is one epoch checkpoint, lines connect checkpoints of the same run. Runs move from the light regime R1 into the heavy regime R2 as KL grows. Right: empirical advantage, empirical TV and both bounds vs. epochs (N = 6000). The advantage stays below min{Pinsker, BH} at every checkpoint (mean over 3 seeds).
  • Pinpointing Memorized Text: Along a 32-token generated sequence, spikes in per-token $\text{KL}_t$ and the corresponding bounds align directly with verbatim matches in the Enron corpus (such as the classic email quote "-- original message --").
Figure 2: Per-token KLt (Top) and bounds (Bottom) along a 32-token generated sequence. Spikes mark positions where the fine-tuned model is far more confident than the pretrained one at that position. Some spikes coincide with spans verified verbatim against the training corpus (red).
  • Training Choices Matter: Experiments (detailed in their appendix) show that parameter-efficient or privacy-preserving training methods—specifically LoRA, MiCA, and especially DP-SGD—reduce this leakage ceiling compared to full fine-tuning.

Limitations and Future Work

The authors note that their bounds specifically capture memorization through the lens of membership inference. They do not cover other types of privacy leakage. Moving forward, they suggest extending this theoretical framework to broader privacy threats—such as user inference attacks—and designing mitigation strategies tailored to those risks.

Summary updated

BibTeX
@misc{baim2026assessing,
  author = {Mohamed-Jalal Baim and Léa Deleris and Myriam Tami and Mariam Barry and El-Mahdi El-Mhamdi},
  title = {{Assessing Data Leakage Risk in Fine-Tuned LLMs via Membership Inference Attacks}},
  year = {2026},
  eprint = {2612.02536},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2612.02536},
}
Figure