Papers
Topics
Authors
Recent
Search
2000 character limit reached

Path-Weighted Integrated Gradients

Updated 12 July 2026
  • Path-Weighted Integrated Gradients is a path-integral attribution method that generalizes IG by applying a nonnegative weighting function along the input path.
  • It mitigates saturation effects by emphasizing regions where the model output changes rapidly, thus enhancing the clarity and fidelity of attributions.
  • PWIG has been effectively applied in both vision and medical imaging tasks, demonstrating improved performance in ImageNet evaluation and dementia classification.

Searching arXiv for recent and foundational papers on Path-Weighted Integrated Gradients and closely related Integrated Gradients variants. Path-Weighted Integrated Gradients (PWIG) is a path-integral attribution method that generalizes Integrated Gradients (IG) by inserting a nonnegative weighting function along the path from a baseline xx' to an input xx. In its generic straight-line form, the attribution for feature ii is

PWIGi(x;x)=(xixi)01g(α)F ⁣(x+α(xx))xidα,\mathrm{PWIG}_i(x;x') =(x_i-x'_i)\int_0^1 g(\alpha)\, \frac{\partial F\!\bigl(x'+\alpha(x-x')\bigr)}{\partial x_i}\,d\alpha,

so standard IG is recovered when g(α)=1g(\alpha)=1 (Kamalov et al., 22 Sep 2025). The method arose from analyses of saturation effects in IG, where the model output often increases sharply at small α\alpha and then flattens out, causing saturated regions to contribute disproportionately to the computed attribution (Miglani et al., 2020). Later work broadened PWIG into a family of weighting schemes, path choices, and equivalent stochastic formulations, and applied it to ImageNet evaluation, dementia classification, manifold-aware attribution, and layer-wise transformer analysis (Walker et al., 2023, Zaher et al., 2024, Kamalov et al., 15 Apr 2026, Nguyen, 29 Jun 2026).

1. Emergence from saturation analysis

The immediate precursor to PWIG is the saturation analysis of Miglani et al., who studied how different regions of the IG path contribute to attribution (Miglani et al., 2020). For a scalar target F:RnRF:\mathbb{R}^n\to\mathbb{R}, input xx, and baseline xx', standard IG assigns

IGi(x;x)=(xixi)01F ⁣(x+α(xx))xidα,IG_i(x;x') =(x_i-x'_i)\int_0^1 \frac{\partial F\!\bigl(x'+\alpha(x-x')\bigr)}{\partial x_i}\,d\alpha,

and satisfies completeness: xx0

Their central observation is that along the straight-line path xx1, the scalar output xx2 often rises rapidly for small xx3 and then becomes flat. This motivates a partition of the path into an “unsaturated” region and a “saturated” region. Defining xx4, choosing a saturation threshold xx5 such as xx6, and setting

xx7

one obtains an early segment xx8 where the output has not yet reached xx9 above baseline, and a later segment ii0 where the output is beyond that threshold. In practice, ii1 is found by evaluating ii2 on a grid of ii3 values and selecting the smallest ii4 meeting the criterion.

This saturation-based decomposition led directly to reweighted variants of IG. In the simplest construction, the path weight is piecewise constant: ii5 on the unsaturated region and ii6 on the saturated region, with the extreme case ii7 completely ignoring the saturated tail. When ii8 for ii9 and PWIGi(x;x)=(xixi)01g(α)F ⁣(x+α(xx))xidα,\mathrm{PWIG}_i(x;x') =(x_i-x'_i)\int_0^1 g(\alpha)\, \frac{\partial F\!\bigl(x'+\alpha(x-x')\bigr)}{\partial x_i}\,d\alpha,0 otherwise, PWIG reduces to “Left IG,” the unsaturated-only variant evaluated in the original study (Miglani et al., 2020).

2. Formal definition and weighting families

A more general formalization defines PWIG on the straight-line path PWIGi(x;x)=(xixi)01g(α)F ⁣(x+α(xx))xidα,\mathrm{PWIG}_i(x;x') =(x_i-x'_i)\int_0^1 g(\alpha)\, \frac{\partial F\!\bigl(x'+\alpha(x-x')\bigr)}{\partial x_i}\,d\alpha,1, PWIGi(x;x)=(xixi)01g(α)F ⁣(x+α(xx))xidα,\mathrm{PWIG}_i(x;x') =(x_i-x'_i)\int_0^1 g(\alpha)\, \frac{\partial F\!\bigl(x'+\alpha(x-x')\bigr)}{\partial x_i}\,d\alpha,2, using a continuous weighting function PWIGi(x;x)=(xixi)01g(α)F ⁣(x+α(xx))xidα,\mathrm{PWIG}_i(x;x') =(x_i-x'_i)\int_0^1 g(\alpha)\, \frac{\partial F\!\bigl(x'+\alpha(x-x')\bigr)}{\partial x_i}\,d\alpha,3 (Kamalov et al., 22 Sep 2025). The practical Riemann-sum approximation with PWIGi(x;x)=(xixi)01g(α)F ⁣(x+α(xx))xidα,\mathrm{PWIG}_i(x;x') =(x_i-x'_i)\int_0^1 g(\alpha)\, \frac{\partial F\!\bigl(x'+\alpha(x-x')\bigr)}{\partial x_i}\,d\alpha,4 steps is

