To trust or not to trust an explanation: using LEAF to evaluate local linear XAI methods

Elvio G. Amparore, Alan Perotti, Paolo Bajardi · DOI

Abstract

The main objective of eXplainable Artificial Intelligence (XAI) is to provide effective explanations for black-box classifiers. The existing literature lists many desirable properties for explanations to be useful, but there is no consensus on how to quantitatively evaluate explanations in practice. Moreover, explanations are typically used only to inspect black-box models, and the proactive use of explanations as a decision support is generally overlooked. Among the many approaches to XAI, a widely adopted paradigm is Local Linear Explanations - with LIME and SHAP emerging as state-of-the-art methods. We show that these methods are plagued by many defects including unstable explanations, divergence of actual implementations from the promised theoretical properties, and explanations for the wrong label. This highlights the need to have standard and unbiased evaluation procedures for Local Linear Explanations in the XAI field. In this paper we address the problem of identifying a clear and unambiguous set of metrics for the evaluation of Local Linear Explanations. This set includes both existing and novel metrics defined specifically for this class of explanations. All metrics have been included in an open Python framework, named LEAF. The purpose of LEAF is to provide a reference for end users to evaluate explanations in a standardised and unbiased way, and to guide researchers towards developing improved explainable techniques.

Introduction: The Need for Rigorous XAI Evaluation

As Machine Learning (ML) models are increasingly deployed in high-stakes domains like healthcare and finance, their "black-box" nature poses significant risks. To foster trust and comply with regulatory requirements such as the GDPR, eXplainable AI (XAI) aims to demystify model decisions. Local Linear Explanations (LLE) are the most popular paradigm, approximating complex behaviors around specific data points with simple linear models. However, current evaluation often relies solely on "local fidelity," which fails to capture stability, conciseness, or actionable utility. This paper addresses this gap by proposing a rigorous, multi-dimensional evaluation framework.

The LEAF Framework

The authors propose LEAF (Local Explanation evAluation Framework), an open Python framework that evaluates LLEs using four primary metrics:

  1. Conciseness: Measures interpretability by limiting the explanation to $K$ features.
  2. Local Concordance (New): Measures how well the simplified explanation matches the original black-box prediction at the exact point being explained, specifically under the constraint of conciseness.
  3. Reiteration Similarity (New): Measures stability. If you ask the explainer for the same explanation multiple times, do you get the same features every time?
  4. Prescriptivity (New): Evaluates the explanation as a "recipe." If the explanation identifies a feature as the reason for a classification, does changing that feature actually flip the model's decision?
The LEAF framework integrates into the ML pipeline to provide standardized evaluation scores for both individual data points (P1) and whole datasets (P2).

Evaluating the "Titans": LIME vs. SHAP

The framework was tested using six different classifier types across four tabular datasets (Drug Consumption, Arrhythmia, Heartrisk, and Breast Cancer Wisconsin). The study specifically compares the two state-of-the-art methods: LIME and SHAP (specifically the model-agnostic KernelExplainer).

Key Insights

  • The Illusion of Determinism: While SHAP is theoretically deterministic, the official implementation uses "Adaptive Sampling" for datasets with more than 11 features. This makes SHAP stochastic in practice, leading to potential instability.
  • LIME’s Stability Crisis: LIME is highly sensitive to its random sampling. On complex models like Neural Networks (MLP) and SVMs, LIME often produces different "top features" across multiple runs on the very same data point.
  • The "Wrong Label" Problem: In some cases, LIME's local concordance is so low that the explanation's predicted label is inconsistent with the black-box model's actual prediction.

Results and Comparison

Comparative evaluation of LIME (A) and SHAP (B) using LEAF metrics. Note the differences in local concordance and fidelity scores for the same underlying model.
  • Stability: SHAP generally showed higher Reiteration Similarity than LIME, but both methods struggled with complex, non-linear models like MLPs and SVCs.
  • Concordance: LIME's average Local Concordance was found to be around 0.78 in some tests, meaning the explanation is often "not very close" to the actual model value. SHAP generally performed better here but only guaranteed perfect concordance when using all features (no conciseness).
  • Prescriptivity: SHAP tended to have higher prescriptivity scores, meaning its identified features were more effective "levers" for changing a model's classification than LIME's.

Conclusion and Future Work

LEAF provides a necessary standard for the objective evaluation of XAI methods. While the current study focuses on tabular data and binary classification, it reveals critical weaknesses in widely used tools. Future work will involve extending LEAF to image and text data, incorporating "actionability" constraints (e.g., ensuring immutable features like age aren't suggested as levers), and integrating with other emerging metrics to provide a comprehensive evaluation suite for the XAI community.

Summary updated

BibTeX
@article{amparore2021trust,
  author = {Elvio G. Amparore and Alan Perotti and Paolo Bajardi},
  title = {{To trust or not to trust an explanation: using LEAF to evaluate local linear XAI methods}},
  journal = {PeerJ Comput. Sci.},
  year = {2021},
  doi = {10.7717/peerj-cs.479},
}
Figure