# Explaining a Series of Models by Propagating Shapley Values

Hugh Chen, Scott M. Lundberg, Su-In Lee · arXiv · 2021-4-30

- **Problem** Explaining a series of models is harder than explaining one model, and model-specific attribution methods generally cannot be applied to a series of mixed models.
- **Method** Passes Shapley-based attributions backward through each model in a series using a generalized rescale rule, and averages single-baseline attributions over a baseline distribution.
- **Results** A single all-black baseline gives little attribution mass to black pixels in a CIFAR10 CNN with 75.56% test accuracy, while averaging over 1000 random training-image baselines assigns more credit to dark pixels.

![Figure 1: DeepSHAP estimates Shapley value feature attributions to explain a series of models using a baseline distribution.(a) Local feature attributions with…](https://refivu.com/papers/156a125e-30ec-4bbb-8d1f-a941c551d78c/figures/figure-a3b6a151654a07ba9c5604d2e868fcc5.png?thumb=512)

**Figure 1** :DeepSHAP estimates Shapley value feature attributions to explain a series of models using a baseline distribution.(a) Local feature attributions with DeepSHAP require explicands (samples being explained), a baseline distribution (samples being compared to), and a model that is comprised of a series of models. They can be visualized to understand model behavior (Appendix Section A.3). (b) Theoretical motivation behind DeepSHAP (Methods Sections 6.1 and 6.4). (c) The baseline distribution is an important, but often overlooked, parameter that changes the scientiﬁc question implicit in the local feature attributions we obtain. (d) Explaining a series of models enables us to explain groups of features, model loss, and complex pipelines of models (deep feature extraction and stacked generalization). Experimental setups are described in Appendix Section A.2.

[Original paper](https://arxiv.org/abs/2105.00108v2) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Hugh Chen, Scott M. Lundberg, Su-In Lee · Explaining a Series of Models by Propagating Shapley Values · Original paper figure · Extracted the figure area from page 3 of the original PDF.

## Why explaining a series of models is hard

Local feature attributions explain one prediction for one sample, and a series of models, where the output of one predictive model feeds into another, is inherently harder to explain than a single model. Stacked generalization, neural network feature extraction and consumer scores all produce such series. Model-agnostic methods such as IME, LIME and KernelSHAP work on any such pipeline, but their sampling-based estimates vary from run to run and their cost can be too high for large pipelines.

The setting that motivates the paper is distributed: each model in a series may belong to a different institution, and because the models are proprietary they cannot be shared. Model-agnostic methods need access to every model in the series, so they cannot run in that setting.

## Passing attributions back through the series

The target quantity is the interventional Shapley value, which is the Shapley value computed with an interventional conditional expectation over a flat causal graph. In that lift, the features in a chosen subset are set to the explicand's values, and the remaining features are treated by a do-operator that breaks their dependence on the chosen features.

A series is written as a composition of functions, with each intermediary model being the composition of the first few components, and the final model's output as the last component.

The last model in the series is explained directly, giving the attribution \\(\\psi\_k = \\hat{\\varphi}(h\_k, x\_e, x\_b)\\). Each earlier model then receives the attribution coming from the model after it. That attribution is divided element-wise by the change in the intermediate output between the explicand and the baseline, using Hadamard division, and the result is applied to the attribution of the model itself: \\(\\psi\_i = \\hat{\\varphi}(h\_i, x\_e, x\_b)\\,(\\psi\_{i+1} \\oslash (f\_i(x\_e)-f\_i(x\_b)))\\).

Hadamard division sets an output to 0 where the denominator is 0.

Each model in the series is explained by its own method: DeepLIFT with the rescale rule for deep models, interventional TreeSHAP for tree models, and exact interventional Shapley values for linear models. The generalized rescale rule extends DeepLIFT's rescale rule beyond neural network layers, and each step keeps efficiency, meaning the attributions of a model's inputs sum to the difference between its outputs at the explicand and at the baseline.

The attribution in the raw feature space is the first intermediate attribution, \\(\\psi\_1\\).

## Averaging over many baselines

Many attribution methods define the absence of a feature by masking it against one baseline sample, and a closely related earlier approach used the average of the inputs as its single baseline. The authors argue that, for non-linear models under the interventional lift, a single baseline is not the right choice.

Under the interventional lift, the interventional Shapley value equals the mean of single-baseline attributions over the baseline set D: \\(\\varphi(f,x\_e)=\\frac{1}{\|D\|}\\sum\_{x\_b\\in D}\\varphi(f,x\_e,x\_b)\\). Each single-baseline attribution is itself a Shapley value for the lift that sets the explicand's values against one baseline sample, and its terms sum to the model output at the explicand minus the output at that baseline.

The authors note that for linear models, averaging the baseline itself is equivalent to averaging the single-baseline attributions.

## Single baseline bias in a CIFAR10 CNN

The test uses a CNN with 75.56% test accuracy on CIFAR10. DeepLIFT is run with one all-black image as the baseline, while DeepSHAP averages over a random set of 1000 baselines drawn from training images.

With the single baseline, black pixels in the image receive little attribution mass, even though they are qualitatively important to the image. Averaging over many baselines gives dark pixels a much larger share of the attribution, and the authors read this as more sensible. The authors say the same bias appears for IME and Integrated Gradients, which also depend on baseline distributions; that comparison is in the appendix.

## Choosing the baseline distribution by clustering

Choosing the baseline as older males changes the attribution: the impact of sex disappears and the impact of age falls, because the comparison group now shares those features.

To choose the baseline automatically, the training data are clustered with k-means on a reduced set of features, such as age and gender. The cluster whose mean is closest to the explicand's reduced feature vector is used as the baseline distribution, as given by \\(\\arg\\min\_i \\\|\\hat{x}\_e-\\mu\_i\\\|\_2\\). The authors recommend clustering on non-modifiable features, because the resulting explanations answer questions about interpretable subpopulations.

In the two ablation tests on older male explicands, the baseline chosen by k-means clustering substantially outperforms a baseline drawn from the general population. The authors give two advantages: clustering on age and gender lowers the variance of the clustering features and so reduces their importance, and it may reduce model evaluation on off-manifold samples.

## Explaining model loss on NHANES

The model is trained on the first five NHANES cycles (1999-2008) and tested on the last three cycles (2009-2014).

For blood lead, the authors ablate the top 10 samples by loss distribution in the train and test sets and find that blood lead affects the test loss more. Ablating by the negative loss attribution increases the loss far more than ablating by output attribution, while ablating positive loss attributions lowers the mean loss, which output ablation cannot do.

Its positive loss ablation performance is extremely competitive, and its negative loss ablation performance is the best of the methods compared.

## Stacked pipeline on the HELOC data

The simulated pipeline partitions the HELOC features into fraud, credit and bank features, with fraud and credit models producing scores that feed a final risk model together with the bank features. Ablation tests hide the top 5 positive and top 5 negative features out of 22, and compare LIME, KernelSHAP and IME with 100 samples against DeepSHAP.

The model-agnostic methods need access to all models in the pipeline, while DeepSHAP lets each institution keep its proprietary model private.

Explanations use 1000 randomly sampled explicands with 100 randomly sampled baselines for all attribution methods. Using the generalized rescale rule, the pipeline's attributions are mapped back to the original features, which shows that the fraud score relied heavily on months since the oldest trade was opened and the credit score relied on months since most recent delinquency.

## Limitations

DeepSHAP is not guaranteed to satisfy axioms such as implementation invariance, which other feature attribution methods satisfy when their intractable problems are solved exactly. The authors suggest it suits model debugging and exploratory insight, while high-stakes decisions should use axiomatic methods run to completion or interpretable models.

The quantitative comparisons cover one CNN on CIFAR10, one NHANES loss setting, and one simulated HELOC pipeline, with the bias comparison shown on a single image.

## Paper info

- **Authors**: Hugh Chen, Scott M. Lundberg, Su-In Lee
- **Venue**: arXiv · Preprint
- **First published**: 2021-4-30
- **Added**: 2026-11-6
- **Updated**: 2021-10-13
- **Version**: v2
- **arXiv**: 2105.00108
- **DOI**: 10.1038/s41467-022-31384-3
- **Category**: cs.LG
- **Original paper terms**: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)
- **What we show**: Paper info, commentary and permitted figures from the original paper

[Original paper ↗](https://arxiv.org/abs/2105.00108v2) · [PDF ↗](https://arxiv.org/pdf/2105.00108v2)

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

## Abstract

Local feature attribution methods are increasingly used to explain complex machine learning models. However, current methods are limited because they are extremely expensive to compute or are not capable of explaining a distributed series of models where each model is owned by a separate institution. The latter is particularly important because it often arises in finance where explanations are mandated. Here, we present DeepSHAP, a tractable method to propagate local feature attributions through complex series of models based on a connection to the Shapley value. We evaluate DeepSHAP across biological, health, and financial datasets to show that it provides equally salient explanations an order of magnitude faster than existing model-agnostic attribution techniques and demonstrate its use in an important distributed series of models setting.

## Quote from the paper

Hugh Chen, Scott M. Lundberg, Su-In Lee (2021). Explaining a Series of Models by Propagating Shapley Values. arXiv:2105.00108v2. https://doi.org/10.1038/s41467-022-31384-3

**BibTeX**

```
@article{chen2021explaining,
  title = {{Explaining a Series of Models by Propagating Shapley Values}},
  author = {Hugh Chen and Scott M. Lundberg and Su-In Lee},
  year = {2021},
  eprint = {2105.00108},
  archivePrefix = {arXiv},
  doi = {10.1038/s41467-022-31384-3},
  url = {https://arxiv.org/abs/2105.00108v2}
}
```

## Related papers

- [On Large-Batch Training for Deep Learning: Generalization Gap and Sharp Minima](https://refivu.com/en/papers/9954c18e-def9-48fe-bfea-2f52f4ed7acb-on-large-batch-training-for-deep-learning-generalization.md)
- [Learning Important Features Through Propagating Activation Differences](https://refivu.com/en/papers/a23d41a4-f8c4-41eb-ac72-f85328d3740c-learning-important-features-through-propagating-activation.md)
- [Continual Lifelong Learning with Neural Networks: A Review](https://refivu.com/en/papers/322eae66-d551-4a11-a5e4-5955f903b100-continual-lifelong-learning-with-neural-networks-a-review.md)
- [Obfuscated Gradients Give a False Sense of Security: Circumventing Defenses to Adversarial Examples](https://refivu.com/en/papers/6d5ee375-978f-4c78-87e2-0c8e55a1127f-obfuscated-gradients-give-a-false-sense-of-security.md)
- [Reasoning in the loop: antibody lead optimization by probing mechanism and measurement](https://refivu.com/en/papers/ba413fe7-f8ea-4c82-bd3e-43f168752ec8-reasoning-in-the-loop-antibody-lead-optimization-by.md)
- [Deep Compression: Compressing Deep Neural Networks with Pruning, Trained Quantization and Huffman Coding](https://refivu.com/en/papers/7b8d214e-c983-4cf0-910e-176f0c996770-deep-compression-compressing-deep-neural-networks-with.md)

## Other paper commentary

- [The Reliability Function of Error-Correcting Output Codes with Noisy Binary Classifiers](https://refivu.com/en/papers/8c266525-b2cc-4dc5-bfd3-2f2927e30f5a-the-reliability-function-of-error-correcting-output-codes.md)
- [Typical Angina, Reversed: A Long-Standing Documentation Error in the UCI Heart Disease Data](https://refivu.com/en/papers/b1cd0f68-7d26-46cf-88cd-e57ef82a37ed-typical-angina-reversed-a-long-standing-documentation-error.md)
- [Cross-Layer Characterization and AI-Assisted Diagnosis of C-to-Rust Performance](https://refivu.com/en/papers/b9b8f973-d979-443f-b049-2f0218e3517a-cross-layer-characterization-and-ai-assisted-diagnosis-of.md)
- [When Is Product Decoding of ECOC MAP-Consistent? Pair Structure and the n-vs-Rest Codes](https://refivu.com/en/papers/91c0b439-85c0-4c82-8b80-68deaac338ab-when-is-product-decoding-of-ecoc-map-consistent.md)
- [Optimal Transport Meets t-SNE: Integrated Visualization without Batch Effects in OT-tSNE](https://refivu.com/en/papers/d3dac575-8b8b-4708-aa8c-3d0db81121bd-optimal-transport-meets-t-sne-integrated-visualization.md)
- [Predicting Rare-Mode Collapse in Recursive Generative Training from Single-Generation Calibration](https://refivu.com/en/papers/5c8147d8-eed2-4206-bf09-95dd28fcd1c5-predicting-rare-mode-collapse-in-recursive-generative.md)
- [Precise and Dexterous Robotic Manipulation via Human-in-the-Loop Reinforcement Learning](https://refivu.com/en/papers/f8ac2bf8-18ae-41b1-9229-515501c8d0d8-precise-and-dexterous-robotic-manipulation-via-human-in.md)
- [DL-Droid: Deep learning based android malware detection using real devices](https://refivu.com/en/papers/e8c4fb2d-bb8d-43c7-b570-745e501ed499-dl-droid-deep-learning-based-android-malware-detection.md)
- [A Deep Learning Approach for Brain Tumor Classification and Segmentation Using a Multiscale Convolutional Neural Network](https://refivu.com/en/papers/c75a012b-6db8-4ef0-a0e2-0109acd56af3-a-deep-learning-approach-for-brain-tumor-classification.md)
- [Embodied Intelligence via Learning and Evolution](https://refivu.com/en/papers/35077a07-2c81-4b05-87d4-0a4c83ef04af-embodied-intelligence-via-learning-and-evolution.md)
- [A Deep Cascade of Convolutional Neural Networks for Dynamic MR Image Reconstruction](https://refivu.com/en/papers/c81adf70-889d-4a7a-93f1-14353887187b-a-deep-cascade-of-convolutional-neural-networks-for.md)
- [Geometric Feature-Based Facial Expression Recognition in Image Sequences Using Multi-Class AdaBoost and Support Vector Machines](https://refivu.com/en/papers/35c52440-dea0-43bf-acc7-d2f2458fe00a-geometric-feature-based-facial-expression-recognition-in.md)

## Terms in this paper

- [CIFAR10](https://refivu.com/en/terms/19bd6ffb1901-cifar10)
- [LIME](https://refivu.com/en/terms/b95eeaba5517-lime)
- [Integrated Gradients](https://refivu.com/en/terms/7ea02692192e-integrated-gradients)
- [k-means clustering](https://refivu.com/en/terms/fe9b188ae278-k-means-clustering)
- [DeepLIFT](https://refivu.com/en/terms/db4f80bf1878-deeplift)
- [Shapley value](https://refivu.com/en/terms/f702ac842da6-shapley-value)
- [Rescale rule](https://refivu.com/en/terms/f7e80756b542-rescale-rule)
- [TreeSHAP](https://refivu.com/en/terms/0c1dc2bd288a-treeshap)

---

AI-written text can contain mistakes. [Refivu](https://refivu.com/en/papers/156a125e-30ec-4bbb-8d1f-a941c551d78c-explaining-a-series-of-models-by-propagating-shapley)
