Introduction
As diffusion models grow in capability and scale, they are increasingly trained on massive, often proprietary or copyrighted datasets. This raises a critical question for transparency and copyright: which specific training images are responsible for a given generated output?
Answering this question—a process known as data attribution—is notoriously difficult. Existing methods generally fall into two categories, both with significant drawbacks. Retraining-based methods, which involve removing a training image and retraining the model to observe changes, are computationally infeasible for large models. Gradient-based methods analyze the model's internal parameters to trace influence, but they require full "white-box" access to the model's code and weights, which is impossible for proprietary APIs. While simple image-similarity searches (like CLIP) exist, they often fail to capture the specific denoising logic unique to diffusion models.
To address this gap, researchers have developed Nonparametric Diffusion Attribution (NDA). NDA is a novel attribution method that operates directly on the data, requiring no access to internal model weights or gradients. It provides a powerful tool for auditing proprietary models while offering clear, patch-level visual explanations of its results.
Methodology: Nonparametric Diffusion Attribution
NDA is theoretically grounded in the analytical form of the optimal score function. In diffusion theory, models learn to denoise images over a series of timesteps. The authors leverage a mathematical proof demonstrating that, for a given dataset, the optimal denoising step can be determined by the weighted similarity of training samples.
To translate this theory into a practical tool, the researchers introduced several key technical innovations:
- Patch-Level Attribution: Instead of comparing whole images, NDA breaks images into local patches (e.g., $P \times P$). This enables fine-grained influence mapping, such as identifying that one training image influenced the eyes of a generated face while another influenced the hair.
- Multiscale Influence: By analyzing images at multiple resolutions, NDA captures both high-level structural elements at coarse scales and fine textures at granular scales.
- Convolution-Based Acceleration: Comparing every patch of a generated image against every patch in a massive training dataset is highly memory-intensive. The authors reformulated the distance calculations into convolutional operations, allowing them to utilize GPU-optimized kernels to drastically accelerate the process.
- Timestep Integration: Because diffusion occurs over many timesteps, NDA aggregates influence across a specific range of noise levels. It focuses on the "low-to-mid" noise stages, which the authors identified as the sweet spot where the most useful attribution signal resides.
Experimental Setup and Key Results
The authors evaluated NDA across several standard benchmarks, including CIFAR-10 and CIFAR-2 for rigorous ablation studies, CelebA (64x64) for complex facial features, and ArtBench-2 (256x256) for style-conditioned generation.
Superior Accuracy and Counterfactual Success
Using the Linear Datamodeling Score (LDS)—a metric that measures how well attribution predicts the effect of removing data—NDA consistently outperformed all other nonparametric baselines. On the CelebA dataset, NDA achieved an LDS of 13.92%, nearly five times higher than traditional CLIP similarity (3.03%).
To validate these findings, the authors conducted "leave-one-out" counterfactual experiments. They removed the top 1,000 most influential images identified by NDA and retrained the model. The resulting generated images exhibited significantly larger changes (measured by $L_2$ distance) than when images were removed randomly or via CLIP similarity, proving that NDA successfully isolates highly influential data.
Visual Interpretability and Closing the Gap
NDA produces highly interpretable "heatmaps" that map specific patches in a training image to corresponding parts of the generated output, such as matching the specific brushstrokes of a painting. While "white-box" methods (like D-TRAK) that utilize model gradients still hold a performance edge, NDA significantly narrows the gap, providing the most viable alternative currently available when model internals are hidden.
Insights and Limitations
A core insight of this research is the "Optimal Learner" Assumption. Because NDA is nonparametric, it assumes the model is an optimal learner, meaning it produces the same attribution results regardless of whether the underlying architecture is a U-Net or a Transformer. Surprisingly, the empirical results show this signal remains highly accurate even for sub-optimal models.
Furthermore, the paper demonstrates that locality matters. Global image similarity metrics often miss the specific local correspondences that diffusion models exploit during generation, making NDA's patch-based approach essential.
Despite its successes, NDA has limitations. Even with convolutional acceleration, the method scales linearly with the number of training images. Attributing a single image against a billion-scale dataset (like LAION) remains computationally demanding. Additionally, while being architecture-agnostic is a strength for black-box auditing, it means NDA cannot capture specific biases introduced by a particular neural network's design. Future work will explore more complex feature extractors within the NDA framework and extend the methodology to other generative architectures, such as Flow Matching models.
Summary updated