Skip to main content
QUICK REVIEW

[Paper Review] Gradients of Counterfactuals

Mukund Sundararajan, Ankur Taly|arXiv (Cornell University)|Nov 8, 2016
Explainable Artificial Intelligence (XAI)Computer Science12 references79 citations
TL;DR

This paper introduces Interior Gradients, a method to improve feature importance attribution in deep neural networks by computing gradients of counterfactual inputs formed by scaling down the original input. Unlike standard gradients, which can vanish due to network saturation, Interior Gradients better capture meaningful feature contributions and sum exactly to the prediction score, enabling reliable, easy-to-implement interpretability without architectural modifications.

ABSTRACT

Gradients have been used to quantify feature importance in machine learning models. Unfortunately, in nonlinear deep networks, not only individual neurons but also the whole network can saturate, and as a result an important input feature can have a tiny gradient. We study various networks, and observe that this phenomena is indeed widespread, across many inputs. We propose to examine interior gradients, which are gradients of counterfactual inputs constructed by scaling down the original input. We apply our method to the GoogleNet architecture for object recognition in images, as well as a ligand-based virtual screening network with categorical features and an LSTM based language model for the Penn Treebank dataset. We visualize how interior gradients better capture feature importance. Furthermore, interior gradients are applicable to a wide variety of deep networks, and have the attribution property that the feature importance scores sum to the the prediction score. Best of all, interior gradients can be computed just as easily as gradients. In contrast, previous methods are complex to implement, which hinders practical adoption.

Motivation & Objective

  • To address the limitation of standard gradients in deep networks, where important features can show near-zero gradients due to saturation.
  • To develop a method for feature importance that is simple to implement, requiring no network instrumentation or complex modifications.
  • To ensure that feature importance scores sum exactly to the model's prediction, satisfying the attribution property.
  • To enable practical, intuitive interpretation of deep learning models for practitioners without requiring deep architectural knowledge.

Proposed method

  • Compute gradients of the model’s output with respect to a scaled-down version of the input, where each input feature is multiplied by a scalar α ∈ [0,1], forming a counterfactual input.
  • Define Interior Gradients as the gradient of the model output with respect to the input at α = 1, evaluated along the path from the origin to the original input.
  • Use the path integral of gradients along the interpolation from zero input to the original input to compute a more robust and consistent attribution.
  • Apply the method to diverse architectures: Inception for image classification, a ligand-based virtual screening network with categorical features, and an LSTM for language modeling.
  • Visualize feature importance by scaling pixel intensities in the original image according to their Interior Gradient magnitude, producing more intuitive saliency maps.
  • Ensure the sum of all feature importance scores equals the model’s output prediction, satisfying the attribution property.

Experimental results

Research questions

  • RQ1Can standard gradients reliably reflect feature importance in deep networks, especially when the network is saturated?
  • RQ2How can feature importance be computed without modifying the network architecture or requiring complex instrumentation?
  • RQ3Can a simple, gradient-based method produce attribution scores that sum exactly to the model’s prediction?
  • RQ4Does the proposed method yield more intuitive and consistent saliency maps across diverse deep learning models?

Key findings

  • Standard gradients often fail to highlight relevant features in image classification, such as the camera body in a reflex camera image, instead assigning high importance to irrelevant regions like the left or top of the image.
  • After ablating irrelevant image regions, the model’s prediction score remained nearly unchanged (e.g., 0.9938 to 0.9966), confirming that high gradients do not correspond to actual feature importance.
  • Interior Gradients produce more intuitive saliency maps that correctly highlight the camera and relevant context, aligning with human perception.
  • In the ligand-based virtual screening network, Interior Gradients correctly attributed importance to atoms with distinct chemical environments, even when standard gradients failed due to saturation.
  • For the LSTM language model, Interior Gradients correctly identified that 'more' was predictive of the next word 'than', while standard gradients gave near-zero and counterintuitive attributions.
  • The sum of Interior Gradient scores across all features closely matched the model’s output prediction (e.g., 0.5322 vs. 0.5307 for 'than'), satisfying the attribution property.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.