Characterizing Memorization in Diffusion Language Models: Generalized Extraction and Sampling Effects
Authors: Xiaoyu Luo, Wenrui Yu, Qiongxiu Li, Johannes Bjerva
Organizations: Department of Computer Science, Aalborg University, Copenhagen, Denmark · Department of Electronic Systems, Aalborg University, Copenhagen, Denmark
Autoregressive language models (ARMs) have been shown to memorize and occasionally reproduce training data verbatim, raising concerns about privacy and copyright liability. Diffusion language models (DLMs) have recently emerged as a competitive alternative, yet their memorization behavior remains largely unexplored due to fundamental differences in generation dynamics. To address this gap, we present a systematic theoretical and empirical characterization of memorization in DLMs. We propose a generalized probabilistic extraction framework that unifies prefix-conditioned decoding and diffusion-based generation under arbitrary masking patterns and stochastic sampling trajectories. Theorem 4.3 establishes a monotonic relationship between sampling resolution and memorization: increasing resolution strictly increases the probability of exact training data extraction, implying that autoregressive decoding corresponds to a limiting case of diffusion-based generation by setting the sampling resolution maximal. Extensive experiments across model scales and sampling strategies validate our theoretical predictions. Under aligned prefix-conditioned evaluations, we further demonstrate that DLMs exhibit substantially lower memorization-based leakage of personally identifiable information (PII) compared to ARMs.
Figures & tables
Figure 1: A randomly sampled verbatim PII memorization example from diffusion language model ( LLaDA-8B) . This case shows that finer-grained generation resolution (i.e., more steps) is more prone to verbatim recovery of training data. ⟨ M ⟩ denotes a mask token; blue highlights matched strings, and red highlights mismatches.
Figure 2: Empirical vs. theoretical memorization probability measured by DLM-1.1B on 200 SlimPajama examples. Empirical pz is estimated from 100,000 random-decoding generations; theoretical p^z is estimated from 1,024 mask-patterns at a fixed mask ratio ( [0.2,0.3] ).
Figure 3: Empirical log-probability ratio across decoding steps ( DLM-1.1B ). We sample 200 mask-patterns and, for each, run 10,000 random decoding generations to estimate success probabilities at steps {1,2,5,10,per-token} . We plot the median log-probability difference to one-step (baseline), with 95% bootstrap Confidence Intervals (CIs) across generation-trajectories.
Model
Step
Email
Phone
p = 50%
p = 99%
p = 50%
p = 99%
DLM-1.1B
One
0
0
0
0
Max
16
7
0
0
ARM-1.1B
N/A
213
139
5
3
LLaDA-8B
One
9
8
7
3
Max
179
122
23
17
Table 1: Generalized (n,p) -discoverable Extraction. Number of memorized samples at target probabilities p under a query budget of n=10,000 on 3,000 completion prompts, for different PII types.
Figure 4: Per-token-step email hit rates under different model scales (170M/629M/1.1B). Each bar reports the Extractable rate over 3,000 samples, measured as whether an email can be recovered within a querying budget n , at fixed p=0.5 .
Figure 5: Validating memorization of training data. We compare the reconstruction likelihood from the Enron (train) against the unseen from the TREC 2007 Spam (test), which is from the same domain.
Appendix figures & tables5 assets
Supplementary material from the paper’s appendix.
Appendix
Figure 6: Paired Q-Q plots (left) and CDF comparisons (right) for three cases for DLM.
Figure 7: Paired Q-Q plots (left) and CDF comparisons (right) for three cases for ARM.
Figure 8: Comparison of empirical and theoretical memorization probabilities under different sampling masked-patterns quantities. As the number of samples increases, the empirical values converge towards the theoretical identity line.
Model
Step
Email
Phone
p = 10%
p = 50%
p = 90%
p = 99%
p = 10%
p = 50%
p = 90%
p = 99%
DLM-170M
One
0
0
0
0
0
0
0
0
Max
7
2
0
0
0
0
0
0
DLM-629M
One
0
0
0
0
0
0
0
0
Max
17
10
7
4
0
0
0
0
DLM-1.1B
One
0
0
0
0
0
0
0
0
Appendix
Table 2: Generalized (n,p) -discoverable Extraction. Number of memorized samples at target probabilities p under a query budget of n=10,000 on 3,000 completion prompts, for different PII types.
Figure 9: Validating memorization of training data under different DLM scales. We compare the reconstruction likelihood from the Enron (train) against the unseen from the TREC 2007 Spam (test), which is from the same domain.
Memorization in large language models has been studied almost exclusively through prefix-conditioned extraction, a natural choice for autoregressive models. However, diffusion language models (DLMs) can denoise masked tokens at arbitrary positions. Thus, prefix-only probing reveals only one facet of memorization in DLMs and significantly underestimates the risk of training-data extraction. In order to realistically model extractability of training data in DLMs, we introduce infilling extraction, a data-extraction protocol parameterized by an arbitrary binary mask that subsumes prefix-only probing and accounts for the bidirectional inductive bias of DLMs. Instantiating it on LLaDA-8B and Dream-7B across five extraction modes, three training pipelines, and three corpora covering verbatim and partial leakage, we find that mask geometry governs extractability: edge-conditioned masks extract up to three times more verbatim sequences than prefix-conditioned ones, and bidirectional access opens channels inaccessible in autoregressive models. In particular, we show that a realistic adversary with access to training data where personally identifiable information has been redacted, can even achieve higher recall on extracting redacted email addresses from DLMs than from scale-matched autoregressive models. Tunable parameters for decoding measurably affect extraction performance, while a follow-up supervised finetuning stage does not eliminate the prior memorization.
Yihan Wang, N. Asokan
University of Waterloo · KTH Royal Institute of Technology
Diffusion language models (DLMs) have recently emerged as an alternative modeling paradigm to autoregressive LMs, offering advantages such as parallel generation and bidirectional context modeling. Despite growing interest in their generative capabilities, the privacy risks of DLMs remain underexplored. We identify a phenomenon termed token-level memorization asymmetry through theoretical analysis of diffusion training dynamics. Building on this finding, we propose Q-Skew, a quantile-weighted skewness-based indicator for membership inference on finetuned DLMs. Experiments across multiple fine-tuning datasets and models show that our method outperforms existing baselines. Moreover, we show that Q-Skew can also facilitate other privacy violations, such as PII extraction. Our findings reveal a previously underexplored privacy attack surface and highlight the need for systematic privacy evaluation of DLMs.
Shengfang Zhai, Leo Marchyok, Yuling Shi +4
National University of Singapore · Oregon State University · Shanghai Jiao Tong University +1
Diffusion Language Models (DLMs) offer attractive advantages over Auto-Regressive (AR) models, such as full-attention parallel decoding and flexible generation. However, standard DLM training uses a static, single-step masked prediction objective that never exposes the model to the progressive denoising dynamics of inference, and forces all contextual information to be maintained purely through token-space attention, which becomes increasingly diluted as context length grows. We propose MemDLM (Memory-Enhanced DLM), which introduces a second memory channel by embedding a simulated denoising trajectory into training via Bi-level Optimization. An inner loop updates a set of fast weights, forming a Parametric Memory that captures the local trajectory experience, while an outer loop updates the base model conditioned on this memory. By offloading part of the memorization burden from token-space attention to parameter space, MemDLM yields faster convergence, stronger long-context representations, and lower training loss, even when the fast weights are discarded at inference time. Re-enabling the inner loop at inference provides an additional prompt-specific adaptation effect, where the Parametric Memory acts as an emergent in-weight retrieval mechanism on challenging Needle-in-a-Haystack tasks. Code: https://github.com/JarvisPei/MemDLM.
Zehua Pei, Hui-Ling Zhen, Weizhe Lin +4
The Chinese University of Hong Kong · Huawei Technologies Co., Ltd