For researchers who need to interpret complex neural network decisions, the choice between LIME and SHAP comes down to one central trade-off: speed versus robustness. LIME delivers fast, local explanations for individual predictions by fitting a simple surrogate model around a single instance, but those explanations can be unstable across repeated tests. SHAP, grounded in cooperative game theory, produces consistent feature attributions that work both locally and globally, at a higher computational cost. A comparative study presented at an IEEE conference frames the decision exactly this way: LIME excels at quick local explanations that are easy to implement, while SHAP offers more robust and global insights despite its computational overhead.
Introduction to Explainable AI: LIME and SHAP
Complex neural networks achieve strong predictive performance, but their internal decision logic is opaque to the scientists who rely on them. Explainable AI (XAI) methods address this gap by attaching interpretable outputs to otherwise black-box models. Two techniques dominate practical use in scientific research: LIME (Local Interpretable Model-agnostic Explanations) and SHAP (SHapley Additive exPlanations). Both are post-hoc and model-agnostic, meaning they can be applied to any trained machine learning model without modifying it, as a perspective paper on the two methods notes.
The distinction that matters most for researchers is scope. Local interpretability explains why a model made one specific prediction for one specific instance. Global interpretability characterizes how the model behaves across an entire dataset. LIME is fundamentally a local method; SHAP spans both. This difference in scope, together with a difference in stability and cost, drives the entire selection decision.
Both methods have proven their value in applied scientific settings. A study in the electronics research literature describes how SHAP and LIME were applied together to provide global and local explanations of model predictions in wastewater treatment research, where machine learning models such as artificial neural networks, gradient boosting machines, and random forests predicted variables including BOD and TSS from multi-year operational data. The interpretability layer revealed the most influential features driving those predictions, turning an opaque predictor into a source of scientific insight.
LIME: Local Interpretability Through Surrogate Models
LIME answers a narrow question: why did the model produce this particular output for this particular input? Its core mechanism is local approximation. Rather than trying to explain the entire complex model, LIME approximates the model's behavior in the neighborhood of a single instance using an interpretable surrogate—typically a simple, locally fitted model. Because the approximation is performed for a specific instance, each explanation is self-contained and scoped to that one prediction.
This design has practical consequences. Because the surrogate is simple and the analysis is confined to one instance's neighborhood, LIME is relatively easy to implement and fast to run. The IEEE comparative study highlights this as LIME's principal strength: it excels at performing local explanations through interpretable models, making it comparatively easy to put into practice. A perspective paper on SHAP and LIME reinforces the point, observing that LIME is much faster than SHAP, especially with tree-based models.
The same mechanism, however, introduces a weakness. LIME's approximation process relies on perturbing the instance being explained—generating variations of the input and observing how the model responds. The comparative study reports that LIME explanations are not very stable across tests due to these instance perturbations. In practice, that means running LIME twice on the same prediction can yield noticeably different feature importance rankings, a serious concern when an explanation is meant to support a scientific claim.
There is also a structural limitation noted in the SHAP-and-LIME perspective paper: because LIME fits a local linear model, it fails to capture non-linear associations, whereas SHAP may detect such associations depending on the model used. For researchers whose neural networks learn strongly non-linear relationships, this matters.
SHAP: Game Theory for Consistent Feature Attribution
SHAP takes a fundamentally different approach. It is based on game theory, borrowing the concept of Shapley values from cooperative game theory, which calculates the contribution of each player to the payout. In the machine learning translation, the players become the features and the payout becomes the model outcome. SHAP calculates a score for each feature representing its weight in the model output, distributing the prediction among the features in a way the comparative study describes as ensuring fair feature contributions across the dataset.
The game-theoretic foundation gives SHAP its defining property: consistency. Because each feature's attribution is computed as its fair marginal contribution, the attributions are reliable and stable in a way LIME's perturbation-based approximations are not. The IEEE study credits this consistency directly to the Shapley framework, contrasting it with LIME's instability.
SHAP's second advantage is scope. The comparative study notes that SHAP provides both local and global insights, allowing researchers to understand individual predictions and overall model behavior within a single framework. The perspective paper adds a practical detail: SHAP generates several plots reporting outcomes both locally and globally, whereas LIME generates one plot per instance.
The cost is computational. SHAP is computationally more expensive than LIME, and its expense grows with the number of features and instances because of its permutation-based approach to computing contributions. For large neural networks with many features and many instances to explain, this overhead can become the binding constraint on which method a project can realistically use.
LIME vs. SHAP: A Decision Framework for Researchers
The comparison below juxtaposes the two methods against a consistent set of criteria—their underlying theory, the scope of their explanations, their stability, their computational cost, and their primary use case. The pattern that emerges is a clean trade-off: LIME trades robustness for speed, while SHAP trades speed for consistency and global reach.
| Criterion | LIME | SHAP |
|---|---|---|
| Core principle | Approximates the complex model locally with an interpretable surrogate model, fitted for a specific instance. | Grounded in game theory; attributes feature importance using Shapley values that fairly distribute the prediction among features. |
| Scope of explanation | Local only—explains how the model works for a specific instance; one plot per instance. | Both local and global—supports understanding of individual predictions and overall model behavior. |
| Consistency | Not very stable across tests, due to instance perturbations in the approximation process. | Consistent explanations; the game-theoretic foundation ensures feature attributions are reliable. |
| Computational cost | Relatively low; faster for generating individual explanations, especially compared to SHAP on tree-based models. | Higher; cost increases with the number of features and instances due to the permutation-based approach. |
| Primary use case | Quick local checks on single predictions when implementation simplicity and speed matter most. | Robust local and global analysis when explanation reliability and model-wide insight are required. |
Read vertically, the table shows why the methods diverge: every row traces back to the same root difference. LIME's local surrogate produces speed but instability and local-only scope; SHAP's Shapley computation produces consistency and dual scope but higher cost. Read horizontally, it gives a verdict: if the priority is speed for individual predictions, LIME aligns with the goal; if the priority is robust, consistent explanations across the model, SHAP does.
Choosing the Right XAI Method for Your Scientific Research
Mapping the trade-off onto research contexts turns the comparison into a decision. LIME fits situations where a researcher needs a rapid answer about a single prediction—for example, understanding why a trained network classified one sample the way it did—and where computational resources or time are limited. Its ease of implementation makes it a reasonable first tool for exploratory analysis. The caveat is that its explanations should be treated as indicative rather than definitive, because instability across tests and the inability to capture non-linear associations limit how much weight a single LIME output can bear.
SHAP fits situations where the explanation itself is a research result. When a paper's conclusions depend on which features drive a model's predictions—across a dataset, not just one instance—SHAP's consistent attributions and global summaries provide the robustness the claim requires. The wastewater treatment study illustrates this pattern: SHAP and LIME were used to reveal the most influential features behind model predictions, supporting strategic decision-making, a use case where reliability of the feature ranking is the point of the exercise.
A pragmatic path for many projects is sequential rather than exclusive: use LIME for fast, exploratory local checks during model development, then apply SHAP for the consistent local and global explanations that appear in the final analysis. The comparative study positions its own comparison as a reference for selecting an XAI method according to data characteristics and explanation goals, and that framing captures the essential point—the method should follow from the goal, not the other way around.
Making Your Choice: LIME or SHAP for Scientific Interpretability
Choose LIME when rapid, local explanations for individual predictions are paramount and computational resources are limited, accepting potential instability. Opt for SHAP when consistent, globally coherent, and robust explanations are critical, and higher computational cost is acceptable. The decision hinges on whether the interpretability goal is quick local insight or comprehensive global feature importance, and on whether the project's computational budget can absorb SHAP's permutation-based overhead.
The check that the choice was right is measurable: the chosen method's explanation output should consistently align with the specific interpretability goal—quick local insight versus comprehensive global feature importance—and its computational performance should meet project constraints. If LIME's explanations vary unacceptably across repeated runs on the same instance, or if SHAP's runtime exceeds what the project can afford, that observable mismatch is the signal to switch methods.





