Inferensys

Glossary

Additive Feature Attribution

A class of explanation methods that decompose a model's prediction into a sum of individual feature contributions relative to a baseline, providing a linear explanation of the output.
Data engineer managing feature store on laptop, feature definitions visible, casual data engineering session.
EXPLANATION METHOD CLASS

What is Additive Feature Attribution?

A class of explanation methods that decompose a model's prediction into a sum of individual feature contributions relative to a baseline.

Additive feature attribution is a class of post-hoc explanation methods that decompose a model's prediction into a linear sum of individual feature contributions, or attributions, relative to a reference baseline. The core principle is that the final prediction output equals the baseline prediction plus the sum of each feature's attributed effect, providing a complete and fair accounting of how the input features drove the decision. This linear decomposition makes complex, non-linear models locally interpretable.

This framework unifies several popular explanation techniques, most notably LIME and SHAP. The defining property is that the explanation model is a linear function of binary variables representing feature presence. SHAP, grounded in game theory, uses Shapley values to guarantee a unique, fair distribution of credit among features, while LIME approximates this behavior locally. The additive structure ensures that the sum of all feature attributions exactly equals the difference between the model's output for the specific instance and the expected baseline output, a property known as local accuracy or efficiency.

FOUNDATIONAL AXIOMS

Core Properties of Additive Feature Attribution

Additive feature attribution methods are defined by three core properties that guarantee explanation uniqueness and consistency. These axioms, rooted in game theory, ensure that a model's prediction is fairly decomposed into a sum of individual feature contributions.

01

Local Accuracy

The explanation model must perfectly match the original model's output for the specific input being explained. If f(x) is the original prediction and g(x') is the additive explanation, then f(x) = g(x') = φ_0 + Σ φ_i.

  • Property: The sum of all feature attributions plus a baseline equals the model's exact prediction.
  • Mechanism: The baseline φ_0 represents the model's output when all features are 'missing' or set to a reference value.
  • Constraint: This forces the explanation to be a faithful, zero-error decomposition of the single prediction, not an approximation.
f(x)
Original Prediction
Σ φ_i
Sum of Attributions
02

Missingness

If a feature is missing from the original input—meaning its value is set to a baseline or reference point—its attribution must be exactly zero.

  • Property: x'_i = 0 implies φ_i = 0.
  • Purpose: Ensures that features which do not contribute to the prediction are not arbitrarily assigned importance.
  • Implementation: In SHAP, missingness is handled by integrating over the feature's distribution; in LIME, it is enforced by the interpretable representation where a '0' indicates absence.
  • Contrast: This is a critical distinction from simple gradient-based methods, which can assign non-zero importance to features with zero value.
03

Consistency

If a model changes so that a feature's marginal contribution increases or stays the same regardless of other features, that feature's attribution must not decrease.

  • Property: If f'_x(S ∪ i) - f'_x(S) ≥ f_x(S ∪ i) - f_x(S) for all subsets S, then φ_i(f', x) ≥ φ_i(f, x).
  • Significance: This axiom guarantees that a feature's importance score is logically monotonic with its actual impact on the model.
  • Uniqueness: Combined with local accuracy and missingness, consistency forces a single, unique solution—the Shapley values.
04

Shapley Value Uniqueness

The three core properties—local accuracy, missingness, and consistency—collectively prove that Shapley values are the only possible additive feature attribution method that satisfies all axioms.

  • Game Theory Origin: Shapley values were originally derived to fairly distribute a coalition's payout among players based on their marginal contributions.
  • ML Translation: In machine learning, 'players' become input features, and the 'payout' is the model's prediction relative to a baseline.
  • SHAP Framework: SHAP (SHapley Additive exPlanations) is the direct implementation of this proof, unifying LIME, DeepLIFT, and other methods under a single theoretical umbrella.
05

Additivity vs. Interaction Effects

Additive explanations decompose a prediction into a sum of independent feature contributions, but real models often rely on complex feature interactions.

  • Limitation: An additive explanation cannot directly represent interaction effects where the combined impact of two features differs from the sum of their individual impacts.
  • Workaround: SHAP extends the framework with Shapley interaction values, which decompose the prediction into a matrix of main effects and pairwise interaction terms.
  • Trade-off: While interaction values capture more model complexity, they sacrifice the simplicity and human-interpretability of a purely additive bar chart.
06

Baseline Definition

The choice of the baseline or reference value is a critical, non-trivial design decision that anchors the entire additive explanation.

  • Role: The baseline represents the 'absence' of information and determines the starting point φ_0 from which feature contributions are measured.
  • Common Choices: An all-black image for vision models, a zero-vector or [MASK] token for text, or the dataset mean for tabular data.
  • Impact: A poorly chosen baseline can produce misleading attributions. For example, using a zero pixel value may conflate 'missing' with 'black'.
  • Best Practice: The baseline should be an in-distribution, neutral input that represents a true absence of signal for the specific domain.
LOCAL EXPLANATION METHOD COMPARISON

LIME vs. SHAP: Additive Attribution Approaches

A technical comparison of the two dominant additive feature attribution frameworks for generating instance-level explanations of black-box model predictions.

FeatureLIMESHAPIntegrated Gradients

Theoretical Foundation

Local surrogate modeling with perturbation sampling

Shapley values from cooperative game theory

Path integral of gradients from baseline to input

Model-Agnostic

Guarantees Additivity

Local Fidelity Guarantee

Requires Model Internals

Computational Cost

Low to moderate

High (exponential in features)

Moderate (requires multiple forward/backward passes)

Handles Structured Data

Handles Image Data

Handles Text Data

Explanation Stability

Varies with kernel width and sampling

Deterministic given sufficient samples

Deterministic given sufficient steps

Baseline/Reference Value Required

Output Format

Sparse linear weights on interpretable features

Additive Shapley value per original feature

Attribution scores summing to prediction difference

Kernel/Weighting Mechanism

Exponential kernel based on cosine or L2 distance

Shapley kernel for weighted least squares

Riemann sum approximation along straight-line path

Handles Feature Interactions

Supports Global Explanations

ADDITIVE FEATURE ATTRIBUTION

Frequently Asked Questions

Clear answers to common questions about additive feature attribution methods, the mathematical framework that decomposes complex model predictions into a sum of individual feature contributions.

Additive feature attribution is a class of model explanation methods that decompose a single prediction into a sum of individual feature contributions, all measured relative to a baseline or expected value. The core equation is g(z') = φ₀ + Σ φᵢz'ᵢ, where φ₀ is the baseline prediction (the model's output when no features are present), φᵢ is the Shapley value or attribution weight for feature i, and z'ᵢ is a binary variable indicating whether that feature is observed (1) or missing (0). This linear explanation model satisfies three critical properties: local accuracy (the explanation matches the original prediction when all features are present), missingness (missing features receive zero attribution), and consistency (if a model changes so a feature's contribution increases, its attribution never decreases). Both LIME and SHAP are unified under this framework, with SHAP providing the unique solution that satisfies all three properties simultaneously.

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.