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

  1. A baseline is chosen for the input to explain; it should represent the absence of information.
  2. Usually tens or hundreds of intermediate points are created on the path from baseline to input.
  3. At each point the gradient of the output with respect to the input is computed and averaged.
  4. 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

TermHow 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 exPlanationsIntegrated 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 gradientsIntegrated 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.

ON-PREMISES EXAMPLE

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.

Sources

In the glossary: Glossary, E to L

What does this term mean for your infrastructure?

We can work out together in a technical assessment how it maps onto your data, hardware and security requirements.

Request a technical assessment →

This site sets no cookies. Visitor numbers are counted in aggregate using a cookieless method that does not identify anyone. See the Privacy Policy for details.