PWIGi(x;x)=(xixi)01g(α)F ⁣(x+α(xx))xidα,\mathrm{PWIG}_i(x;x') =(x_i-x'_i)\int_0^1 g(\alpha)\, \frac{\partial F\!\bigl(x'+\alpha(x-x')\bigr)}{\partial x_i}\,d\alpha,5

In this formulation, the weighting function determines which parts of the path dominate the attribution.

Several weighting families have been explicitly proposed. Uniform weighting, PWIGi(x;x)=(xixi)01g(α)F ⁣(x+α(xx))xidα,\mathrm{PWIG}_i(x;x') =(x_i-x'_i)\int_0^1 g(\alpha)\, \frac{\partial F\!\bigl(x'+\alpha(x-x')\bigr)}{\partial x_i}\,d\alpha,6, recovers IG and satisfies completeness. Exponential weighting, PWIGi(x;x)=(xixi)01g(α)F ⁣(x+α(xx))xidα,\mathrm{PWIG}_i(x;x') =(x_i-x'_i)\int_0^1 g(\alpha)\, \frac{\partial F\!\bigl(x'+\alpha(x-x')\bigr)}{\partial x_i}\,d\alpha,7 with PWIGi(x;x)=(xixi)01g(α)F ⁣(x+α(xx))xidα,\mathrm{PWIG}_i(x;x') =(x_i-x'_i)\int_0^1 g(\alpha)\, \frac{\partial F\!\bigl(x'+\alpha(x-x')\bigr)}{\partial x_i}\,d\alpha,8, emphasizes gradients near the input end PWIGi(x;x)=(xixi)01g(α)F ⁣(x+α(xx))xidα,\mathrm{PWIG}_i(x;x') =(x_i-x'_i)\int_0^1 g(\alpha)\, \frac{\partial F\!\bigl(x'+\alpha(x-x')\bigr)}{\partial x_i}\,d\alpha,9; in the dementia-classification paper, g(α)=1g(\alpha)=10 (Kamalov et al., 22 Sep 2025). Polynomial or Beta-shaped weights, g(α)=1g(\alpha)=11, can emphasize early-path, late-path, or mid-path contributions. Custom shapes such as triangular functions, Gaussian bumps, or user-defined heuristics are intended to down-weight “noisy” regions of the interpolation.

A distinct but closely related construction appears in “Integrated Decision Gradients,” where the path-weighting function is taken to be the derivative of the output logit along the path,

g(α)=1g(\alpha)=12

and the attribution becomes

g(α)=1g(\alpha)=13

This specific weighting emphasizes the “decision region,” defined as the portion of the path where the output logit rapidly transitions from zero to its final value (Walker et al., 2023).

3. Axioms, completeness, and conceptual distinctions

In its generic form, PWIG retains several of IG’s axiomatic properties. The dementia-classification formalization states Implementation Invariance, Linearity, the Dummy Axiom / Sensitivity(b), and Symmetry–Preserving (Kamalov et al., 22 Sep 2025). Implementation Invariance means that if two networks agree on all inputs, then their PWIG attributions agree. Linearity states that attributions distribute over affine combinations of networks. The Dummy Axiom assigns zero attribution to a feature on which g(α)=1g(\alpha)=14 does not depend. Symmetry–Preserving equates attributions of symmetric inputs when the function and the baseline respect that symmetry.

Completeness is the main property that changes under arbitrary weighting. For general g(α)=1g(\alpha)=15,

g(α)=1g(\alpha)=16

which equals g(α)=1g(\alpha)=17 if and only if g(α)=1g(\alpha)=18 almost everywhere (Kamalov et al., 22 Sep 2025). The path-sampled formulation makes the deviation explicit through the completeness residual

g(α)=1g(\alpha)=19

where α\alpha0 (Kamalov et al., 15 Apr 2026).

A recurring point of confusion is that not all papers use “PWIG” to denote the same mathematical object. The generic framework treats α\alpha1 as an externally chosen nonnegative function and therefore generally loses completeness unless α\alpha2. By contrast, the IDG formulation argues that weighting by α\alpha3 is a bona-fide path integral and inherits Completeness, Sensitivity, Implementation-Invariance and Linearity under mild monotonicity assumptions, because the integral can be interpreted after reparameterizing by α\alpha4 (Walker et al., 2023). This suggests that completeness claims in the PWIG literature depend on whether weighting is regarded as an arbitrary deformation of IG or as a special reparameterized path integral.

