Inferensys

Glossary

Causal Shapley Values

An adaptation of Shapley values that incorporates a causal model of the data-generating process to assign feature importance based on causal effects rather than mere statistical associations.
Data engineer managing feature store on laptop, feature definitions visible, casual data engineering session.
CAUSAL FEATURE ATTRIBUTION

What is Causal Shapley Values?

Causal Shapley Values adapt the game-theoretic Shapley value to a causal model of the data-generating process, assigning feature importance based on interventional effects rather than statistical correlations.

Causal Shapley Values are a feature attribution method that computes the contribution of each input variable to a model's prediction by simulating interventions within a Structural Causal Model (SCM). Unlike standard SHAP, which relies on marginal distributions and can credit spurious correlations, this approach decomposes the prediction into the causal effects of directly manipulating features, isolating the true downstream impact of each variable.

By grounding importance in a causal graph, Causal Shapley Values resolve the confounding bias inherent in observational data. The method requires a known or inferred causal structure and uses asymmetric Shapley values to respect the causal ordering, ensuring that an effect variable does not receive credit for its cause. This provides a more robust and actionable explanation for high-stakes decision-making where understanding intervention is critical.

CAUSAL SHAPLEY VALUES

Key Characteristics

Causal Shapley Values extend the game-theoretic fairness of Shapley values by incorporating a Structural Causal Model (SCM). This shifts feature importance from mere statistical correlation to interventional and counterfactual reasoning, answering how a feature causes a prediction rather than just how it correlates with it.

01

Causal vs. Associational Importance

Standard Shapley values explain predictions based on observational data distributions, which can be misleading when features are correlated. Causal Shapley Values use a causal graph to simulate interventions.

  • Interventional Distribution: Breaks spurious links by setting a feature to a value directly, rather than conditioning on it.
  • Spurious Correlation: A feature can receive high importance in standard SHAP simply because it is correlated with a true cause; causal SHAP corrects this by blocking back-door paths.
02

The Asymmetric Shapley Value

A specific implementation of Causal Shapley Values that respects the asymmetry of causal relationships. It modifies the characteristic function of the game to reflect the causal graph's structure.

  • Causal Mechanism: The value function is defined by the marginal distribution of the outcome after intervening on a subset of features.
  • Fair Attribution: Ensures that a feature is only rewarded for its direct causal effect on the output, not for information it passively receives from upstream causes.
03

Handling Feature Dependencies

A core limitation of standard SHAP is its assumption of feature independence, which is often violated in real-world data. Causal Shapley Values explicitly model dependencies.

  • Causal Ordering: By defining a directed acyclic graph (DAG), the method knows which features are parents, children, or confounders.
  • Robust Explanations: This prevents the importance score from being diluted or inflated by multicollinearity, providing a more robust and legally defensible explanation for high-stakes decisions.
04

Counterfactual Fairness Integration

Causal Shapley Values align naturally with counterfactual fairness definitions. They can decompose a prediction change into causal components that answer 'what if' questions.

  • Direct vs. Indirect Effect: The method can separate the direct causal effect of a protected attribute (like race) from its indirect effect through legitimate mediating variables (like education).
  • Regulatory Compliance: This granular decomposition is critical for auditing automated decisions under regulations like the EU AI Act, proving that a decision was not based on a prohibited causal pathway.
05

Computational Implementation

Computing Causal Shapley Values requires both a trained predictive model and a validated Structural Causal Model (SCM). The process involves:

  • Graph Validation: The causal graph must be supplied by domain experts or learned via causal discovery algorithms.
  • Interventional Sampling: For each coalition of features, the algorithm samples from the interventional distribution defined by the SCM, which is computationally more intensive than marginal sampling in standard SHAP.
  • Tools: Libraries like DoWhy and CausalML provide implementations that integrate with popular SHAP frameworks.
06

Use Case: Medical Diagnosis

In a model predicting disease risk, a standard SHAP analysis might assign high importance to a biomarker that is merely a symptom of an underlying genetic cause. Causal Shapley Values correct this.

  • Scenario: A genetic mutation (unmeasured) causes both a high biomarker level and the disease.
  • Standard SHAP: Rewards the biomarker heavily because it is predictive.
  • Causal SHAP: Identifies that intervening on the biomarker does not change the disease risk, correctly assigning zero causal importance to the symptom and directing resources to the root cause.
CAUSAL SHAPLEY VALUES

Frequently Asked Questions

Clear, technically precise answers to the most common questions about integrating causal inference with Shapley-based feature attribution.

Causal Shapley Values are an adaptation of the Shapley value framework that assigns feature importance based on interventional effects derived from a Structural Causal Model (SCM) rather than observational conditional expectations. Standard SHAP values decompose a prediction by asking, 'What is the expected output if we condition on a subset of features?' This conditioning introduces spurious correlations when features are dependent, leading to attributions that reflect mere statistical association. Causal Shapley Values replace this conditioning with a formal do-operator, asking, 'What is the expected output if we intervene to set a subset of features to specific values?' This breaks the flow of confounding information along non-causal paths, ensuring that a feature only receives credit for the causal effect it exerts on the output, not for information it passively carries from a correlated confounder. The result is a feature attribution that is robust to distribution shifts and reflects the true mechanistic drivers of a model's prediction.

FEATURE ATTRIBUTION COMPARISON

Causal Shapley Values vs. Standard Shapley Values

A technical comparison of how causal Shapley values incorporate interventional distributions versus the observational conditional distributions used by standard Shapley values for feature attribution.

FeatureStandard Shapley ValuesCausal Shapley Values

Underlying distribution

Observational conditional distribution p(x_i | x_S)

Interventional distribution p(x_i | do(x_S))

Causal graph required

Handles feature correlation bias

Captures direct causal effects

Axiomatic foundation

Efficiency, Symmetry, Dummy, Additivity

Efficiency, Symmetry, Dummy, Additivity (extended to causal setting)

Computational complexity

O(2^n) per prediction

O(2^n) per prediction plus causal inference overhead

Sensitive to confounders

Primary use case

Model prediction explanation

Causal effect attribution

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.