# Axiomatic Attribution for Deep Networks

Integrated Gradients attributes deep network predictions using axioms that gradients violate

Mukund Sundararajan, Ankur Taly, Qiqi Yan · arXiv · 2017-3-4

- **Problem** Gradient-based attributions fail when the output is flat at the input, even though it differs from the baseline. The gradient there is zero, so the feature gets no credit.
- **Method** Integrated Gradients averages gradients along a straight path from baseline to input, scaled by the input difference.
- **Results** The authors prove that Integrated Gradients is the only path method that gives symmetric variables identical attributions.

## Why attribution is hard to check

Attribution assigns each input feature a score for its contribution to one prediction, measured relative to a baseline input. Such scores help developers debug a model, extract rules from it, and show a doctor which part of an image drove a recommendation. The difficulty is that these scores are hard to check empirically. Perturbing pixels to test a score can produce unnatural images, so a drop in score may reflect the network's unfamiliarity rather than the quality of the attribution.

Human-drawn bounding boxes fail too, because the context around an object can also drive the prediction.

Unable to separate errors of the model from errors of the attribution method by testing, the authors chose an axiomatic route. They state properties that any attribution method should have, then design a method that meets them. The need for a baseline comes from how people assign blame: they judge a cause against its absence. A deep network models that absence with a single baseline input, such as the black image for object recognition.

## Two axioms and where earlier methods break them

Gradients are the natural starting point, because for linear models the product of coefficient and feature value is the usual debugging view. The gradient of the output with respect to the input plays the role of the coefficient, so its product with the feature values is a common attribution. But gradients break Sensitivity(a).

Sensitivity(a) asks that a feature which differs between input and baseline, when the predictions differ, receives a non-zero attribution. Take f(x) = 1 - ReLU(1 - x) with baseline 0 and input 2. The output changes from 0 to 1, yet the function is flat at x = 1, so the gradient attribution to x is zero. This is the failure mode: a flat spot at the input hides a change that the baseline comparison reveals.

Implementation Invariance asks that functionally equivalent networks get identical attributions, whatever their internal implementation. Gradients satisfy it, because the chain rule for gradients is essentially a statement about implementation invariance. So these two methods fail Implementation Invariance, and their attributions can shift with network details that don't change the function.

Deconvolutional networks and Guided back-propagation also break Sensitivity(a). They pass signal through a ReLU only when the ReLU is active at the input, so a feature with zero gradient at the input gets zero attribution even when the baseline gradient is non-zero. DeepLift and LRP fix the sensitivity problem by using a baseline, but they trade it for the invariance problem.

## How Integrated Gradients is computed

The key idea is to replace the gradient at a single point with the average gradient along a straight path from the baseline to the input. The authors chose the straight path because it is the simplest one to define. Integrated Gradients needs no change to the network and no retraining; it needs the input, the baseline and gradient calls.

