Intriguing Properties of Data Attribution on Diffusion Models

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

In the rapidly evolving world of generative AI, we often ask: "Where did this image come from?" As diffusion models like Stable Diffusion become mainstream, answering this question—known as data attribution—is no longer just an academic exercise. It is a legal and ethical necessity for ensuring artists are credited and compensated when their work influences a model's output.

A recent paper presented at ICLR 2024, titled "Intriguing Properties of Data Attribution on Diffusion Models," reveals a fascinating paradox: the most theoretically "correct" ways to trace data are often outperformed by "unjustified" design choices that work significantly better in practice.

TL;DR

The authors introduce D-TRAK, a highly efficient method for attributing the outputs of diffusion models to their training data. Intriguingly, they find that using theoretically "unjustified" loss functions for gradient computation—like the norm of the noise prediction rather than the training loss itself—leads to much more accurate and computationally efficient attribution than previous state-of-the-art methods.

What Problem Does This Paper Address?

Data attribution aims to identify which specific training samples most influenced a particular model output. While well-studied for simple classifiers, it is notoriously difficult for generative models like Denoising Diffusion Probabilistic Models (DDPMs).

The challenge is two-fold:

  1. Complexity: Diffusion models involve a complex, multi-step denoising process, making the relationship between a training image and a final generated image non-linear and opaque.
  2. Scalability: Standard attribution methods (like Influence Functions) require calculating Hessian matrices, which is computationally impossible for large-scale models.

Existing "tractable" methods like TRAK (Park et al., 2023) were designed for discriminative tasks. When applied to diffusion models, they often yield mediocre results. The authors sought to bridge this gap.

Methods

The authors build upon TRAK, which uses "projected gradients"—a technique that reduces the dimensionality of model gradients to make them manageable.

The standard TRAK formula relies on the gradient of the training loss ($L_{simple}$) and a specific weighting term ($Q$). The authors experimented with "diffusion-TRAK" (D-TRAK), making two radical changes:

  • Alternative Gradient Sources: Instead of using the standard training loss ($L_{simple}$), they tested gradients from "unjustified" functions like $L_{square}$ (the squared norm of the predicted noise), $L_{avg}$ (average pooling of noise), and various $L_p$ norms.
  • Simplification: They removed the weighting term $Q$, treating it as an identity matrix.

To evaluate these choices, they used the Linear Datamodeling Score (LDS), which measures how well the attribution scores predict changes in model output when subsets of data are removed.

Datasets

The study conducted extensive experiments across three diverse settings:

  • CIFAR-10: Specifically a "CIFAR-2" subset (automobiles vs. horses) for deep ablation studies.
  • CelebA: A large-scale dataset of celebrity faces (64x64 resolution).
  • ArtBench: Used to test a Stable Diffusion model fine-tuned via LoRA (Low-Rank Adaptation) on specific artistic styles like "post-impressionism" and "ukiyo-e."

Key Insights and Ideas

  • The Theory Gap: In non-convex settings like deep diffusion models, theoretical assumptions derived from convex optimization (which suggest using the training loss gradient) may actually be sub-optimal.
  • Information Retention: The authors found that $L_{square}$ gradients better retain the "fine-grained" information of the noise prediction network ($\epsilon_\theta$). By looking at the gradients of the norm of the output rather than the error relative to a target, the attribution becomes more robust.
  • Efficiency via Sparsity: D-TRAK is remarkably efficient. While standard methods might require gradients from 1,000 timesteps to be accurate, D-TRAK achieves superior performance using only 10 timesteps, representing a 100x speedup in gradient computation.
LDS performance across different timesteps
  • Checkpoint Insensitivity: Unlike previous methods that are highly sensitive to which training epoch's checkpoint is used, D-TRAK performs consistently well across various stages of model training.

Key Results

  • Superior Accuracy: On CIFAR-2, D-TRAK achieved an LDS of ~33.7%, significantly outperforming the standard TRAK baseline of ~22.4%.
  • Counterfactual Validation: The authors performed "leave-one-out" style tests. When they removed the top 1,000 "influencers" identified by D-TRAK and retrained the model, the generated images changed drastically (lower CLIP similarity and higher $L_2$ distance) compared to removing influencers identified by other methods. This proves D-TRAK is identifying the true sources of influence.
Counterfactual evaluation showing L2 distance and CLIP similarity
  • Visual Proof: Qualitative results show that D-TRAK identifies "proponents" (training images) that are visually and stylistically much closer to the generated target than those found by TRAK.

Limitations and Future Work

Despite its empirical success, the authors acknowledge a major limitation: they don't fully know why it works so well. The performance of $L_{square}$ over $L_{simple}$ remains a "counter-intuitive observation" that lacks a rigorous formal proof.

Future work includes:

  • Developing a theoretical framework that explains why norm-based gradients are superior in non-convex generative settings.
  • Testing D-TRAK on even larger models (like full-scale Stable Diffusion XL) and more diverse generative architectures beyond diffusion.
  • Exploring how these "intriguing properties" might apply to other areas, such as detecting data poisoning or identifying memorized samples in Large Language Models (LLMs).

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