Integrated Gradients

A gradient at the final input can be tiny because the model is saturated. Integrated gradients avoids relying on that one point.

It walks from a baseline representing feature absence to the real input, computes gradients along the path, and accumulates them.

Path attribution

For feature ii:

IGi(x)=(xixi)01F(x+α(xx))xidαIG_i(x)=(x_i-x_i')\int_0^1\frac{\partial F(x'+\alpha(x-x'))}{\partial x_i}d\alpha

xx' is the baseline and α\alpha moves along the straight-line path to input xx.

Walk from Baseline to Retinal Scan

Choose what feature absence means, then move along the interpolation path. The current image, gradient, and accumulated attribution remain synchronized.

Current gradient

0.964

Running integral

0.184

black baselineactual scan
Integrated gradients answers a contrastive question: what changed between this baseline and this input?

The baseline changes the question. A black image asks what the model gains relative to darkness. A blurred image asks what detail adds. A padding embedding asks what the token adds relative to absence.

State the baseline and test alternatives. An attribution without its reference point is incomplete.

Checkpoint

Why can two reasonable baselines produce different integrated-gradient explanations?