SAM: The Sensitivity of Attribution Methods to Hyperparameters

Naman Bansal, Chirag Agarwal, Anh Nguyen

Abstract

As machine learning models enter high-stakes domains, the need for reliable explanations becomes paramount. Attribution methods, which highlight influential input features, are widely used for this purpose. This paper investigates the sensitivity of these methods to their internal hyperparameters. Our findings reveal that many popular techniques are highly fragile, where minor changes in arbitrary parameters can lead to vastly different explanations. Conversely, we demonstrate that adversarially robust models naturally yield more stable and interpretable attribution maps.

Introduction: The Reliability Gap in Interpretability

Interpretability is often cited as a prerequisite for trusting AI in fields like healthcare. Attribution maps (heatmaps) are the primary tool for this, yet they often rely on heuristic hyperparameter choices. If an explanation for a medical diagnosis changes simply because of a different random seed, the method's utility is compromised. This study provides the first systematic analysis of hyperparameter sensitivity in attribution methods.

Methodology

The authors evaluated seven prominent attribution methods:

  1. Gradient-based: Vanilla Gradient, SmoothGrad (SG), Gradient $\odot$ Input (GI), and Integrated Gradients (IG).
  2. Perturbation-based: Sliding Patch (SP), LIME, and Meaningful-Perturbation (MP).

Sensitivity was tested by varying hyperparameters (e.g., sample size, patch size, random seeds) and measuring the visual and functional consistency of the resulting heatmaps across 1,735 ImageNet images. Consistency was quantified using metrics like the Structural Similarity Index (SSIM) and Spearman rank correlation.

The Fragility of Explanations

A core finding is that perturbation-based methods are particularly unstable. For instance, LIME and MP can produce entirely different heatmaps for the same input and prediction just by changing the random seed used for masking.

Attribution maps generated by different methods (LIME, SP, MP, SG) vary significantly as internal hyperparameters like random seeds or patch sizes are adjusted.

As shown in Figure 1, the visual explanation for a "match" prediction can shift from focusing on the flame to focusing on the matchstick or background noise depending on the chosen patch size or blur radius. This variability suggests that many "explanations" may be artifacts of hyperparameter tuning rather than reflections of model logic.

The Robustness Bonus

The study highlights a significant advantage of adversarially robust models. While standard models often produce noisy gradients that require "de-noising" (which itself introduces hyperparameter sensitivity), robust models produce naturally clean and stable gradients.

Comparison of gradient-based explanations for standard and robust models under clean and noisy conditions. Robust models (ResNet-R, GoogLeNet-R) exhibit much higher stability (SSIM) and interpretability.

Figure 4 illustrates that when noise is added to an input, the gradients of standard models become uninterpretable. In contrast, robust models (denoted with -R) maintain consistent, object-aligned heatmaps. Quantitatively, robust models were found to be 2.4x less variable across hyperparameters and 36x more similar under input noise.

Key Results and Implications

  • De-noising Pitfalls: Aggressive smoothing of a standard model's explanation can make it look like a robust model's explanation, potentially masking the underlying fragility of the standard model.
  • Sensitivity Metrics: LIME's accuracy scores varied by over 130x when changing superpixel counts compared to random seeds. MP showed a 74x variance increase when adjusting optimization iterations.
  • Functional Impact: Hyperparameter changes don't just affect aesthetics; they significantly alter downstream performance on localization and deletion/insertion benchmarks.

Conclusion

The sensitivity of attribution methods to hyperparameters is a critical but overlooked factor in model interpretability. The authors propose that sensitivity should be a standard metric for evaluating new attribution techniques. Moving forward, the community must choose between exact methods with fewer hyperparameters and approximate methods that, while flexible, may introduce dangerous levels of instability. Adversarial robustness appears to be a promising path toward inherently more reliable explanations.

Summary updated

BibTeX
@inproceedings{bansal2020sam,
  author = {Naman Bansal and Chirag Agarwal and Anh Nguyen},
  title = {{SAM: The Sensitivity of Attribution Methods to Hyperparameters}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2020},
  doi = {10.1109/cvpr42600.2020.00870},
}
Figure