Inferensys

Glossary

Integrated Gradients

A model-specific attribution method for deep networks that computes the contribution of each input feature by integrating the gradients of the model's output with respect to the input along a path from a baseline to the actual input.
ML engineer managing model training cluster on laptop, GPU utilization visible, technical deep learning setup.
AXIOMATIC ATTRIBUTION

What is Integrated Gradients?

A deep learning interpretability method that computes feature contributions by accumulating gradients along a path from a neutral baseline to the input.

Integrated Gradients is a model-specific attribution method that quantifies the contribution of each input feature to a deep network's prediction by integrating the gradients of the output with respect to the input along a straight-line path from a chosen baseline to the actual input. This satisfies the completeness axiom, ensuring the sum of all feature attributions equals the difference between the model's output at the input and the baseline.

The method requires selecting a baseline representing the absence of signal, such as a zero vector for images or a historical average transaction for financial fraud anomaly detection. By accumulating gradients along the interpolation path, Integrated Gradients avoids the saturation problem of raw gradients and provides a theoretically grounded, audit-ready explanation for why a specific transaction was flagged.

AXIOMATIC ATTRIBUTION

Key Properties of Integrated Gradients

Integrated Gradients is a model-specific attribution method for deep networks that satisfies two fundamental axioms: Sensitivity and Implementation Invariance. It computes feature contributions by accumulating gradients along a straight-line path from a non-informative baseline to the actual input.

01

The Axiomatic Foundation

Integrated Gradients is the only path-based attribution method known to satisfy both the Sensitivity and Implementation Invariance axioms simultaneously.

  • Sensitivity (a): If an input differs from the baseline in exactly one feature and produces a different prediction, that feature must receive non-zero attribution.
  • Sensitivity (b): If the model's output is mathematically independent of a feature, that feature must receive zero attribution.
  • Implementation Invariance: Two functionally equivalent networks—regardless of architecture—must produce identical attributions. This eliminates the gradient saturation problem that plagues simple gradient-based saliency maps.
02

The Path Integral Mechanism

The method computes attribution by integrating gradients along a straight-line path from a baseline input x' to the actual input x.

The core formula:

code
IG_i(x) = (x_i - x'_i) × ∫[α=0 to 1] ∂F(x' + α(x - x'))/∂x_i dα

Key components:

  • Baseline (x'): A neutral reference point representing the absence of signal—typically a black image, zero embedding vector, or average transaction profile.
  • Interpolation steps: The integral is approximated using Riemann summation across m steps (typically 20–300).
  • Gradient accumulation: Gradients are computed at each interpolated point and averaged, capturing how the model's output changes as features scale from absent to present.
03

Completeness and Conservation

Integrated Gradients satisfies the Completeness axiom: the sum of all feature attributions equals the difference between the model's output at the input and the baseline.

Why this matters for fraud detection:

  • The total attribution sum precisely accounts for the deviation from a 'normal' baseline transaction to the flagged anomalous transaction.
  • No attribution is lost or created—every unit of the anomaly score is distributed among the input features.
  • This enables auditable explanations: a compliance officer can verify that the sum of individual feature contributions exactly reconstructs the model's fraud score.

This property is a direct consequence of the fundamental theorem of calculus applied along the integration path.

04

Baseline Selection Strategy

The choice of baseline critically shapes the explanation. The baseline must represent 'absence of information' in the model's input space.

Common baselines for fraud models:

  • Zero vector: For normalized numerical features, representing a null transaction.
  • Global average: The mean transaction vector across the training distribution.
  • Gaussian noise baseline: Multiple baselines drawn from a noise distribution, with attributions averaged to reduce baseline arbitrariness.
  • Nearest-neighbor baseline: The closest non-fraudulent transaction in embedding space.

Best practice: Use multiple baselines and average the resulting attributions to mitigate the sensitivity of explanations to any single baseline choice. This is known as Expected Gradients.

05

Application to Tabular Fraud Data

While originally developed for image classifiers, Integrated Gradients adapts effectively to the tabular, high-dimensional feature spaces typical in financial fraud detection.

Implementation considerations:

  • Feature scaling: All features must be normalized to a common range before integration to ensure the path is geometrically meaningful.
  • Categorical features: Require embedding layers; the baseline is set to the embedding of a designated 'unknown' or 'absent' category.
  • Temporal features: Time-based features (hour of day, days since last transaction) use a baseline representing a 'neutral' temporal state.
  • Interaction effects: Integrated Gradients captures feature interactions implicitly through the gradient path, unlike additive methods that assume independence.

Example: For a flagged wire transfer, IG can reveal that the combination of high amount AND unusual beneficiary country—not either alone—drove the anomaly score.

06

Comparison with SHAP and LIME

Integrated Gradients occupies a distinct position in the explainability landscape, with specific trade-offs relative to model-agnostic alternatives.

IG vs. SHAP:

  • IG is model-specific (requires gradient access); SHAP is model-agnostic.
  • IG satisfies Implementation Invariance; Kernel SHAP does not.
  • SHAP satisfies the Shapley axioms from game theory; IG satisfies path-based axioms.
  • IG is computationally cheaper for deep networks than Kernel SHAP.

IG vs. LIME:

  • IG provides global path consistency; LIME explanations are local linear approximations that may be unstable.
  • IG requires no sampling of perturbed instances; LIME requires careful perturbation design.
  • IG is deterministic given a fixed baseline; LIME involves randomness in sampling.
INTERPRETABILITY DEEP DIVE

Frequently Asked Questions

Explore the mechanics of Integrated Gradients, a foundational attribution method for explaining deep neural network predictions in fraud detection and beyond.

Integrated Gradients is a model-specific attribution method that computes the contribution of each input feature to a deep network's prediction by integrating the gradients of the model's output with respect to the input along a straight-line path from a non-informative baseline to the actual input. The method satisfies two fundamental axioms: Sensitivity (if a feature changes the prediction, it gets non-zero attribution) and Implementation Invariance (attributions are identical for functionally equivalent networks). For a fraud model analyzing a transaction, the baseline might be a vector of zeros or historical averages. The integral of gradients accumulates how each feature—like transaction amount or account age—pushes the prediction away from the baseline, providing a theoretically grounded decomposition of the final anomaly score.

ATTRIBUTION METHOD COMPARISON

Integrated Gradients vs. Other Attribution Methods

A technical comparison of Integrated Gradients against other prominent feature attribution methods used for explaining deep learning model predictions in financial fraud detection.

FeatureIntegrated GradientsSHAPLIMESaliency Maps

Axiomatic Guarantee

Satisfies Sensitivity and Implementation Invariance

Satisfies Shapley axioms (efficiency, symmetry, dummy, additivity)

No axiomatic guarantees

No axiomatic guarantees

Model Compatibility

Differentiable models only

Model-agnostic

Model-agnostic

Differentiable models only

Baseline Requirement

Requires neutral baseline input

Uses background dataset for expectation

No baseline required

No baseline required

Computational Cost

High (50-300 integration steps)

Very High (exponential coalitions; optimized via KernelSHAP)

Moderate (local surrogate training)

Low (single backward pass)

Local vs. Global

Local (per-instance)

Local and global (via aggregation)

Local (per-instance)

Local (per-instance)

Handles Feature Interactions

Output Completeness

Sum equals prediction difference from baseline

Sum equals prediction minus expected value

No completeness guarantee

No completeness guarantee

Saturation Sensitivity

Avoids saturation problem via path integration

Avoids saturation via Shapley averaging

Susceptible to local fidelity issues

Susceptible to gradient saturation

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.