Saliency maps score a feature's importance by its gradient at the input — but a sigmoid deep in saturation has a gradient near zero everywhere close to the input, even when that feature clearly moved the output a lot on the way there. What does the gradient look like along the whole path, not just at the destination?
Instead of one gradient at one point, walk from a baseline to the input in small steps and average the gradient along the way. More steps means a finer walk along the exact same path, not a different destination — and the result converges to something a single gradient could never see.
Integrated gradients attribute a prediction to an input by integrating the gradient along the straight-line path from a baseline to the actual input:
- — the integrated gradients attribution for input : how much of the output change gets credited to this feature.
- — the actual input value being explained.
- — the reference input (often all zeros) that the path starts from, representing "no information" for that feature.
- — the interpolation fraction along the straight-line path from baseline to input, ranging from to .
- — the model, as a function of its input.
- Approximated by a Riemann sum
In practice this integral is approximated by a Riemann sum over steps along that path.
- Completeness axiom
As grows, the attribution converges to exactly , the true change in output — the key guarantee behind this method.
- Saliency is the degenerate case, m=1
Plain saliency is just this method with a single step: the gradient at the input alone, with no path at all.
The model curve is flat near both ends and steep only in the middle. The path from baseline to input crosses that entire steep region — but the gradient at the input alone sits in the flat, saturated tail, where it's almost meaningless.
, baseline , input :
- The true output change is large, the gradient at the input is tiny
A change of nearly . The derivative at : — the input sits so deep in saturation that its own gradient badly understates how much it mattered.
- One step reduces to the same blind spot
With only 1 integration step, IG evaluates the gradient only at the input itself — identical to plain saliency. The result, , misses over 99.9% of the true output change.
- More steps recover the missing attribution
- At 10 steps: (gap )
- At 50 steps: (gap )
- At 500 steps: (gap )
Steadily converging toward the exact true change, because most of that path crosses the steep, high-gradient middle that a single endpoint gradient never sees.
Find the step count, among the three candidates, where integrated gradients lands within 0.05 of the true output change.
Saliency asks "how steep is the model right here?" Integrated gradients asks the more honest question: "how much did this feature's whole journey from nothing to its actual value change the answer?" Saturating activations — sigmoids, tanh, anything with a flat tail — are exactly where those two questions diverge, and exactly where a plain gradient becomes actively misleading rather than just imprecise. The next chapter looks at feature importance from a completely different angle: not the gradient at all, but how the prediction changes as you sweep one feature across its whole range.