s-LIME: Reconciling Locality and Fidelity in Linear Explanations

Romaric Gaudel, Luis Galárraga, Julien Delaunay, Laurence Rozé, Vaishnavi Bhargava

TL;DR

While LIME is a gold standard for explaining "black-box" AI, it suffers from a paradox: making explanations more "local" can actually make them less accurate. s-LIME (Smoothed LIME) resolves this by replacing LIME's discrete, weighted sampling with a continuous neighborhood generation process, ensuring explanations remain faithful even at the most granular levels.

What Problem Does This Paper Address?

To understand why a complex model (like a deep neural network) made a specific decision, researchers often use LIME. LIME's core idea is "local fidelity": even if a model is incredibly complex globally, it should look like a simple linear model if you zoom in close enough to a single data point.

However, the authors identify a locality-fidelity paradox. In theory, the more you zoom in (by decreasing the "bandwidth" parameter $\sigma$), the better the linear approximation should be. In practice, LIME's design causes the surrogate model to "degenerate" at small scales—often returning zero weights or nonsensical results. This happens because LIME first generates a fixed set of neighbors and then weights them; at very small bandwidths, the weight concentrates entirely on the target instance itself, leaving the algorithm with no meaningful data to learn from.

Methods

The authors propose s-LIME (Smoothed LIME) to reconcile locality and fidelity.

  • The Standard Approach (LIME): Generates a discrete neighborhood (e.g., turning image super-pixels on or off) and then applies an exponential kernel to weight those neighbors based on distance.
  • The s-LIME Approach: Instead of a two-step "generate then weight" process, s-LIME generates neighbors in a single step directly from a continuous distribution $\nu_\sigma$ centered around the target instance.
  • Mathematical Grounding: The authors prove that as the bandwidth $\sigma$ tends toward zero, s-LIME's coefficients converge to the actual gradient of the black-box model. This gives the explanation a clear mathematical meaning: it represents the "rate of change" for each feature at that specific point.

The implementation varies by data type:

  • Images/Time Series: It uses a uniform distribution to slightly perturb the intensity of super-pixels or time segments.
  • Tabular Data: It uses a multivariate Gaussian distribution centered on the instance.

Datasets

The researchers evaluated s-LIME across three distinct data modalities:

  • Tabular: UCI Wine dataset, Compas (recidivism risk), and Diabetes datasets.
  • Images: MNIST (handwritten digits) and Cifar10 (object classification).
  • Time Series: FordA and StarlightCurves from the UEA & UCR repository.

They tested these against various "black boxes," including Random Forests, Logistic Regression, and Deep Neural Networks (AlexNet, VGG16, RESNET).

Key Insights and Ideas

  • The Degeneracy Trigger: The paper visually demonstrates that LIME’s failure at low $\sigma$ is due to "trivial training sets." When the bandwidth is too small, the surrogate model effectively sees only one data point, making it impossible to calculate a slope (feature attribution).
  • $R^2$ as a Compass: The authors found that the coefficient of determination ($R^2$) is an excellent proxy for explanation quality. By maximizing $R^2$, users can automatically find the "optimal" level of locality for a specific instance.
  • Smoothness Matters: s-LIME performs best on "smooth" models (like neural networks) where gradients are well-defined. For "piece-wise constant" models (like Decision Trees or Random Forests), the gradient is often zero, meaning very local explanations are mathematically correct but practically useless. In these cases, a larger bandwidth is actually preferable.

Key Results

  • Superior Fidelity: In almost all tests on smooth models, s-LIME achieved higher $R^2$ scores and better "coverage" (overlap with ground-truth important features) than standard LIME.
  • Stability at the Limit: While LIME's performance drops to zero as $\sigma$ approaches $10^{-4}$, s-LIME’s fidelity remains high or even improves.
  • Better Feature Attribution: On the Compas and Diabetes datasets, s-LIME consistently outperformed LIME in recall and precision, meaning it was better at identifying the features the model actually relied upon.

Limitations and Future Work

  • No Text Support: Because s-LIME relies on a continuous surrogate space to calculate perturbations, it cannot currently be applied to text data, which is inherently discrete (words are either there or they aren't).
  • The "Flatness" Problem: As noted, s-LIME struggles with tree-based models at high locality because those models have "flat" decision surfaces.
  • Future Directions: The authors suggest investigating different types of generating distributions beyond Gaussian and Uniform, and exploring how s-LIME impacts the stability of explanations (ensuring similar points get similar explanations).

Summary updated

BibTeX
@inproceedings{gaudel2022s,
  author = {Romaric Gaudel and Luis Galárraga and Julien Delaunay and Laurence Rozé and Vaishnavi Bhargava},
  title = {{s-LIME: Reconciling Locality and Fidelity in Linear Explanations}},
  booktitle = {IDA},
  year = {2022},
  url = {https://openreview.net/forum?id=3-ZV6L6FUsi},
}
Figure