Inferensys

Glossary

Attribution Sanity Checks

A suite of tests, including model parameter randomization, designed to verify that an attribution method is sensitive to the learned parameters of the genomic model.
ML engineer managing model training cluster on laptop, GPU utilization visible, technical deep learning setup.
MODEL INTERPRETABILITY VALIDATION

What is Attribution Sanity Checks?

A rigorous suite of empirical tests designed to verify that a feature attribution method is genuinely sensitive to the learned parameters of a genomic model, rather than producing plausible-looking but uninformative edge-detectors.

Attribution Sanity Checks are a diagnostic framework for validating the trustworthiness of feature attribution methods applied to genomic neural networks. The core principle involves systematically corrupting the model's learned parameters through cascading randomization, starting from the output layer and progressing toward the input. If an attribution map remains visually identical after the model's weights have been scrambled, the method is deemed unreliable, as it is insensitive to the model's actual training.

A critical variant, the data randomization test, verifies that an attribution method depends on the true data-generating relationship. By training a model on a version of the dataset where input sequences have been randomly permuted relative to their labels, the resulting attributions must differ significantly from those of a properly trained model. Passing these sanity checks confirms that an interpretability technique is not merely an edge detector but is faithfully reflecting the learned biological logic.

VALIDATION PROTOCOLS

Key Characteristics of Sanity Checks

A rigorous suite of tests designed to verify that an attribution method is genuinely sensitive to the learned parameters of a genomic model, rather than producing plausible-looking but uninformative edge detectors or sequence biases.

01

Model Parameter Randomization

The foundational sanity check that cascades randomization from the output layer backward. If an attribution method is faithful, its output must degrade when model parameters are destroyed.

  • Cascading Randomization: Weights are re-initialized layer-by-layer, starting from the top. Attribution maps should diverge from the original at the first randomization step.
  • Similarity Metrics: Use rank correlation (Spearman) or structural similarity indices to quantify the divergence between original and randomized attributions.
  • Failure Mode: If an attribution map remains unchanged after full randomization, the method is acting as an edge detector or sequence complexity analyzer, not a model explainer.
Layer-wise
Cascading Protocol
02

Data Randomization Test

A complementary check where the model is trained on a version of the dataset where input sequences have been randomly permuted relative to their labels. A valid attribution method must produce fundamentally different explanations for a model trained on nonsense data.

  • Label Permutation: Shuffle the mapping between genomic sequences and their target labels before training.
  • Expected Outcome: Attribution maps from the data-randomized model should show no biologically coherent motifs or known transcription factor binding sites.
  • Comparison Baseline: Quantify the difference using TF-MoDISco motif recovery rates between the real and randomized models.
03

Edge Case Sensitivity

Verification that the attribution method correctly handles constant or near-constant input sequences where no single nucleotide should be deemed important.

  • Zero-Entropy Inputs: A sequence of all adenine (poly-A) should yield uniformly near-zero attribution scores.
  • Synthetic Constructs: Test with sequences containing a single strong motif embedded in random background. The method must isolate only the motif.
  • Gradient Saturation: Ensure the method does not produce artificially high attributions in regions where the model's output is saturated and gradients vanish.
04

Faithfulness Metrics

Quantitative evaluation of how accurately an attribution map reflects the model's true decision logic, measured through systematic perturbation experiments.

  • AOPC (Area Over the Perturbation Curve): Sequentially mask the most salient nucleotides and measure the drop in prediction probability. A steep drop indicates high faithfulness.
  • ROAR (RemOve And Retrain): Retrain the model after removing the top-k attributed features. If the method is faithful, retraining on the remaining features should recover performance.
  • Infidelity Measure: Compute the expected mean-squared error between a perturbation to the input and the corresponding perturbation to the attribution map.
AOPC
Primary Metric
ROAR
Retraining Benchmark
05

Biological Plausibility Audit

A domain-specific sanity check that validates attributions against established biological knowledge bases, ensuring explanations are not just faithful to the model but also to molecular biology.

  • Motif Database Overlap: Compare high-attribution subsequences against known motifs in JASPAR or ENCODE databases using Tomtom.
  • Evolutionary Conservation: Overlay attribution maps with PhyloP or GERP conservation scores. Functional regulatory elements should show both high attribution and high conservation.
  • Saturation Mutagenesis Concordance: Validate that nucleotide-level attribution scores correlate with experimentally measured Deep Mutational Scan (DMS) effect sizes.
06

Implementation-Independent Consistency

A meta-check ensuring that the attribution method's output is stable across different implementations, software libraries, and hardware backends.

  • Cross-Library Validation: Compare outputs from Captum, DeepExplain, and SHAP implementations. Results should be numerically identical within floating-point tolerance.
  • Deterministic Reproducibility: Verify that running the same method on the same model and input with the same random seed produces bit-for-bit identical attributions.
  • Numerical Precision: Test under FP32, FP16, and BF16. Significant divergence under reduced precision indicates an unstable implementation unsuitable for production.
ATTRIBUTION SANITY CHECKS

Frequently Asked Questions

A technical deep-dive into the validation methodologies used to ensure that feature attribution maps faithfully reflect the learned logic of a genomic model, rather than producing misleading or edge-detecting noise.

An attribution sanity check is a validation framework designed to verify that a feature attribution method is sensitive to the learned parameters of a genomic model, not just the input data structure. The core principle involves comparing the attribution maps generated by a trained model against those generated by a parameter-randomized model. If an attribution method passes the sanity check, the attributions from the trained model should differ significantly from those of the untrained, randomized network. This ensures the explanation is genuinely capturing the model's learned biological signal—such as transcription factor binding motifs—rather than acting as a generic edge detector that highlights nucleotide transitions regardless of training. Failure indicates the method is architecture-dependent but task-agnostic, making it unreliable for identifying causal genomic variants.

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.