What are integrated gradients?
Integrated gradients is an attribution method finding each input feature's contribution to a model's output by accumulating gradients along a straight path from a baseline considered neutral, such as a black image or a zero embedding for text, to the actual input.
Unlike a saliency map, which looks only at the gradient at the actual input and can give an important feature zero importance when the model saturates, it measures the effect accumulated along the path. SHapley Additive exPlanations reaches the same goal by a different route based on game theory.
- Topic
- Responsible AI and governance
- Also known as
- IG
- Origin
- Sundararajan, Taly and Yan, 2017
How integrated gradients work
- A baseline is chosen for the input to explain; it should represent the absence of information.
- Usually tens or hundreds of intermediate points are created on the path from baseline to input.
- At each point the gradient of the output with respect to the input is computed and averaged.
- The average is multiplied by the difference between input and baseline; summed contributions should equal the change in output.
In more detail
The formula, step count and convergence delta
Mathematically, the attribution of a feature is the difference between its input and baseline values multiplied by the average gradient of the model output with respect to that feature along the straight path from baseline to input; in practice the average is computed numerically over m interpolation steps. Each explanation therefore needs m forward and backward passes, making latency a key factor for real-time interfaces; a convergence delta check confirms that the attributions sum close to the difference between the model's outputs on the input and on the baseline.
Baseline blind spots and multiple-baseline remedies
A black-image baseline blinds integrated gradients to dark pixels because the input-minus-baseline difference is zero wherever the input matches the baseline. Alternatives such as Expected Gradients, which averages over multiple training samples, BlurIG or uniform noise baselines help prevent single-baseline blind spots.
Baseline design for tabular data and sanity checks
In tabular fraud or credit models a zero value can be meaningless or impossible, such as an age of zero, so a median, mean or empirical reference distribution makes a better baseline. Sanity checks in the style of Adebayo et al. (2018), randomising model parameters and confirming that explanations change, show that attributions genuinely depend on what the model learned.
Commonly confused terms
| Term | How it differs |
|---|---|
| Vanilla saliency maps (input times gradient) | Vanilla saliency maps evaluate the gradient at a single point (the input itself) and suffer from gradient saturation, whereas integrated gradients accumulate gradients along a straight path from a baseline to the input and satisfy completeness and sensitivity axioms. |
| SHapley Additive exPlanations | Integrated Gradients requires a differentiable model (neural networks) and measures attribution via path integrals along a chosen baseline, whereas SHAP is model-agnostic (with exact TreeSHAP for decision trees) and computes game-theoretic Shapley values over feature coalitions. |
| Expected gradients | Integrated Gradients uses a fixed single baseline (such as zero or black), whereas Expected Gradients (Erion et al., 2021) averages path integrals across a distribution of reference samples from the training dataset to reduce baseline bias. |
Why integrated gradients matter for on-premises AI
The paper introducing it sets principles a good attribution method should meet, such as sensitivity and implementation invariance, showing integrated gradients meets them; contributions also sum to the output's difference from the baseline. Needing only gradient access, it suits differentiable in-house models. Its main weak point is the baseline: different baselines can give different explanations, so the choice is justified and results compared across several.
A bank's validation team explains an in-house neural fraud model's transaction decisions with integrated gradients, showing analysts the most influential features and checking consistency across baselines.
Common questions
How do integrated gradients differ from a saliency map?
A saliency map looks at the gradient at one point. Integrated gradients accumulate gradients along a path, reducing saturation problems.
Why does the baseline matter?
Contributions are measured relative to it. Different baselines can give different explanations, so the choice is justified.
Related terms
- Saliency map
- Feature attribution
- SHapley Additive exPlanations
- Local Interpretable Model-agnostic Explanations
- AI interpretability
- Explainable AI
Sources
- Sundararajan, Taly and Yan, Axiomatic Attribution for Deep Networks, 2017
- Adebayo et al., Sanity Checks for Saliency Maps, 2018
In the glossary: Glossary, E to L