Manuscript Offprint

arXiv:2610.40616

Difficulty Calibration Across Time for Membership Inference in Diffusion Models

Michael Joseph, Yedid Hoshen

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

ABSTRACT

Modern diffusion models are trained on massive datasets that often include copyrighted or private images. Membership inference attacks (MIAs) address this by testing whether a given image was in a model's training set. The standard approach scores an image by its reconstruction loss and flags low-loss images as members. This often fails because some images are simply easier to reconstruct than others, so a simple unseen image can score a lower loss than a complex training image. Difficulty calibration separates memorization from how difficult an image is to begin with. We show how to calibrate along two axes of time: training time and diffusion time. First, across training time, we introduce Reference-Model Calibration (RMC), which compares a fine-tuned model's loss against an earlier checkpoint. This cleanly isolates newly memorized data and gives near-perfect auditing, even without text captions. Since earlier checkpoints are not always available, we next present Temporal Self-Calibration (TSC), which calibrates across diffusion time using only a single model. Our key observation is that an image's difficulty persists across noise levels, whereas memorization is localized in time. By comparing the loss at a target timestep against neighboring timesteps from the same model, TSC attenuates image difficulty using the model's own trajectory. Empirically, our methods beat the state of the art by a wide margin, and unlike most existing attacks, generalize across different model parameterizations such as x-, v-, and ϵ\epsilon-prediction models. Code is available at https://github.com/MichaelJoseph777/TSC.

1 INTRODUCTION

Diffusion Models (DMs) (Song & Ermon, 2019; Ho et al., 2020; Song et al., 2020) are currently the method of choice for high-fidelity image generation (Rombach et al., 2022; Ramesh et al., 2022). As their success relies heavily on massive, uncurated web-scale datasets, these models often inadvertently absorb personal photographs, copyrighted artworks, and proprietary content. This indiscriminate data collection creates privacy and copyright risks, with recent studies (Carlini et al., 2023; Somepalli et al., 2023) demonstrating that DMs can memorize and reproduce specific training examples during generation. Consequently, it has become increasingly important to reliably audit the underlying training corpora of these generative models.

Membership Inference Attacks (MIAs) (Shokri et al., 2017) audit this risk by predicting whether a specific sample was part of the training set. While typically framed as a security vulnerability, MIAs can also enable creators to verify whether their proprietary content was used for training. These attacks exploit statistical differences in model behavior on members versus non-members (Yeom et al., 2018). Although well-studied for earlier generative models such as GANs (Goodfellow et al., 2020) and VAEs (Kingma & Welling, 2013), with several attacks developed for these settings (Hayes et al., 2017; Hilprecht et al., 2019; Chen et al., 2020), the iterative denoising process of diffusion models makes traditional MIAs considerably less effective (Duan et al., 2023), motivating approaches tailored specifically to the diffusion process.

Probably the most standard approach to MIAs is evaluating the models loss on the target examples, and predicting the low loss examples as members. Early approaches applied this to DMs by directly measuring the reconstruction error at a single, isolated timestep (Matsumoto et al., 2023). While followup work improved upon this (Duan et al., 2023; Kong et al., 2024), a fundamental obstacle limits the accuracy of all these approaches: There are images that are intrinsically easy that achieve low loss regardless of membership and vice versa. This difficulty factor confounds membership making the loss an unreliable membership metric.

To overcome this confound, we propose difficulty calibration across two time axes: training time and diffusion time. First, across training time, we introduce Reference-Model Calibration (RMC) to audit fine-tuned models. By comparing a sample's fine-tuned loss against the base checkpoint loss, RMC cleanly isolates newly memorized data from general reconstruction difficult. Note that this strategy is known for Large Language Models (Wang et al., 2024) but is under-explored in DMs. Its limitation is that prior checkpoints are frequently unavailable, and the approach is irrelevant for pretraining corpora. To provide an unconstrained alternative, we propose Temporal Self-Calibration (TSC), which calibrates across diffusion time using only a single model. TSC leverages the insight that image difficulty persists across nearby noise levels, whereas the membership signal is highly localized in time. By evaluating the relative loss differences between a target timestep and its temporal neighbors, TSC uses the local trajectory as an internal baseline to suppress difficulty-induced variance. This internal calibration isolates the structural deviation of membership, successfully identifying a "difficult" member even when its absolute loss strictly exceeds that of an "easy" non-member.

We evaluate our methods across multiple model architectures, datasets, and training targets. While RMC provides state-of-the-art auditing for fine-tuned Stable Diffusion models, TSC serves as a highly powerful alternative for unconstrained settings. Across DDPM and Stable Diffusion evaluation settings, TSC consistently outperforms prior baselines. On CIFAR-10 (Krizhevsky et al., 2009), it doubles the performance of existing attacks to reach a 62.3% TPR@1%FPR. Furthermore, we emphasize TSC's robustness across diverse training objectives. While existing attacks are rigidly tailored to standard noise-prediction models and severely degrade on alternative parameterizations, TSC maintains highly accurate extraction capabilities. Finally, we analyze where the membership signal physically appears along the denoising trajectory, demonstrating that the effective leakage window is intrinsically tied to the underlying training objective.

Our contributions are:

• We propose TSC, a generalized method for robust membership inference. By evaluating relative loss differences across adjacent timesteps, TSC uses the local trajectory as an internal baseline to mitigate image difficulty and isolate membership signal.

