On Locality of Local Explanation Models

Sahra Ghalebikesabi, Lucile Ter-Minassian, Karla Diaz-Ordaz, Chris Holmes

TL;DR

This paper introduces Neighbourhood SHAP, a refinement of the popular SHAP explanation method that replaces global reference populations with local ones. By focusing on an instance's immediate neighbors, the authors improve local interpretability, ensure explanations stay "on-manifold," and significantly increase robustness against adversarial attacks designed to fool standard explainers.

What Problem Does This Paper Address?

Machine learning models are often "black boxes." To understand them, researchers use local explanation methods like LIME and SHAP, which attribute importance to specific features for a single prediction. However, these methods have a hidden "global" dependency: they calculate feature importance by comparing a specific instance against a global population distribution.

This leads to two major issues:

  1. Misleading Local Insights: A feature might be globally important but locally irrelevant (or vice versa). Standard SHAP can fail to capture how model behavior changes near decision boundaries.
  2. Off-Manifold Evaluations: When SHAP "removes" a feature, it often replaces it with values from random samples in the dataset. This can create synthetic data points that are physically impossible or outside the "data manifold" (the region where real data actually lives). Adversaries can exploit this by creating models that behave "fairly" on these impossible points while remaining biased on real data.

Methods

The authors propose two main extensions to the Shapley value framework:

  • Neighbourhood SHAP: Instead of treating all reference samples equally, this method uses a distance-based kernel (like the Nadaraya-Watson estimator) to weight samples. Points closer to the test instance $x$ get higher weights. This ensures the "absence" of a feature is simulated using values from similar individuals rather than the entire population.
  • Smoothed SHAP: This addresses the instability of explanations. Black-box models can be highly non-linear; a tiny change in input might wildly swing the SHAP values. Smoothed SHAP locally averages attributions across a neighborhood to provide a more stable, Lipschitz-continuous summary of feature relevance.

Crucially, the authors show that Neighbourhood SHAP can be implemented efficiently using self-normalised importance sampling. This means researchers can compute explanations for multiple "neighborhood sizes" (bandwidths) without needing to re-evaluate the expensive black-box model multiple times.

Datasets

The authors validated their approach across several standard benchmarks and domains:

  • Tabular UCI Datasets: Adult (income prediction), Boston Housing, Bike Sharing, and Iris.
  • Image Data: MNIST (handwritten digits).
  • Fairness Benchmarks: COMPAS (recidivism prediction), used specifically to test robustness against adversarial "fairness" attacks.

Key Insights and Ideas

  • The Sign Flip: A feature can have a positive global attribution but a negative local one. As seen in Figure 2, standard SHAP might report a positive value because the instance is above the global average, while Neighbourhood SHAP correctly identifies a local minimum, yielding a negative attribution. Illustration of how local vs. global expectations can flip the sign of an attribution
Illustration of how local vs. global expectations can flip the sign of an attribution
  • Staying on the Manifold: Standard SHAP often evaluates the model on "impossible" data points. Figure 3 illustrates this using a ring-shaped data manifold; standard SHAP (left) evaluates points in the empty center of the ring, whereas Neighbourhood SHAP (right) stays within the blue cloud of real data. Comparison of off-manifold (KernelSHAP) vs. on-manifold (Neighbourhood SHAP) evaluations
Comparison of off-manifold (KernelSHAP) vs. on-manifold (Neighbourhood SHAP) evaluations
  • Adversarial Robustness: Because standard explainers look at off-manifold points, an adversary can hide biases in those regions. Neighbourhood SHAP forces the explainer to look only at realistic neighbors, making it much harder for a biased model to "pretend" to be fair.

Key Results

  • Local Accuracy: Neighbourhood SHAP with small bandwidths predicts local model outcomes significantly better than global SHAP, as measured by Mean Squared Error (MSE) across multiple datasets.
  • Sparsity: Neighbourhood SHAP tends to produce sparser attributions, highlighting only the features that truly drive local changes rather than those that just distinguish the point from the global mean.
  • Decision Boundary Sensitivity: In synthetic tests (Figure 1), standard SHAP and LIME assigned constant attributions regardless of the distance to the decision boundary. Neighbourhood SHAP correctly showed that Feature-1 becomes more important as the instance approaches the boundary at $x_1 = 0$. Attributions near a decision boundary
Attributions near a decision boundary

Limitations and Future Work

  • Bandwidth Selection: Like all kernel-based methods, the results depend on the choice of "neighborhood size" ($\sigma$). While the authors provide diagnostic plots to help choose, there is no single "correct" value.
  • The Curse of Dimensionality: In very high-dimensional spaces, Euclidean distance becomes less meaningful. The authors suggest using more sophisticated metrics (like those derived from Random Forests) but acknowledge this adds complexity.
  • Computational Cost: While their importance sampling trick helps, calculating these values for very large datasets or complex models still requires significant background samples to ensure low variance.

Summary updated

BibTeX
@inproceedings{ghalebikesabi2021locality,
  author = {Sahra Ghalebikesabi and Lucile Ter-Minassian and Karla Diaz-Ordaz and Chris Holmes},
  title = {{On Locality of Local Explanation Models}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2021},
  url = {https://openreview.net/forum?id=6OkPFFMgBt},
}
Figure