Inferensys

Glossary

Integrated Gradients

An axiomatic feature attribution method that computes the path integral of gradients from a baseline input to the actual input, satisfying the completeness axiom for genomic sequence models.
Data engineer managing feature store on laptop, feature definitions visible, casual data engineering session.
AXIOMATIC FEATURE ATTRIBUTION

What is Integrated Gradients?

An axiomatic feature attribution method that computes the path integral of gradients from a baseline input to the actual input, satisfying the completeness axiom for genomic sequence models.

Integrated Gradients is an interpretability algorithm that assigns an importance score to each input feature by accumulating the gradients of a model's output with respect to the input along a straight-line path from a baseline to the actual input. The method satisfies the completeness axiom, meaning the sum of all feature attributions exactly equals the difference between the model's prediction at the input and its prediction at the baseline.

In genomic sequence analysis, the baseline is typically a reference genome or a sequence of zeros, and the path integral quantifies how each nucleotide contributes to a prediction as the input transitions from the baseline to the observed variant. Because it satisfies sensitivity and implementation invariance, Integrated Gradients provides a theoretically grounded alternative to raw gradient-based saliency maps, enabling rigorous auditing of variant effect predictions and transcription factor binding models.

AXIOMATIC ATTRIBUTION

Key Properties of Integrated Gradients

Integrated Gradients is defined by a set of mathematical properties that make it a theoretically sound and practically reliable feature attribution method for genomic sequence models. These properties ensure the explanations are consistent, complete, and faithful to the model's logic.

01

Completeness (Summation to Delta)

The Completeness axiom dictates that the sum of all feature attributions must exactly equal the difference between the model's output for the actual input and the baseline input. For a genomic model predicting binding affinity, this means the sum of all nucleotide importance scores perfectly accounts for the total change in the prediction from a neutral reference sequence. This property guarantees no attribution is unaccounted for, providing a full and auditable decomposition of the prediction, which is critical for regulatory compliance in clinical genomics.

100%
Attribution Accountability
02

Sensitivity (Dummy Variable Test)

The Sensitivity axiom states that if a single feature differs between the baseline and the input, and changing that feature alters the model's prediction, it must receive a non-zero attribution. Conversely, a feature that has no effect on the output must receive zero attribution. In a genomic context, if mutating a single nucleotide from the reference allele to an alternate allele changes a variant effect prediction, Integrated Gradients is guaranteed to assign a non-zero importance score to that specific position, ensuring no influential variant is overlooked.

03

Implementation Invariance

Two functionally equivalent neural networks—meaning they produce identical outputs for all inputs—will yield identical attributions under Integrated Gradients, regardless of their internal architectural differences. This Implementation Invariance is crucial for genomic models where the same predictive function might be learned by a convolutional network or a transformer. It ensures that the explanation is a property of the model's mathematical function, not an artifact of a specific training run or weight configuration, enabling consistent interpretation across different model versions.

04

Linearity (Path Integral)

Integrated Gradients is fundamentally a path integral of gradients along a straight line from a baseline input to the actual input. This linear path ensures that the attribution is computed symmetrically and avoids the saturation problem common in simple gradient methods. For a genomic sequence, the method interpolates between a reference sequence (e.g., all zeros or expected dinucleotide frequencies) and the observed sequence, accumulating the gradient of the prediction at each infinitesimal step. This path integral approach is what mathematically guarantees the Completeness axiom.

05

Symmetry Preservation

If two input features are symmetric with respect to the model's function—meaning swapping their values leaves the output unchanged—they must receive identical attributions. In a genomic model, two perfectly palindromic binding sites for a transcription factor would be assigned equal importance scores. This Symmetry Preservation property ensures that Integrated Gradients respects the inherent symmetries of the biological sequence and the model's learned function, preventing spurious asymmetries in the explanation that could mislead a researcher about the relative importance of identical motifs.

06

Baseline Selection

The choice of baseline is a critical hyperparameter that encodes the definition of 'absence' in a genomic context. Common baselines include a sequence of all zeros, a uniform dinucleotide-shuffled sequence, or a set of random sequences averaged together. The baseline represents a neutral or uninformative input. For variant effect prediction, the reference allele often serves as the baseline, and the alternate allele is the input, allowing the attribution to directly quantify the functional impact of the mutation. The explanation is always relative to this chosen reference point.

INTERPRETABILITY DEEP DIVE

Frequently Asked Questions

Explore the mechanics, axioms, and practical applications of Integrated Gradients for explaining deep learning predictions on genomic sequences.

Integrated Gradients is an axiomatic feature attribution method that computes the contribution of each input nucleotide to a genomic model's prediction by accumulating the gradients along a straight-line path from a baseline input to the actual input. It directly addresses the saturation problem where gradients of important features can be near-zero, causing standard gradient-based methods to miss them. The method works by interpolating between a non-informative baseline (e.g., all-zero embedding or a reference genome) and the actual sequence, computing the gradient of the model's output with respect to the input at each interpolated point, and then integrating these gradients. The resulting attribution map satisfies the completeness axiom, meaning the sum of all feature attributions exactly equals the difference between the model's output for the input and the baseline. For a genomic sequence model predicting transcription factor binding, this produces a per-nucleotide importance score that highlights the specific base pairs driving the prediction, such as the core binding motif.

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.