For input dimension i, the attribution is defined as follows. \\\[ \\text{IntegratedGrads}\_i(x) ::= (x\_i - x'\_i) \\times \\int\_{\\alpha=0}^{1} \\frac{\\partial F(x' + \\alpha \\times (x - x'))}{\\partial x\_i}\\, d\\alpha \\\] Here \\(F\\) is the network, \\(x'\\) is the baseline and \\(x\\) is the input. The integral runs over \\(\\alpha\\) from 0 to 1, so the gradient is taken at points along the path, and the result is scaled by the difference \\(x\_i - x'\_i\\).

The baseline is fixed before the method runs: a black image for images, and an all-zero embedding vector for text.

The attributions over all features add up to the output at the input minus the output at the baseline. This is the Completeness property, and it is proven by Proposition 1 in the paper. Completeness also gives Sensitivity(a) directly: when only one variable differs, its attribution must carry the whole change in output. Reading the attributions as a split of the output assumes the baseline score is near zero, which the authors recommend checking.

In practice the integral is approximated by a sum of gradients at evenly spaced points along the path, with m steps. Each point is a scaled version of the input difference added to the baseline, so the sum needs only gradient calls. The authors found that 20 to 300 steps approximated the integral within 5%. So they recommend checking that the attributions add up to F(x) minus F(x') and raising m if they don't.

## Why the straight path and not other methods

Integrated Gradients is one member of path methods, which integrate gradients along any monotone path between baseline and input. Every path method satisfies Implementation Invariance and Completeness, and it also satisfies Sensitivity(a).

The authors rely on Friedman's theorem for this result. Sensitivity(b) says a variable the function doesn't depend on gets zero attribution, and Linearity says the attribution of a weighted sum of networks is the weighted sum of their attributions.

Symmetric variables are ones whose swap leaves the function unchanged. A symmetry-preserving method gives identical attributions to symmetric variables when their input and baseline values match. Theorem 1 states that Integrated Gradients is the unique path method with this property. This is the reason the straight path is treated as canonical.

Averaging over several paths can also satisfy all the axioms in Theorem 1, and Shapley-Shubik is one such method. For min(x1, x2) with baseline (0, 0) and input (1, 3), Integrated Gradients gives the whole change to x1. Shapley-Shubik instead gives 1/2 to each variable, and the authors call the choice between these two results somewhat subjective.

The cost also differs: on a 100X100 image input, n is 10000, so n! is enormous, and one Shapley-Shubik path needs n calls. Integrated Gradients operates with 20 to 300 calls, compared to n calls per path for Shapley-Shubik.

## What the applications show

The authors applied the method to a GoogleNet object recognition network trained on ImageNet, using the black image as baseline. Integrated gradients were compared with the product of the gradients and the image. The integrated gradient maps better reflect distinctive features of the input image, and the comparison is visual with no numeric score.

For a diabetic retinopathy network that predicts severity grade from retinal fundus images, the attributions concentrate on a few pixels that look like lesions. Inside the lesions the attribution is negative, while at the periphery it is positive, which the authors read as the network focusing on lesion boundaries. The authors checked these pixels against lesions visible to a human annotator.

On a question classification model built on the text categorization architecture, the attributions agree with the known rule that 'how many' signals a numeric answer. They also suggest 'total number' as a new trigger for numeric answers. 'charles' is an undesirable correlation, since it acts as a trigger for yes/no questions.

On an LSTM-based translation model, the authors used 100 to 1000 steps because the network is highly nonlinear.

For a molecule active on task PCBA-58432 under the W2N2 network, atom-pairs with a bond between them contribute 46% of the prediction score. On W1N2, several atoms with different bonding neighborhoods received identical attributions. This pointed the authors to atom and atom-pair features that were not fully convolved.

## Limitations and open questions

Integrated Gradients doesn't address interactions between input features or the logic the network uses. The authors note that attention alone can't serve as an attribution, since an LSTM has several routes of influence.

The baseline matters: a baseline can be adversarial, and an artifact of that baseline can show up in the attributions. The all-zero text embedding is not a valid input, and the authors justify it by training pushing unimportant words toward small norms.

The local approximation method of Ribeiro et al. doesn't guarantee sensitivity, because its region may not escape flat parts of the prediction function. The authors also note that the local approximation is expensive for dense inputs such as images.

## Paper info

- **Authors**: Mukund Sundararajan, Ankur Taly, Qiqi Yan
- **Venue**: arXiv · Preprint
- **First published**: 2017-3-4
- **Added**: 2026-11-12
- **Updated**: 2017-6-13
- **Version**: v2
- **arXiv**: 1703.01365
- **Category**: cs.LG
- **Original paper terms**: [arXiv non-exclusive 1.0](https://arxiv.org/licenses/nonexclusive-distrib/1.0/)
- **What we show**: Paper info and commentary

[Original paper ↗](https://arxiv.org/abs/1703.01365v2) · [PDF ↗](https://arxiv.org/pdf/1703.01365v2)

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

## Quote from the paper

Mukund Sundararajan, Ankur Taly, Qiqi Yan (2017). Axiomatic Attribution for Deep Networks. arXiv:1703.01365v2. https://arxiv.org/abs/1703.01365v2

**BibTeX**

```
@misc{sundararajan2017axiomatic,
  title = {{Axiomatic Attribution for Deep Networks}},
  author = {Mukund Sundararajan and Ankur Taly and Qiqi Yan},
  year = {2017},
  eprint = {1703.01365},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1703.01365v2}
}
```

## Other paper commentary

- [On the difficulty of training Recurrent Neural Networks](https://refivu.com/en/papers/4d1ee0a2-985d-499a-b4ad-403b5731bcd8-on-the-difficulty-of-training-recurrent-neural-networks.md)
- [Spectral Networks and Locally Connected Networks on Graphs](https://refivu.com/en/papers/c8d7ac6f-ca53-43f2-b5f6-9ac71d5ca32d-spectral-networks-and-locally-connected-networks-on-graphs.md)
- [An Introduction to Convolutional Neural Networks](https://refivu.com/en/papers/6b236b8c-8750-484a-8c31-87433f51f2eb-an-introduction-to-convolutional-neural-networks.md)
- [Matching Networks for One Shot Learning](https://refivu.com/en/papers/b9fc7556-8641-4de5-90e9-278f5122412f-matching-networks-for-one-shot-learning.md)
- [LightGCN: Simplifying and Powering Graph Convolution Network for Recommendation](https://refivu.com/en/papers/ce104c95-75b4-4033-900a-57eef9818488-lightgcn-simplifying-and-powering-graph-convolution-network.md)
- [Unsupervised Domain Adaptation by Backpropagation](https://refivu.com/en/papers/5b06ce85-04aa-40bd-a8ba-094e15a092f1-unsupervised-domain-adaptation-by-backpropagation.md)
- [Restormer: Efficient Transformer for High-Resolution Image Restoration](https://refivu.com/en/papers/df4b04d0-730a-42b5-952f-56ce280f457e-restormer-efficient-transformer-for-high-resolution-image.md)
- [Federated Optimization in Heterogeneous Networks](https://refivu.com/en/papers/2cd45774-4d0c-4ae9-9650-6a1593f93832-federated-optimization-in-heterogeneous-networks.md)
- [VQA: Visual Question Answering](https://refivu.com/en/papers/52c3e601-1542-4d3e-bc47-1d51fb1b7a5e-vqa-visual-question-answering.md)
- [BERTopic: Neural topic modeling with a class-based TF-IDF procedure](https://refivu.com/en/papers/3eb59114-35a2-4294-982a-129e3bf9019b-bertopic-neural-topic-modeling-with-a-class-based.md)
- [Quantization and Training of Neural Networks for Efficient Integer-Arithmetic-Only Inference](https://refivu.com/en/papers/07bb92b6-cd63-4ab5-ab99-88473c074df7-quantization-and-training-of-neural-networks-for-efficient.md)
- [Striving for Simplicity: The All Convolutional Net](https://refivu.com/en/papers/a95bd630-88c1-480e-8223-b0666111b3e5-striving-for-simplicity-the-all-convolutional-net.md)

## Terms in this paper

- [ImageNet](https://refivu.com/en/terms/5eadad128667-imagenet)
- [GoogLeNet](https://refivu.com/en/terms/50b933468e4c-googlenet)
- [Integrated Gradients](https://refivu.com/en/terms/7ea02692192e-integrated-gradients)
- [DeepLIFT](https://refivu.com/en/terms/db4f80bf1878-deeplift)
- [layer-wise relevance propagation](https://refivu.com/en/terms/8f88b1c3f79a-layer-wise-relevance-propagation)
- [completeness](https://refivu.com/en/terms/dd08cb6dbac0-completeness)

---

AI-written text can contain mistakes. [Refivu](https://refivu.com/en/papers/8f942e84-cd77-4efa-89f3-fcb9addb43ef-axiomatic-attribution-for-deep-networks)
