Inferensys

Glossary

Integrated Gradients

A model interpretability technique that attributes the prediction of a deep network to its input features by accumulating the gradients along a path from a baseline input 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 model interpretability technique that attributes the prediction of a deep network to its input features by accumulating the gradients along a path from a baseline input to the actual input.

Integrated Gradients is an axiomatic feature attribution method that satisfies Sensitivity and Implementation Invariance. It computes the integral of the gradients of the model's output with respect to the input, taken along a straight-line path from a non-informative baseline (e.g., zeros or reference sequence) to the actual input. This path integral ensures that the difference between the model's output at the input and the baseline is exactly apportioned among the input features.

In genomics, the technique is critical for decoding sequence-to-expression models like Enformer. By interpolating from a reference genome to a variant sequence, it quantifies the contribution of individual nucleotides to a predicted expression change, enabling the discovery of de novo regulatory motifs without relying on prior annotations. The choice of baseline is crucial; a dinucleotide-shuffled sequence preserves local composition while ablating functional syntax.

AXIOMATIC ATTRIBUTION

Key Properties of Integrated Gradients

Integrated Gradients is defined by a set of mathematical axioms that guarantee its attributions are unique, fair, and theoretically sound. These properties distinguish it from heuristic saliency methods and make it suitable for high-stakes genomic model interpretation.

01

Sensitivity (Completeness)

The axiom of Sensitivity states that if an input feature differs from the baseline and causes a change in the prediction, it must receive a non-zero attribution. Completeness is a stronger corollary: the sum of all feature attributions must exactly equal the difference between the model's output for the actual input and the baseline input.

  • Guarantees no attribution is 'lost' during the calculation
  • For a genomic sequence model, the sum of nucleotide importance scores equals the total predicted expression change
  • Violated by simple gradient methods that can miss saturated features
Σ = ΔOutput
Completeness Guarantee
02

Implementation Invariance

Two functionally equivalent neural networks—networks that produce identical outputs for all inputs despite having different architectures or parameters—must yield identical attributions under Integrated Gradients.

  • Prevents attribution manipulation by architectural choices
  • A ResNet and a Transformer predicting the same expression levels from a promoter sequence will assign identical importance to a key TATA box motif
  • This property fails for methods like DeepLIFT or LIME, which depend on model internals or local sampling
03

Linearity

If a model is a linear combination of two sub-models, the Integrated Gradients attribution for the combined model is the same linear combination of the attributions from the sub-models.

  • Enables compositional debugging of ensemble models
  • If an expression predictor averages outputs from a CNN branch and an attention branch, the final attribution is the average of each branch's attribution map
  • Critical for verifying that multi-task learning models fairly weight shared genomic features
04

Symmetry Preservation

Two input variables that are symmetric with respect to the model—meaning swapping their values leaves the output unchanged—must receive identical attributions.

  • Ensures fair treatment of functionally equivalent features
  • In a homodimer binding prediction, two identical half-sites in a palindromic sequence receive equal importance scores
  • Prevents spurious asymmetry that could mislead biologists about which motif copy is the 'driver' of binding
05

Baseline Selection

The baseline input represents the 'absence' of signal and is a critical hyperparameter. The attribution explains the transition from this baseline to the actual input.

  • For genomic sequences, common baselines include a dinucleotide-shuffled sequence preserving local composition or a uniform 0.25 probability vector for each nucleotide
  • A poor baseline (e.g., all zeros) can create artifacts where the model extrapolates from non-biological inputs
  • The path integral accumulates gradients along a straight line from baseline to input in the embedding space
Shuffled
Preferred Genomic Baseline
INTERPRETABILITY

Frequently Asked Questions

Clear, technical answers to common questions about Integrated Gradients and its application in attributing deep learning model predictions to input features.

Integrated Gradients is a model interpretability technique that attributes the prediction of a deep network to its input features by accumulating the gradients along a straight-line path from a baseline input to the actual input. The method satisfies the completeness axiom, meaning the sum of all feature attributions equals the difference between the model's output for the actual input and the baseline. It works by computing the integral of the gradients of the model's output with respect to the input, approximated numerically by summing gradients at discrete interpolation points along the path. For a genomic sequence model predicting gene expression, the baseline is typically a neutral or uninformative sequence (e.g., all zeros or a reference genome), and the attributions highlight which nucleotides contributed positively or negatively to the predicted expression level.

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.