• We introduce RMC for auditing fine-tuned models. To the best of our knowledge, we are the first to systematically analyze and demonstrate the effectiveness of prior-checkpoint calibration of single-timestep losses for membership inference in diffusion models.

• We comprehensively evaluate both methods, achieving state-of-the-art performance across diverse architectures and datasets. Notably, TSC consistently yields massive improvements over prior trajectory-based baselines, frequently doubling the true positive rate at strict false-positive thresholds.

• We provide a detailed analysis of how the effective denoising timesteps for membership inference shift across different training objectives, extending robust membership inference beyond the standard ϵ\epsilon-prediction, ϵ\epsilon-loss paradigm.

References (61)

  • Membership inference attacks from first principles
  • Extracting training data from diffusion models
  • Gan-leaks: A taxonomy of membership inference attacks against generative models
  • Label-only membership inference attacks
  • An analysis of single-layer networks in unsupervised feature learning
  • Imagenet: A large-scale hierarchical image database
  • Are diffusion models vulnerable to membership inference attacks? In International Conference on Machine Learning, pp. 8717–8730
  • Generative adversarial networks
  • Logan: Membership inference attacks against generative models (opens arXiv in a new tab)
  • Monte carlo and reconstruction membership inference attacks against generative models
  • Denoising diffusion probabilistic models
  • Elucidating the design space of diffusion-based generative models
  • Auto-Encoding Variational Bayes
  • Back to basics: Let denoising generative models denoise
  • Enhancing membership inference attacks on diffusion models from a frequency-domain perspective (opens arXiv in a new tab)
  • Microsoft coco: Common objects in context
  • Flow Matching for Generative Modeling
  • Flow Straight and Fast: Learning to Generate and Transfer Data with Rectified Flow
  • Membership inference attacks against diffusion models
  • Comprehensive privacy analysis of deep learning: Passive and active white-box inference attacks against centralized and federated learning
  • M. Pinkney
  • Hierarchical Text-Conditional Image Generation with CLIP Latents
  • High-resolution image synthesis with latent diffusion models
  • Membership inference attacks against machine learning models
  • Diffusion art or digital forgery? investigating data replication in diffusion models
  • Generative modeling by estimating gradients of the data distribution
  • Score-Based Generative Modeling through Stochastic Differential Equations
  • Pandora's white-box: Precise training data detection and extraction in large language models (opens arXiv in a new tab)
  • Privacy risk in machine learning: Analyzing the connection to overfitting
  • From image descriptions to visual denotations: New similarity metrics for semantic inference over event descriptions
  • Membership inference on text-to-image diffusion models via conditional likelihood discrepancy
  • Because these quantities are deterministically linked by the forward process, a prediction in one space can be algebraically converted to any other space before computing the loss
  • Columns specify the direct network prediction space, while rows specify the space in which its squared error is measured
  • This model is trained over the same settings as stated in Table 8 except no data augmentation and for 2000 epochs
  • The endpoint stencil is fixed at $\Delta=2.5$, $k=1$, matching the main DDPM experiments
  • Each support level is evaluated using $\lfloor q/m\rfloor$ independent noise draws
  • Under the idealized factorization $L_{\theta}(x,\lambda)=H(x)\tilde{L}_{\theta}(x,\lambda)$, the unstabilized log-loss contains the additive offset $\log H(x)$
  • This removes antisymmetric profile variation over the entire window, including nonlinear variation
  • Let $M \in \{0,1\}$ denote membership, abbreviate $S = S_x$, $S_{\pm} = S_{x,\pm}$, and $O = O_x(\Delta)$, and write $\text{Var}_m$ and $\text{Cov}_m$ for variance and covariance conditional on $M = m$
  • The query center is fixed at the deployed $\lambda^* = 0.75$
  • One-reference contrasts use $\lceil q/2 \rceil$ draws at the center and $\lfloor q/2 \rfloor$ at the reference, assigning the remaining query to the center
  • \tag {16} $$
  • The resulting residuals satisfy
  • \tag {17} $$
  • Native prediction heads also have different output coordinates and parameter Jacobians
  • Averaging over the same noise draws preserves this relation, so the single-timestep rankings, ROC curves, and AUC are unchanged
  • Conversely, for $g(t) = t^2$, which is strictly increasing, the integrand is positive
  • A distribution concentrated at one interior timestep instead gives equality throughout
  • This fixes lower reconstruction loss as member-like at every noise level
  • These correspond to flow times 0.407, 0.593, and 0.731
  • Appendix E.4 reports the full attack results across all nine prediction/loss configurations, with and without augmentation
  • TSC uses the endpoint stencil with $\Delta = 2.5$ and five noise draws per trajectory point ($q = 15$)
  • The shorter training horizon weakens membership leakage for every attack, particularly on STL-10-U and Tiny ImageNet, yet TSC remains the strongest method under every metric and dataset
  • >Method</td><td colspan=
  • Same protocol as Table 13
  • The 4K checkpoints reproduce the no-flip training regime commonly used in prior diffusion-MIA evaluations
  • ><tr><td rowspan=
  • The non-augmented models are trained for 2000 epochs, while the augmented counterparts are trained for 4000 epochs
  • >Method</td><td rowspan=
  • The nominal log-SNR grid spans $[-5.5, 5.5]$ in increments of 0.25, with each coordinate mapped to the nearest available diffusion timestep
  • The curves also characterize the sensitivity to the chosen noise level: reference calibration reduces difficulty-related variation, while the available membership signal can still vary along the diffusion trajectory