Name the comparison before computing it
Let be the scalar output, the observed feature vector and the baseline. Standard IG is
The multiplier matters: an average derivative alone has different units. IG has the units of the chosen output. A positive attribution adds to the output difference; a negative one offsets it. Neither sign establishes whether a feature is economically desirable.
For a credit model, explaining a default probability differs from explaining its pre-sigmoid logit. A nonlinear output transformation changes the gradients along the path; one cannot transform individual logit attributions into probability attributions afterward. Specify the target output or class, feature preprocessing and model evaluation settings before comparing explanations.
One interaction, three allocations
Consider a synthetic score with dimensionless inputs,
The score rises from to . On the straight path , the partial derivatives are and . Therefore
At the endpoint, the raw gradient is ; multiplying it by the displacement gives , which sums to . That endpoint shortcut counts the product interaction twice. IG allocates the interaction across the journey.
Original synthetic example. The product interaction is split equally by the straight path; coordinate-by-coordinate paths allocate it to whichever feature changes second. Completeness holds for all three allocations.
Even retaining the straight path, changing the baseline to changes IG to . The total is now , because the reference score is . This is a different comparison, not a failed completeness check.
What completeness promises
Under conditions that justify the chain rule along the path and the fundamental theorem of calculus,
For example, these conditions hold when is continuously differentiable around the path. A more general sufficient formulation requires the output along the path to be absolutely continuous and its derivative to equal the gradient dotted with the path velocity almost everywhere. Ordinary continuous piecewise-smooth networks can meet this condition despite isolated activation kinks. Differentiability almost everywhere in the surrounding input space alone is insufficient to justify every exceptional path: inspect paths that run along nondifferentiable boundaries and the derivative conventions used there. Discrete decisions, hard thresholds and tree splits do not automatically inherit the smooth-path argument.
Completeness is an accounting identity for the fitted function. It does not establish that a feature caused a realised market outcome, that the baseline is neutral, or that the interpolated feature combinations are realistic. Correlated market inputs may travel through states absent from training data. In this example, the equal split is a path-based allocation of a pure interaction; it is not evidence that two real economic mechanisms contributed equally.
Check the integral, then the interpretation
Numerical IG replaces the integral with weighted gradient evaluations. Define the signed completeness residual as
For the bilinear example, equally spaced right-endpoint sums give:
| Integration rule | Points | Estimated contributions | Residual |
|---|---|---|---|
| Right endpoints | 20 | ||
| Right endpoints | 100 | ||
| Midpoints | 20 |
multiply_by_inputs=True setting.Use a finer grid or another integration rule to check individual attribution stability as well as the total. A small residual can conceal cancelling component errors; it cannot validate a baseline or supply causal evidence. Report the baseline, output scale, integration method and residual with the explanation, and examine whether conclusions survive defensible alternative baselines.
Sources
- Sundararajan, Taly and Yan (2017), Axiomatic Attribution for Deep Networks, §§2–5: sensitivity, IG, completeness, paths and numerical approximation.
- Sturmfels, Lundberg and Lee (2020), Visualizing the Impact of Feature Attribution Baselines, baseline dependence and missingness.
- Captum, IntegratedGradients API, baseline, target, integration and convergence options; accessed 1 November 2026.
- Shrikumar, Greenside and Kundaje (2017), Learning Important Features Through Propagating Activation Differences, reference activations and contribution propagation.