Extracting Training Data from Diffusion Language Models via Infilling

Yihan Wang, N. AsokanNeurIPS 2026

TL;DR

Diffusion Language Models (DLMs) have been thought to leak less training data than standard left-to-right language models, largely because researchers were testing them with left-to-right prompts. By instead playing to DLMs' native strength—filling in the blanks from surrounding context—this paper shows that DLMs actually memorize and leak far more sensitive data than previously realized, opening up entirely new privacy vulnerabilities like un-redacting leaked documents and reconstructing secret user prompts from model outputs.

What Problem Does This Paper Address?

Large language models are notorious for memorizing snippets of their training data—including private emails, phone numbers, and copyrighted text. Historically, we’ve measured this risk on Autoregressive Models (ARMs, like GPT or LLaMA) using prefix-conditioning: you feed the model the beginning of a sentence and see if it spits out the exact ending from its training set.

Recently, Diffusion Language Models (DLMs) have emerged as a fast, flexible alternative to ARMs. Instead of predicting text strictly left-to-right, DLMs generate text by iteratively "denoising" masked tokens anywhere in a sequence, looking at both past and future context simultaneously. When early studies tested DLMs using standard prefix-conditioning, DLMs appeared much safer and less prone to data leakage than ARMs. The authors ask a simple, crucial question: Are DLMs actually memorizing less, or have we just been probing a bidirectional mind with a one-directional test?

Methods

To properly test DLMs, the authors introduce infilling extraction, a generalized protocol parameterized by a binary mask. Instead of just revealing the prefix, an attacker can reveal any subset of tokens as context and ask the DLM to reconstruct the missing pieces.

Under a fixed budget of revealed tokens, they test five canonical mask geometries:

  • Prefix- and Suffix-conditioned: Revealing only the start or only the end (e.g., recovering a user's prompt given the model's response).
  • Edge-conditioned: Revealing both the start and end to fill in the middle.
  • Middle-conditioned: Revealing the center to reconstruct the outer edges.
  • Random: Scattering revealed tokens uniformly.

They also introduce targeted infilling, simulating a realistic threat where an attacker obtains a legally mandated or leaked document with blacked-out Personally Identifiable Information (PII) and asks the DLM to fill in the exact redacted spans. The authors evaluate two major open-weight DLMs (LLaDA-8B and Dream-7B) across three realistic training pipelines—full fine-tuning (FT), LoRA, and Supervised Fine-Tuning (SFT)—and sweep across inference-time decoding settings like denoising steps, block sizes, and remasking strategies.

Datasets

Because the exact pre-training corpora of LLaDA and Dream aren't public, the authors induce controlled memorization by fine-tuning on 10,000 samples from three established datasets (no new benchmarks are introduced):

  • MIMIR (Pile subset): Used to test verbatim, sequence-level text extraction.
  • Enron Email Corpus: Used to test entity-level PII extraction (email addresses and phone numbers).
  • Tulu3: Used for chat-templated SFT to test whether private prompts can be extracted from responses (and vice versa).

Key Insights and Ideas

  • Surrounding context unlocks memory: DLMs have a strong bidirectional inductive bias. Giving a DLM 25 tokens at the start and 25 at the end (edge mode) extracts vastly more memorized data than giving it 50 tokens at the beginning (prefix mode).
  • DLMs open reverse leakage channels: Because ARMs read left-to-right, they cannot naturally work backward. DLMs can. In chat-tuned DLMs, an attacker who only sees a model's output can run extraction in reverse to recover the originating user's prompt.
  • Redacted documents are in danger: If a hospital or company trains a DLM on internal records and later releases a PII-redacted version of that dataset, an attacker can align masks over the [REDACTED] spans and use the DLM as a high-powered un-redaction tool.
  • Inference knobs double as privacy levers: Settings tuned for generation quality—more denoising steps, full sequence parallelism, and confidence-based remasking—significantly amplify data leakage. Conversely, restricting block sizes to mimic left-to-right decoding acts as a lightweight, inference-time defense.
  • Instruction tuning doesn't erase the past: Following up domain fine-tuning with SFT on clean chat data slightly reduces email leakage, completely fails to reduce phone number leakage, and leaves the bidirectional vulnerability intact.

Key Results

  • Mask geometry governs verbatim recall: On MIMIR Pile, edge conditioning extracts up to 3.5× more verbatim sequences than prefix conditioning (e.g., 0.72% vs. 0.29% Attack Success Rate on LLaDA-8B-LoRA, and 0.14% vs. 0.04% on Dream-7B-FT). Meanwhile, random masking recovers over 55% of individual tokens, though mostly due to local grammatical scaffolding rather than true verbatim sequence recall.
  • Reverse prompt extraction works: On Tulu3, chat-tuned LLaDA-8B and Dream-7B leak verbatim user prompts from model responses 3.36% and 1.78% of the time, respectively.
  • Closing the ARM vs. DLM gap: On Enron emails, standard dynamic-prefix probing makes LLaDA-8B look much safer than a scale-matched LLaMA2-7B (16.3% vs. 35.9% recall). However, targeted infilling boosts DLM PII recall by 2.5–4.5×, pushing LLaDA-8B's email recall to 40.5% (beating greedy LLaMA2) and Dream-7B's phone number recall from 8.0% to 35.8%.
Figure 1: Comparison between ARM and DLMs on Enron.

Limitations and Future Work

The authors note three main limitations: First, without access to base pre-training corpora, they had to study memorization induced via fine-tuning rather than native pre-training memorization. Second, they did not test preference-based alignment stages like RLHF. Third, architectural and training differences make a strictly apples-to-apples comparison between ARMs and DLMs impossible, even at matched parameter scales. Looking ahead, they suggest testing how emerging DLM speedup techniques interact with memorization, and using infilling extraction as a diagnostic tool for adjacent safety challenges like machine unlearning and membership inference.

Summary updated

Abstract

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, an adversary who obtains a PII-redacted copy of the training data can use targeted infilling to raise PII recall on fine-tuned DLMs by 2.5–4.5× over prefix-conditioned extraction, substantially narrowing the gap to a scale-matched autoregressive model and, for LLaDA on email addresses, exceeding it under greedy prefix-conditioned extraction. Tunable parameters for decoding measurably affect extraction performance, while a follow-up supervised fine-tuning stage does not eliminate the prior memorization.
BibTeX
@inproceedings{wang2026extracting,
  author = {Yihan Wang and N. Asokan},
  title = {{Extracting Training Data from Diffusion Language Models via Infilling}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=qZJHM44aet},
}
Figure