Feature attribution is a family of methods that assigns each input feature a numerical score expressing how much that feature contributed to a model’s output, usually for a single prediction. In Explainable AI, it is the most widely used way to answer the question “why did the model predict this?” for tabular, image and text models alike.
An attribution method takes a trained model, an input and often a baseline or reference input, and returns a vector of scores with the same shape as the input. Positive scores push the prediction toward the explained output, negative scores push it away, and the magnitude indicates strength.
How feature attribution distributes a prediction
Feature attribution works by comparing the model’s output on the actual input with its output on modified or reference inputs, then dividing the difference among the features. The choice of what “absent” means for a feature, the baseline, strongly shapes the result: a black image, a blurred image, the training mean or a sample from the data distribution all give different answers.
Many methods aim for additive attributions, where the scores sum to the difference between the prediction and the baseline prediction. This property, called completeness or efficiency, lets an analyst read an explanation like a ledger: a credit score of 0.82 against a baseline of 0.30 is explained by contributions that add up to exactly 0.52.
Theoretical work defines desirable axioms that an attribution should satisfy. No practical method satisfies all of them at low cost, which explains why so many methods coexist.
| Axiom | Meaning | Methods that satisfy it |
|---|---|---|
| Completeness | Scores sum to output minus baseline output | Shapley values, Integrated Gradients, DeepLIFT |
| Sensitivity | A feature that changes the output gets a nonzero score | Integrated Gradients, Shapley values |
| Implementation invariance | Functionally identical models get identical scores | Integrated Gradients, exact Shapley values |
| Symmetry | Features with identical effect get equal scores | Shapley values |
| Dummy | A feature with no effect gets zero | Shapley values, occlusion |
Main families of attribution methods
Attribution methods fall into three main families: perturbation-based methods, gradient-based methods and game-theoretic methods built on the Shapley value. Some methods belong to more than one family; KernelSHAP, for example, is a perturbation method that estimates Shapley values.
| Family | Mechanism | Examples | Model access needed |
|---|---|---|---|
| Perturbation-based | Remove or alter features and observe output change | Occlusion sensitivity, LIME, permutation tests | Predictions only |
| Gradient-based | Use derivatives of the output with respect to inputs | Saliency, Gradient × input, SmoothGrad, Integrated Gradients | Gradients |
| Propagation-based | Redistribute the output backward through layers | DeepLIFT, Layer-wise relevance propagation | Internal activations |
| Game-theoretic | Average marginal contribution over feature coalitions | KernelSHAP, TreeSHAP, exact Shapley values | Predictions or tree structure |
Model-agnostic methods such as KernelSHAP and LIME work on any model but require hundreds to thousands of model evaluations per explanation. Model-specific methods such as TreeSHAP for gradient-boosted trees or Integrated Gradients for neural networks are much faster because they exploit the model structure.
Local and global attribution
Feature attribution is primarily a local explanation: it explains one prediction for one input. Aggregating local attributions across a dataset, for example by averaging absolute SHAP values, produces a global view of which features matter most for the model overall.
This aggregated view differs from permutation feature importance, which measures how much model performance drops when a feature is shuffled. Permutation importance is tied to a loss metric and labels, while aggregated attributions describe the model output and need no labels. The two can disagree, particularly when features are strongly correlated.
Global summaries built from attributions are useful for model debugging and auditing. Beeswarm plots of SHAP values show both the importance and the direction of each feature, while dependence plots reveal nonlinear effects and interactions. Such summaries still inherit every weakness of the underlying local method, so a misleading baseline distorts the global picture as well.
Attribution to input features is also distinct from training data attribution, which asks which training examples shaped a prediction, and from mechanistic interpretability, which studies internal circuits. Feature attribution stays at the input-output boundary and treats the model largely as a function to be probed.
Choosing an attribution method
Choosing an attribution method depends on the model type, the data modality, the compute budget and the audience of the explanation. A regulator reviewing a lending model needs stable, additive scores, whereas a computer vision engineer debugging a classifier may prefer a fast heat map.
| Situation | Suitable method | Reason |
|---|---|---|
| Gradient-boosted trees on tabular data | TreeSHAP | Exact Shapley values in polynomial time |
| Any black-box model, small feature count | KernelSHAP | Model-agnostic with theoretical grounding |
| Deep image classifier | Integrated Gradients or Grad-CAM | Fast, pixel or region level output |
| Transformer text model | Integrated Gradients on embeddings | Token-level scores that satisfy completeness |
| Quick sanity check | Occlusion sensitivity | Easy to implement and to interpret |
Practitioners should report the baseline and method settings together with any attribution, because the same model and input can produce visibly different explanations under different configurations. Libraries such as Captum and InterpretML expose these settings explicitly.
Limitations and failure modes
Feature attribution has well-documented limitations, and an attribution map should never be read as proof of causal reasoning inside the model. The scores describe the model’s sensitivity, not the real-world causes of the outcome.
- Correlated features: credit can be split arbitrarily between correlated inputs, and perturbations create unrealistic data points.
- Baseline dependence: different reference inputs yield different explanations for the same prediction.
- Gradient saturation: plain gradients can be near zero for features that matter a great deal.
- Instability: tiny input changes may produce very different saliency maps, and some maps pass the model-randomization sanity test poorly.
- Manipulability: models can be trained so that attributions hide reliance on a sensitive feature.
Because of these issues, mature teams evaluate explanation faithfulness with deletion and insertion tests, compare several methods, and treat attributions as hypotheses to verify rather than final answers.
Put simply
Feature attribution splits the credit for a decision among the pieces of information a model used. Imagine a team that wins a match. Someone asks how much each player helped. Attribution gives each player a score.
For an AI model, the players are inputs such as income, age or pixels. A high score means that input mattered strongly for this answer. A negative score means it pushed the answer the other way. The scores show what the model looked at, not whether the model was right.
In practice
A bank uses a gradient-boosted model to approve small business loans and must give rejected applicants the main reasons for a decision. Its data science team computes TreeSHAP attributions for every application, using the average applicant as the baseline.
For one rejected application, the predicted default risk is 0.41 against a baseline of 0.12. The attributions show that a short credit history added 0.15, high existing debt added 0.11, and stable revenue subtracted 0.04. The bank converts the top positive contributors into plain reason codes for the rejection letter. During a quarterly review, aggregated attributions also reveal that a postal code feature carried unexpected weight, which leads the team to remove a potential proxy for protected attributes before the next release.