TL;DR
Researchers have developed JaRS (Jacobian Row Sums), a new method to pinpoint exactly which pixels a diffusion model has "memorized" from its training data. Unlike previous methods that required comparing a generated image to a "null" version, JaRS works directly on the target model by analyzing the row sums of the denoiser's Jacobian, effectively distinguishing between genuine image smoothing and verbatim data replication.
What Problem Does This Paper Address?
Diffusion models like Stable Diffusion are incredibly creative, but they have a "memory" problem. Sometimes, they don't just learn concepts; they memorize specific regions of training images—like a particular watermark, a unique product, or a specific interior layout—and reproduce them verbatim. This raises significant copyright and privacy red flags.
To fix this, we first need to find the "copied" pixels. Previous state-of-the-art methods looked at the diagonal of the denoiser Jacobian, which essentially measures how much a pixel's output changes when you nudge its input. If the value is small, the model is ignoring the input, which suggests memorization.
However, there’s a catch: the diagonal is also small in smooth, predictable regions (like a clear blue sky) because the model "averages" over many neighboring pixels. To tell the difference, previous methods used "contrast"—they had to run the model twice (once with a null prompt) and subtract the results. This is impossible for unconditional models (which have no prompts) or when you don't have access to early training checkpoints.
Methods
The authors introduce JaRS (Jacobian Row Sums). Their key insight is that while the diagonal of the Jacobian is small for both memorized and smooth regions, the row sum behaves differently:
- In smooth regions: The model acts as a mean-preserving filter. It averages nearby pixels, so the weights in a row sum up to approximately 1.
- In memorized regions: The model's output is "locked" to a training sample. It ignores input perturbations entirely, causing the row sum to drop toward 0.
The researchers further refined this into JaRS+, a two-stage pipeline:
- Image-level Detection: At an early denoising step (high noise), they use a summary statistic of the JaRS map to decide if the image contains any memorized content.
- Pixel-level Localization: If memorization is detected, they compute the full JaRS map at an intermediate denoising step to produce a precise mask.
Computationally, JaRS is efficient. It uses Jacobian-vector products (JVPs), requiring only a few extra forward passes of the model rather than expensive backpropagation or randomized probes.
Datasets
The study evaluated JaRS+ across several models and benchmarks:
- Stable Diffusion (v1.4 and v2.1) & Realistic Vision v5.1: Evaluated using the Webster benchmark, which contains prompts known to trigger "verbatim" copies (Template, Matching, and Retrieved verbatims).
- Unconditional Diffusion Transformer (DiT-B/2): The authors created a new benchmark by training a DiT on FFHQ face images with injected "memorization" (watermarks and duplicated images). This allowed them to test localization in a setting where "null prompts" simply don't exist.
Key Insights and Ideas
- The "Aha!" Moment: The row sum is a "contrast-free" metric. By replacing the need for a second "null" evaluation with the constant value of 1 (the expected sum for a standard filter), they made localization possible for any diffusion model.
- Two-Timescale Separation: Memorization "locks in" early. The authors found they could detect if a prompt would result in a copy after just 5 out of 50 sampling steps, long before the image is actually recognizable.
- Posterior Collapse: The paper provides a theoretical bridge, showing that memorization is essentially a "collapse" of the model's posterior distribution. The Jacobian row sum is a direct mathematical probe into this collapse.
Key Results
JaRS+ consistently outperformed existing contrast-based methods, even though it requires less information:
- Unconditional Models: On the DiT benchmark, JaRS+ improved the Mean Intersection-over-Union (mIoU) from 0.666 to 0.869, a massive jump for a setting where previous methods struggled.
- Stable Diffusion: In the "Template Verbatim" setting (where a specific region is copied), JaRS+ achieved an mIoU of 0.969 on SD v1.4, beating the best contrast-based baseline.
- Mitigation: The authors showed that by using the JaRS+ mask to "resample" only the memorized pixels, they could remove the copied content (reducing the copy rate from 20.5% to 9.0%) while leaving the rest of the generated image virtually untouched.
Limitations and Future Work
- Hyperparameter Tuning: JaRS+ currently requires a small labeled "development set" to choose the best denoising steps ($l$ and $d$) and the detection threshold ($\tau$). While $\tau$ can be calibrated using only non-memorized images, finding the optimal steps still benefits from known examples of memorization.
- Single-Step Models: The current theory relies on the dynamics of multi-step denoising. Extending this to "distilled" or single-step generators is an open challenge.
- Refinement: While the localization is excellent, the authors note that the image-level detector can sometimes be overly conservative on models like Realistic Vision, occasionally rejecting global copies that a human might still consider "memorized."
Summary updated