4. Numerical realization and algorithmic variants

A saturation-oriented PWIG implementation follows a fixed sequence of operations (Miglani et al., 2020). One first computes α\alpha5, then evaluates α\alpha6 and α\alpha7 on a grid α\alpha8, α\alpha9. After setting F:RnRF:\mathbb{R}^n\to\mathbb{R}0, one finds the smallest F:RnRF:\mathbb{R}^n\to\mathbb{R}1 such that F:RnRF:\mathbb{R}^n\to\mathbb{R}2, with F:RnRF:\mathbb{R}^n\to\mathbb{R}3. The weights are then chosen as F:RnRF:\mathbb{R}^n\to\mathbb{R}4 for F:RnRF:\mathbb{R}^n\to\mathbb{R}5 and F:RnRF:\mathbb{R}^n\to\mathbb{R}6 otherwise, gradients F:RnRF:\mathbb{R}^n\to\mathbb{R}7 are computed, and the integral is approximated by

F:RnRF:\mathbb{R}^n\to\mathbb{R}8

An optional renormalization step can enforce F:RnRF:\mathbb{R}^n\to\mathbb{R}9. The reported complexity is xx0 per input.

The generic straight-line implementation in the dementia-classification formulation uses discretization xx1, evaluates xx2 for xx3, samples the analytic weight xx4, and requires xx5 backward-passes; in those experiments, xx6 (Kamalov et al., 22 Sep 2025). Post-processing may include clipping or percentile filtering to suppress outliers.

IDG adds an adaptive sampling strategy designed to reduce Riemann-sum error in regions where uniform sampling wastes steps on flat segments (Walker et al., 2023). The interval xx7 is first partitioned into xx8 coarse bins, logit gains xx9 are measured, and xx'0 fine samples are allocated proportionally as

xx'1

This concentrates evaluations where the output grows fastest. The paper recommends xx'2–xx'3 as a quality/runtime trade-off and notes that setting xx'4 yields xx'5 total evaluations.

5. Empirical behavior across vision and medical imaging

On ImageNet classification networks, Miglani et al. compared “Left IG,” “Right IG,” and standard IG on Inception-v3, ResNet-50, and VGG-19 using model faithfulness (ABPC) and noise sensitivity (Sens), with xx'6 and xx'7 typically xx'8 (Miglani et al., 2020). Averaged over 2500 ImageNet samples, LeftIG improved both faithfulness and stability relative to full IG.

Model LeftIG ABPC Full IG ABPC
Inception-v3 0.2837 0.2486
ResNet-50 0.1708 0.1464
VGG-19 0.1417 0.1282
Model LeftIG Sens Full IG Sens
Inception-v3 0.5341 0.5711
ResNet-50 0.7706 0.8074
VGG-19 0.5970 0.7122

In the same evaluation, RightIG was reported as much lower in faithfulness and substantially more sensitive to noise. Within the saturation-based interpretation, this supports the claim that unsaturated, early-path gradients better explain model behavior than gradients from flat regions (Miglani et al., 2020).

