Inferensys

Glossary

Sensitivity

A measure of how much a model's prediction for a class changes in response to perturbations along the direction of a concept vector in the activation space.
Engineer reviewing vector database search results on laptop, embeddings visualization on screen, home office coding session.
CONCEPT-BASED EXPLANATIONS

What is Sensitivity?

In concept-based interpretability, sensitivity quantifies how responsive a model's prediction is to a specific high-level concept.

Sensitivity is a measure of how much a model's prediction for a target class changes in response to perturbations along the direction of a Concept Activation Vector (CAV). It is formally computed as the directional derivative of the prediction score with respect to the concept vector, quantifying the model's reliance on that abstract idea.

This metric is the core of the Testing with CAVs (TCAV) framework, where a high sensitivity score indicates that the model's decision is strongly influenced by the presence of the concept. Statistical significance testing then validates whether this measured sensitivity is a true signal or merely a random artifact.

Concept-Based Explanations

Key Characteristics of Sensitivity

In the TCAV framework, sensitivity quantifies how responsive a model's class prediction is to infinitesimal perturbations along a concept vector. These characteristics define its computation, interpretation, and statistical validation.

01

Directional Derivative Formulation

Sensitivity is formally defined as the directional derivative of the logit for a target class with respect to the activations at a chosen layer, taken along the unit direction of a Concept Activation Vector (CAV).

  • Mathematically: S_{C,k,l}(x) = ∇h_{l,k}(f_l(x)) · v_C^l
  • h_{l,k} is the logit for class k from layer l
  • v_C^l is the CAV for concept C at layer l
  • This measures the instantaneous rate of change in the prediction as activations are nudged toward the concept
02

Statistical Significance via T-Test

Raw sensitivity scores alone are insufficient; TCAV applies a two-sided t-test to determine if a concept's sensitivity is statistically distinct from random noise.

  • A set of random vectors is generated with the same dimensionality as the CAV
  • Sensitivity scores for the concept are compared against the distribution from random vectors
  • A concept is considered meaningful only if the null hypothesis is rejected (typically p < 0.05)
  • This prevents spurious directions in the activation space from being misinterpreted as genuine concepts
03

Layer-Dependent Sensitivity

Sensitivity is not uniform across a network's depth; it varies significantly depending on the layer at which the CAV is computed.

  • Early layers: Sensitivity often reflects low-level features (textures, edges) and may show weak conceptual alignment
  • Middle layers: Typically exhibit the strongest sensitivity to mid-level semantic concepts
  • Final layers: Sensitivity aligns closely with class-relevant abstractions
  • Analyzing sensitivity across layers reveals the hierarchical emergence of conceptual understanding in the network
04

Concept Sensitivity Map

A Concept Sensitivity Map visualizes which spatial regions or input features most influence the directional derivative toward a concept.

  • Generated by computing the gradient of the sensitivity score with respect to the input
  • Highlights pixels or tokens that, if perturbed, would most change the model's alignment with the concept
  • Used to validate that sensitivity is driven by semantically relevant input regions, not spurious correlations
  • Provides a visual sanity check for concept-based explanations
05

Sensitivity vs. Concept Importance

Sensitivity measures local responsiveness to a concept direction, while Concept Importance aggregates this into a global metric.

  • Sensitivity: A per-input score; how much does this prediction change along the concept direction?
  • TCAV Score: The fraction of inputs in a class whose sensitivity scores are positive for the concept
  • ConceptSHAP: Uses Shapley values to assign a game-theoretic importance to each concept
  • Sensitivity is the foundational measurement; importance metrics are derived from distributions of sensitivity scores across datasets
06

Causal Intervention Testing

Sensitivity analysis is correlational by nature; Concept Intervention provides a causal counterpart by directly editing activations.

  • Activations are modified by adding or subtracting a scaled CAV: f_l'(x) = f_l(x) + ε · v_C^l
  • The resulting change in the output logit confirms whether the concept causally influences the prediction
  • A concept with high sensitivity but zero causal effect may be an epiphenomenon—correlated but not causative
  • Combining sensitivity with intervention yields robust concept validation
CONCEPT SENSITIVITY

Frequently Asked Questions

Explore the core questions about how concept sensitivity is measured, validated, and applied to audit the alignment of neural network predictions with high-level human knowledge.

Sensitivity is a quantitative measure of how much a model's prediction for a target class changes in response to infinitesimal perturbations along the direction of a Concept Activation Vector (CAV) in the activation space. It is formally defined as the directional derivative of the class score with respect to the activations, projected onto the unit-normalized concept vector. A high sensitivity score indicates that the model's decision is strongly influenced by the presence or absence of that specific high-level concept, providing a direct link between an abstract human idea and the model's internal logic.

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.