Abstract
Local Interpretable Model-agnostic Explanations (LIME) is a widely used method for explaining black-box machine learning models. However, LIME suffers from significant instability due to its reliance on random sampling, often producing different explanations for the same prediction across multiple runs. We present S-LIME (Stabilized-LIME), which utilizes a statistical hypothesis testing framework based on the Central Limit Theorem to adaptively determine the required sample size for stable explanations. Our results across various datasets, including complex healthcare time-series data, demonstrate that S-LIME significantly improves the reproducibility and reliability of model interpretations.
Introduction
As machine learning models move into high-stakes environments like healthcare and criminal justice, "black-box" models are no longer acceptable. We need to know why a model made a specific prediction. LIME (Local Interpretable Model-agnostic Explanations) is the industry standard for this, identifying important features by fitting a simple linear model to random perturbations around a single data point.
However, LIME is notoriously unstable. Because it relies on random sampling, running LIME twice on the exact same prediction can result in different sets of "top features." This inconsistency makes it difficult for practitioners to trust the explanations and poses a significant hurdle for regulatory compliance and safety.
Methods
S-LIME treats the feature selection process as a statistical decision-making problem. It uses the Central Limit Theorem (CLT) to analyze the asymptotic distribution of the statistics used in feature selection (specifically within the LARS/LASSO framework).
At each step of selecting a feature, S-LIME performs a hypothesis test to determine if the difference in importance between the top-ranked feature and the runner-up is statistically significant. If the test is not significant, the algorithm uses a power calculation to determine a new, larger number of perturbation samples required to reach a specific confidence level (e.g., 95%) and restarts the process. This adaptive sampling ensures that the "correct" number of samples is used based on the specific data point and the complexity of the model's local decision boundary.
Results and Evaluation
The authors evaluated S-LIME across three distinct scenarios: the Breast Cancer Wisconsin Diagnostic dataset, a synthetic MARS test function, and the MIMIC-III electronic health records dataset for sepsis prediction.
Stability was quantified using the Jaccard Index (similarity between sets across 20 runs), where a score of 1.0 indicates perfect reproducibility. In the Breast Cancer dataset, LIME’s stability for the top feature was only 0.61, while S-LIME achieved a perfect 1.0.
On the complex sepsis prediction task using a Recurrent Neural Network (LSTM), LIME was highly erratic with Jaccard scores as low as 0.17. S-LIME boosted this to 0.96–1.0, successfully identifying critical drivers such as recent temperature and pH values.
Discussion and Conclusion
Stability is a prerequisite for trust in explainable AI (XAI). By bridging classical frequentist statistics with XAI, S-LIME provides a mathematically rigorous way to guarantee the stability of an explanation. While S-LIME can be computationally more expensive—requiring up to 100,000 perturbations for complex models—it only uses these resources when necessary. Future work will focus on optimizing computational overhead and developing stability-aware perturbations specifically for time-series data.
Summary updated