Inferensys

Glossary

Integrated Gradients

A model interpretability method that attributes the prediction of a deep neural network to its input features by accumulating the gradients along a linear path from a baseline input to the actual input.
Data engineer managing feature store on laptop, feature definitions visible, casual data engineering session.
AXIOMATIC ATTRIBUTION

What is Integrated Gradients?

A model interpretability method that attributes the prediction of a deep neural network to its input features by accumulating the gradients along a linear path from a baseline input to the actual input.

Integrated Gradients is an axiomatic feature attribution method that satisfies the mathematical property of completeness, ensuring the sum of all feature attributions exactly equals the difference between the model's output for the target input and a non-informative baseline input. It computes the path integral of the model's gradients along a straight-line trajectory from the baseline to the input, providing a theoretically grounded decomposition of the prediction.

This method addresses the saturation problem inherent in raw gradient-based saliency maps, where features with strong influence may receive zero attribution if the model's output plateaus. By accumulating gradients across the entire interpolation path, Integrated Gradients captures the cumulative effect of each feature, making it a standard for interpreting genomic models like DeepSEA and Enformer to identify causal regulatory variants.

AXIOMATIC ATTRIBUTION

Key Features of Integrated Gradients

Integrated Gradients is a model interpretability method that satisfies two fundamental axioms—Sensitivity and Implementation Invariance—providing a mathematically principled way to attribute a deep neural network's prediction to its input features.

01

The Baseline Input

The attribution process requires a baseline input representing the absence of signal. For genomic sequences, this is typically an all-zero vector (representing no nucleotide at each position) or a dinucleotide-shuffled sequence that preserves local composition while destroying functional motifs. The choice of baseline critically affects which features are highlighted—a biologically informed baseline yields more interpretable attributions for regulatory genomics.

Reference
Common Baseline Type
02

Path Integral Formulation

Integrated Gradients computes attributions by accumulating the gradients of the model's output with respect to the input along a straight-line path from the baseline to the actual input. Mathematically, this is the path integral of the gradient field. For each feature i, the attribution is:

  • The integral of ∂F(x)/∂xᵢ along the linear interpolation path
  • Approximated in practice using Riemann summation with m steps (typically 50–200)
  • Equivalent to the difference between the input and baseline multiplied by the average gradient
50–200
Typical Interpolation Steps
03

Axiomatic Guarantees

Unlike gradient-based saliency maps or Guided Backpropagation, Integrated Gradients satisfies the Completeness axiom: the sum of all feature attributions exactly equals the difference between the model's output at the input and at the baseline. This guarantees that every bit of the prediction is accounted for. Additionally, Sensitivity ensures that if a single feature change alters the prediction, that feature receives non-zero attribution—a property violated by simple gradient methods when operating near saturation regions.

04

Hypothetical Importance Scores

In genomic binding prediction models like DeepBind or BPNet, Integrated Gradients produces per-nucleotide hypothetical importance scores that quantify each base's contribution to the predicted binding affinity. These scores can be visualized as sequence logos where letter height corresponds to attribution magnitude, revealing:

  • The precise nucleotides driving binding predictions
  • Subtle motif variations that distinguish high-affinity from low-affinity sites
  • Cooperative effects between adjacent transcription factor binding positions
05

TF-MoDISco Integration

Integrated Gradients attributions serve as the primary input to TF-MoDISco (Transcription Factor Motif Discovery from Importance Scores), which clusters high-attribution genomic subsequences to extract consolidated, non-redundant sequence motifs. This pipeline:

  • Identifies multiple distinct binding modes captured by a single model
  • Separates direct binding motifs from dinucleotide repeat artifacts
  • Recovers known motifs and discovers novel co-factor binding patterns
  • Produces position weight matrices suitable for downstream scanning tools
06

Saturation Sensitivity Detection

A critical advantage of Integrated Gradients over simple input × gradient methods is its ability to detect features operating in saturated activation regimes. When a transcription factor binding site is so strong that small perturbations do not change the prediction, raw gradients approach zero—falsely suggesting no importance. Integrated Gradients accumulates gradients along the entire path from baseline, capturing the feature's contribution even when the model's output has plateaued at the actual input.

INTERPRETABILITY

Frequently Asked Questions

Essential questions about Integrated Gradients for attributing deep neural network predictions in regulatory genomics.

Integrated Gradients is a model interpretability method that attributes the prediction of a deep neural network to its input features by accumulating the gradients along a linear path from a baseline input to the actual input. The method satisfies two fundamental axioms: Sensitivity (if a single feature change alters the prediction, that feature receives non-zero attribution) and Implementation Invariance (two functionally equivalent networks produce identical attributions). The algorithm computes the path integral of the gradient of the model's output with respect to the input, approximated in practice by summing gradients at discrete interpolation steps between a non-informative baseline (e.g., all-zero embedding) and the actual input sequence. For a genomic model predicting transcription factor binding, this produces a nucleotide-resolution importance map showing exactly which bases contributed to the binding prediction.

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.