The more explicitly decision-focused IDG evaluation used ImageNet 2012 validation, sampling 5 images per class across 1000 classes for 5000 images, and compared PWIG/IDG against IG, Left-IG, Guided IG, and adversarial gradient integration on ResNet-101, ResNet-152, and ResNeXt (Walker et al., 2023). For ResNet-101, the reported metrics were: AIC xx'9; SIC IGi(x;x)=(xixi)01F ⁣(x+α(xx))xidα,IG_i(x;x') =(x_i-x'_i)\int_0^1 \frac{\partial F\!\bigl(x'+\alpha(x-x')\bigr)}{\partial x_i}\,d\alpha,0; insertion IGi(x;x)=(xixi)01F ⁣(x+α(xx))xidα,IG_i(x;x') =(x_i-x'_i)\int_0^1 \frac{\partial F\!\bigl(x'+\alpha(x-x')\bigr)}{\partial x_i}\,d\alpha,1; deletion IGi(x;x)=(xixi)01F ⁣(x+α(xx))xidα,IG_i(x;x') =(x_i-x'_i)\int_0^1 \frac{\partial F\!\bigl(x'+\alpha(x-x')\bigr)}{\partial x_i}\,d\alpha,2 for IG, LIG, GIG, AGI, and PWIG respectively. Similar consistent improvements of approximately IGi(x;x)=(xixi)01F ⁣(x+α(xx))xidα,IG_i(x;x') =(x_i-x'_i)\int_0^1 \frac{\partial F\!\bigl(x'+\alpha(x-x')\bigr)}{\partial x_i}\,d\alpha,3–IGi(x;x)=(xixi)01F ⁣(x+α(xx))xidα,IG_i(x;x') =(x_i-x'_i)\int_0^1 \frac{\partial F\!\bigl(x'+\alpha(x-x')\bigr)}{\partial x_i}\,d\alpha,4 points were observed on ResNet-152 and ResNeXt.

A separate application to dementia classification used the OASIS-1 MRI dataset with four labels—non-demented, very mild, mild, moderate—and a convolutional neural network with four conv-blocks, ReLU, max-pool, dropout IGi(x;x)=(xixi)01F ⁣(x+α(xx))xidα,IG_i(x;x') =(x_i-x'_i)\int_0^1 \frac{\partial F\!\bigl(x'+\alpha(x-x')\bigr)}{\partial x_i}\,d\alpha,5, three fully connected layers, and softmax over 4 classes (Kamalov et al., 22 Sep 2025). The scans were preprocessed to IGi(x;x)=(xixi)01F ⁣(x+α(xx))xidα,IG_i(x;x') =(x_i-x'_i)\int_0^1 \frac{\partial F\!\bigl(x'+\alpha(x-x')\bigr)}{\partial x_i}\,d\alpha,6 and normalized to ImageNet statistics. In that study, PWIG used IGi(x;x)=(xixi)01F ⁣(x+α(xx))xidα,IG_i(x;x') =(x_i-x'_i)\int_0^1 \frac{\partial F\!\bigl(x'+\alpha(x-x')\bigr)}{\partial x_i}\,d\alpha,7, IGi(x;x)=(xixi)01F ⁣(x+α(xx))xidα,IG_i(x;x') =(x_i-x'_i)\int_0^1 \frac{\partial F\!\bigl(x'+\alpha(x-x')\bigr)}{\partial x_i}\,d\alpha,8, and clipping at the 60th and 95th percentiles. The reported validation accuracy was IGi(x;x)=(xixi)01F ⁣(x+α(xx))xidα,IG_i(x;x') =(x_i-x'_i)\int_0^1 \frac{\partial F\!\bigl(x'+\alpha(x-x')\bigr)}{\partial x_i}\,d\alpha,9. Attribution maps were described as sharper than unweighted IG, with reduced spurious noise, and as emphasizing hippocampal, cortical, and subcortical atrophy in mild/moderate dementia; non-demented maps were diffuse, whereas moderate dementia maps concentrated on known pathology sites.

6. Extensions, equivalent formulations, and broader PWIG frameworks

One major extension replaces the straight-line path rather than only reweighting it. “Manifold Integrated Gradients” formulates attribution along an arbitrary path xx00, with completeness xx01, and then chooses xx02 to be a geodesic on a learned Riemannian data manifold (Zaher et al., 2024). In this setting, a general path-weighted form is

xx03

The paper notes that one may take xx04 so that contributions are proportional to manifold arc-length, and it reports improvements on Oxford-IIIT Pets and Oxford-102 Flowers in SENSxx05, explanation infidelity, and SSI under targeted attribution attacks (Zaher et al., 2024).

A second development establishes an exact connection between deterministic weighting and stochastic baseline sampling. “Path-Sampled Integrated Gradients” defines

xx06

and proves that if xx07, then

xx08

This equivalence yields a deterministic CDF-weighted Riemann sum with xx09 error for smooth models, compared with Monte Carlo RMSE xx10, and gives a variance-reduction result under a white-noise model of gradient perturbations: for uniform sampling, xx11, so xx12 (Kamalov et al., 15 Apr 2026).

A third extension adapts path-weighting ideas to internal model states rather than input space. “IG-Lens” constructs a piecewise-linear path through transformer hidden states and attributes each segment to the layer it terminates at (Nguyen, 29 Jun 2026). For a scalar softmax-probability readout xx13, the exact segment integral satisfies

xx14

and the sum over layers telescopes to xx15. The default estimator is “prediction-aware”: each discrete step is credited its observed change in target probability rather than its raw gradient. According to the paper, this removes Riemann discretization error, suppresses steps that show gradient sensitivity without a change in output, and admits a single-pass batched implementation with no backward call.

Taken together, these developments position PWIG less as a single algorithm than as a general design space for attribution. Within that design space, one may alter the weighting function xx16, the path xx17, the sampling scheme, or the state space over which integration is performed. The common theme is selective emphasis: early versus late path segments, saturated versus unsaturated regions, decision regions, manifold-respecting trajectories, sampled intermediate baselines, or layer-wise hidden-state transitions.

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Path-Weighted Integrated Gradients (PWIG).