ModelRefs / SHAP (SHapley Additive exPlanations) — AI Glossary
SHAP (SHapley Additive exPlanations) — AI Glossary
An explainability framework using game-theoretic Shapley values to assign each feature a fair attribution for a model's prediction.
Overview
SHAP (Lundberg & Lee 2017) computes the average marginal contribution of each feature across all possible feature subsets. TreeSHAP is exact and fast for tree models; KernelSHAP approximates for any model. For LLMs: SHAP values on input tokens explain which tokens drove a classification. The current standard for feature attribution.
Reference details
| Topic | safety |
|---|---|
| Last reviewed | 2026-06-24 |
Related terms
Example: The attributions have to add up, and that is the point
The defining property is additivity: the feature contributions sum exactly to the prediction minus the base value. If the average prediction is 0.30 and this instance scores 0.82, the contributions must total 0.82 − 0.30 = 0.52 — say +0.30, +0.15, +0.09 and −0.02. That is a real constraint, and it is what makes the attributions comparable across features and across instances. Local surrogate methods offer no such guarantee, which is why their explanations can shift between runs. The cost is computation: exact values consider all feature subsets, so anything beyond tree models is an approximation with its own sampling error.
Commonly confused with
SHAP and LIME both attribute a prediction to features, on different foundations. SHAP computes Shapley values with consistency and additivity guarantees at higher cost; LIME fits a local surrogate — faster, and sensitive to how its neighbourhood was sampled. Where they disagree, the disagreement is information: it usually means the local behaviour is not well approximated by either simple account.
When to use it
Reach for it when:
- Tabular models, especially trees, where the exact algorithm is fast
- Regulated settings needing a defensible, reproducible attribution method
- Global feature importance built by aggregating local attributions
Reach for something else when:
- High-dimensional text or images without accepting a sampling approximation
- As a causal claim — attribution describes the model's behaviour, not the world
- Where correlated features make individual credit assignment inherently ambiguous
Continue your research
Use these connected ModelRefs sections to compare alternatives, inspect implementation paths, and review the evidence and governance boundaries relevant to SHAP (SHapley Additive exPlanations) — AI Glossary.
Frequently asked questions
What is SHAP (SHapley Additive exPlanations)?
An explainability framework using game-theoretic Shapley values to assign each feature a fair attribution for a model's prediction.
What concepts are related to SHAP (SHapley Additive exPlanations)?
Closely related concepts include lime, interpretability, xai.