HyDRA: Hypergradient Data Relevance Analysis for Interpreting Deep Neural Networks

Yuanyuan Chen, Boyang Li, Han Yu, Pengcheng Wu, Chunyan Miao

Introduction

Deep Neural Networks (DNNs) are often criticized as "black boxes," making it difficult to understand why a model reaches a specific decision. Data attribution aims to solve this by identifying which training samples most influenced a particular prediction. While Influence Functions (IF) have been the standard approach, they suffer from two major limitations: they only consider the model's final state (ignoring the training trajectory) and they are computationally expensive due to the need for Inverse Hessian calculations.

The HYDRA Framework

HYDRA (Hypergradient Data Relevance Analysis) shifts the focus from a static snapshot of the final model to the entire optimization process. By "unrolling" the gradient descent trajectory, HYDRA tracks how a marginal change in a training sample's weight ripples through every update step.

HYDRA tracks the training trajectory to capture global influence, whereas Influence Functions (IF) are limited to local approximations on the final loss surface.

Hessian-Free Approximation

The mathematical core of HYDRA is a "Hessian-free" approximation. Calculating second-order derivatives (Hessians) for millions of parameters is often infeasible. The authors provide theoretical proofs (Theorems 1 & 2) showing that removing the Hessian term from the recurrence equations introduces an error that is both bounded and vanishing as the learning rate decays. This allows HYDRA to achieve a 900x speedup over traditional Hessian-aware methods.

Experimental Results

The researchers evaluated HYDRA using LeNet-5 and DenseNet-40 architectures across three benchmark datasets: MNIST, Fashion-MNIST, and CIFAR-10.

Superior Noise Detection and Fidelity

HYDRA significantly outperforms IF in practical tasks:

  • Data Cleaning: On MNIST with 80% label noise, HYDRA identified poisoned data with 98.31% accuracy, compared to 90.07% for IF.
  • Fidelity: HYDRA maintains a much higher Spearman’s rank correlation (0.986) with the true influence than IF (0.820), making it a more reliable proxy for model interpretation.

Inter-class Competition

By generating contribution heatmaps, HYDRA reveals how different classes compete for the model's attention. For example, in Fashion-MNIST, samples from the "Coat" class may negatively influence the prediction of a "Pullover," highlighting the semantic similarities that confuse the network.

Contribution heatmaps for MNIST, Fashion-MNIST, and CIFAR-10 show the relevance and competition between different classes during training.

Conclusion and Future Work

HYDRA provides a scalable, accurate, and trajectory-aware framework for data attribution. While it offers massive speedups, tracing every training sample still presents memory challenges for extremely large "foundation models." Future research may extend this hypergradient approach to generative models like Large Language Models (LLMs) and Diffusion models, where understanding data influence is increasingly critical for safety and alignment.

Summary updated

BibTeX
@inproceedings{chen2021hydra,
  author = {Yuanyuan Chen and Boyang Li and Han Yu and Pengcheng Wu and Chunyan Miao},
  title = {{HyDRA: Hypergradient Data Relevance Analysis for Interpreting Deep Neural Networks}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2021},
  doi = {10.1609/aaai.v35i8.16871},
}
Figure