Intriguing Properties of Data Attribution on Diffusion Models

Xiaosen Zheng, Tianyu Pang, Chao Du, Jing Jiang, Min Lin · DOI

Introduction

The rapid adoption of diffusion models like Stable Diffusion has brought transformative capabilities to digital art and content creation. However, this progress is accompanied by pressing legal and ethical questions regarding copyright and fair compensation. Data attribution—the ability to trace a generated image back to the specific training samples that influenced its creation—is essential for addressing these concerns. Yet, standard attribution methods often struggle with the immense scale and multi-step denoising complexity of modern diffusion architectures.

The Challenge of Diffusion Attribution

Attributing influence in diffusion models is inherently difficult. Unlike simple classifiers, these models are massive, non-convex, and involve a complex generative trajectory. Previous state-of-the-art methods like TRAK (Tracing with Randomly-projected Aligned Kernels) were primarily designed for discriminative tasks. When directly applied to diffusion models using the standard training objective (denoising error, $L_{simple}$), the resulting attribution performance is often mediocre and computationally expensive.

D-TRAK: An Efficient and Intriguing Solution

This paper introduces D-TRAK (Diffusion-TRAK), an adaptation of the TRAK algorithm specifically optimized for generative diffusion models. D-TRAK incorporates two key innovations:

  1. Gradient Projection: To handle the millions of parameters in a U-Net, D-TRAK uses random projections to map high-dimensional gradients into a computationally tractable lower-dimensional space ($k \approx 32,768$).
  2. The "Intriguing" Design Choice: While standard attribution theory suggests using the gradient of the actual training loss ($L_{simple}$), the authors discovered that using the gradient of the squared norm of the predicted noise ($L_{square} = \|\epsilon_\theta\|^2_2$) yields significantly better results. This "theoretically unjustified" choice appears to better retain the training data's signal within the gradients compared to the standard denoising loss.

Empirical Performance and Efficiency

D-TRAK demonstrates remarkable robustness and accuracy across benchmarks like CIFAR-10, CelebA, and ArtBench. A primary metric for evaluation is the Linear Datamodeling Score (LDS), which measures how well attribution scores predict changes in model performance when specific data points are removed.

LDS performance of D-TRAK vs. TRAK across training epochs and sampling timesteps.

As illustrated in the figure above, D-TRAK consistently and significantly outperforms the original TRAK method. Notably, D-TRAK's performance remains high even with as few as 10 sampled timesteps, making it substantially faster for large-scale applications than methods requiring the full denoising trajectory. Furthermore, D-TRAK shows consistent performance when using the final model checkpoint, whereas previous methods were often sensitive to specific training epochs.

Counterfactual Validation

To verify that D-TRAK identifies truly influential images, the authors conducted "leave-one-out" tests. They removed the top 1,000 "influencers" identified by different methods and retrained the models from scratch.

CLIP similarity after removing top influencers; lower similarity indicates more effective attribution.

The results, measured by CLIP similarity, show that removing D-TRAK's identified proponents causes a much larger deviation from the original generated output than removing those identified by TRAK or random selection. This confirms that D-TRAK more accurately identifies the training samples responsible for specific visual and stylistic features in the generated output.

Conclusion

D-TRAK offers a powerful and efficient framework for data attribution in diffusion models. Its success with "unjustified" loss functions suggests that our current theoretical understanding of data influence in complex generative landscapes is still incomplete. While the exact mechanism behind this phenomenon remains a subject for future research, the empirical results provide a clear path forward for building more transparent and accountable generative AI systems.

Summary updated

BibTeX
@inproceedings{zheng2024intriguing,
  author = {Xiaosen Zheng and Tianyu Pang and Chao Du and Jing Jiang and Min Lin},
  title = {{Intriguing Properties of Data Attribution on Diffusion Models}},
  booktitle = {International Conference on Learning Representations},
  year = {2024},
  url = {https://openreview.net/forum?id=vKViCoKGcB},
}
Figure