LIME: Local Interpretable Model-Agnostic Explanations
- LIME is a framework that explains individual predictions by approximating black-box models with interpretable local surrogates, emphasizing locality, interpretability, and model-agnosticism.
- It operates by generating perturbed samples around a target instance, weighting them via a locality kernel, and fitting a simple surrogate like a sparse linear model.
- Enhanced versions such as MPS-LIME and CTGAN-LIME improve neighborhood sampling and stability, broadening LIME's applicability across image, text, and tabular domains.
LIME most commonly denotes Local Interpretable Model-agnostic Explanations, a post hoc explanation framework for black-box machine learning models. Its central idea is to explain a model decision locally around a specific input instance by fitting an interpretable surrogate model that approximates the black box near that instance. In explainable AI, its appeal derives from three properties repeatedly emphasized in the literature: locality, interpretability, and model agnosticism. It explains a single prediction rather than the entire model, typically through a simple surrogate such as a sparse linear model or generalized linear model, and it requires only query access to the predictor rather than access to model internals (Rhee et al., 4 Feb 2026, Saito et al., 2020).
1. Local surrogate formulation
The standard LIME formulation explains an instance by selecting an interpretable surrogate that minimizes a locality-weighted fidelity objective with a complexity penalty: Here, is the black-box model, measures how well approximates in the neighborhood of , is a locality kernel, and constrains complexity so that the explanation remains human-interpretable (Saito et al., 2020).
A common instantiation writes the local loss as a weighted squared error over perturbed samples 0 and their interpretable representations 1, with proximity weights
2
This weighting gives nearby perturbations more influence in fitting the surrogate. Because the procedure only queries 3 on synthetic neighbors, it is model-agnostic; because those neighbors are weighted by proximity, it is local rather than global (Saito et al., 2020).
Operationally, LIME generates perturbed samples around the instance of interest, evaluates the black-box predictor on those samples, fits the surrogate model on the weighted local dataset, and then reads the surrogate parameters as feature attributions. In many settings, the explanation is a ranked list of features with signed weights, where positive weights support the predicted class and negative weights oppose it (Mersha et al., 2024, Mustafa et al., 2022).
2. Interpretable representations across modalities
LIME preserves the same local-surrogate template across domains, but its interpretable units and perturbation operators vary substantially (Rhee et al., 4 Feb 2026, Mersha et al., 2024, Saito et al., 2020, Garreau et al., 2021).
| Domain | Interpretable units | Typical perturbation mechanism |
|---|---|---|
| Image | Superpixels | Turn superpixels on/off or mask them |
| Text | Binary word presence/absence | Randomly remove or mask words |
| Tabular | Interpretable feature vector | Generate synthetic local samples |
In image classification, LIME typically divides an image into superpixels and estimates which superpixels most influence the model’s prediction for a target class. In one formalization of image LIME, the image is partitioned into superpixels 4, a binary mask 5 is sampled, and inactive superpixels are replaced by a baseline such as the superpixel mean color or black. The explanation therefore operates on region masks, not directly on pixels (Garreau et al., 2021).
In text classification, LIME works by randomly removing or masking words, converting the text into a binary representation where $g \in G$6 denotes word present and 7 denotes word removed, querying the classifier on perturbed texts, weighting those samples by distance from the original document, and fitting a linear local model (Mersha et al., 2024).
In tabular settings, the interpretable representation is typically feature-level, and the main design choice becomes how the local neighborhood is sampled. This neighborhood construction has proved to be one of the most consequential parts of the framework, both methodologically and empirically (Saito et al., 2020, Raza et al., 19 Aug 2025).
For interactive image analysis, the explanation output also depends on interface-level parameters such as the segmentation algorithm, positive_only, num_features, and hide_rest, which can materially alter the visual explanation (Rhee et al., 4 Feb 2026).
3. Image-theoretic interpretation
A substantial theoretical analysis of image LIME shows that when the number of generated perturbations is large, the empirical coefficients concentrate around a deterministic limit explanation. In this setting, LIME explanations are not merely arbitrary outputs of a finite random sampling procedure; they converge toward a population-level weighted least-squares solution (Garreau et al., 2021).
That same analysis clarifies what LIME “sees” in images. For elementary shape detectors, attribution is governed by how the relevant shape intersects the chosen superpixels: if the shape lies entirely inside one superpixel, that region receives essentially all importance; if it spans several superpixels, importance is split across them. For linear image models, the LIME coefficient of a superpixel reduces to the sum of pixelwise linear contributions aggregated over that superpixel (Garreau et al., 2021).
The paper also uncovers a connection between LIME and integrated gradients in the image setting. More precisely, LIME explanations are similar to the sum of integrated gradients over the superpixels used in preprocessing. This places image LIME within a broader family of baseline-relative sensitivity methods and implies that its outputs are best interpreted as superpixel-level sensitivity summaries around a baseline, rather than as exact pixel-wise causal attributions (Garreau et al., 2021).
A direct consequence is that segmentation choice is not merely a visualization detail. It defines the explanation basis. Image LIME therefore explains the model through the superpixel decomposition it is given, not through a semantically privileged object decomposition.
4. Reliability, instability, and failure modes
A recurrent misconception is that LIME explains the model as a whole. Multiple studies instead stress that it explains only the neighborhood around one example. In NLP, this locality is valuable for instance-level auditing, but it also means that LIME does not capture global patterns well and cannot answer deeper questions about feature interactions or semantic class structure. In one 20 Newsgroups example, the word “rutgers” received a high weight for the Christian class, which the authors interpret as an artifact of the training data and the unordered dictionary representation rather than an intuitive semantic rationale (Mersha et al., 2024).
A second criticism concerns neighborhood construction. In image settings, standard LIME has been criticized for perturbing superpixels by uniform random sampling that ignores spatial correlation, thereby generating unrealistic or implausible images and introducing “false information contributors” that degrade fidelity and waste computation (Shi et al., 2020). In tabular settings, standard locality sampling has been described as drawing from a unit Gaussian neighborhood, which can produce out-of-distribution synthetic points that do not overlap well with the real data manifold (Saito et al., 2020).
These off-manifold neighborhoods are not just a quality issue. They create an attack surface. Under the “Fooling-LIME” setup discussed in the robustness literature, an adversary can train a critic to distinguish real data from LIME-generated synthetic queries and then route explainer queries to a benign fallback model, thereby concealing biased behavior. On fairness-auditing datasets, this failure mode reduces vanilla LIME’s top-1 accuracy in surfacing the sensitive feature to 0.00 under the black-box attack setting on COMPAS, German Credit, and Communities and Crime (Saito et al., 2020).
Text LIME exhibits an additional instability. A 2023 study reports that simply changing the LIME sampling rate can produce large explanation shifts, with average explanation similarity differences reported as roughly 6%–128.5%, larger instability on longer documents, and especially severe effects when the sampling rate is small (Burger et al., 2023). The same study introduces an adversarial text perturbation method, XAIFooler, showing that small semantic-preserving changes can preserve the classifier prediction while substantially altering ranked word explanations (Burger et al., 2023).
5. Methodological extensions
Much of the recent LIME literature modifies either the perturbation operator or the surrogate model.
“A Modified Perturbed Sampling Method for Local Interpretable Model-agnostic Explanation” (Shi et al., 2020) replaces independent image perturbations with MPS-LIME, which converts the superpixel image into an undirected graph and constrains sampled subsets to graph cliques found by DFS. The surrogate fitting stage remains K-Lasso, but the neighborhood becomes topology-aware. On six ImageNet examples explained for Google’s pre-trained Inception network, MPS-LIME reports much lower MAE, higher 8, and runtimes of about 91–155 seconds versus about 223–265 seconds for standard LIME (Shi et al., 2020).
“Improving LIME Robustness with Smarter Locality Sampling” (Saito et al., 2020) introduces CTGAN-LIME, which replaces naive tabular perturbations with local samples from a Conditional Tabular GAN and optionally filters them with the discriminator. The downstream explainer remains the same; only neighborhood construction changes. Under the black-box Fooling-LIME attack, top-1 accuracy on COMPAS rises from 0.00 for vanilla LIME to 99.94 with discriminator filtering, while precision remains comparable at 73.27 for CTGAN-LIME versus 71.49 for LIME (Saito et al., 2020).
“ITL-LIME: Instance-Based Transfer Learning for Enhancing Local Explanations in Low-Resource Data Settings” (Raza et al., 19 Aug 2025) replaces random perturbations with a mixture of real source-domain instances and real target neighbors. It uses 9-medoids clustering for source retrieval and a contrastive-learning encoder to define locality weights in latent space before fitting the usual surrogate. The paper reports improved F1 and AUC across tested low-resource tabular settings and 100% stability across all datasets and black-box models in the reported experiments (Raza et al., 19 Aug 2025).
“Enhancing LIME using Neural Decision Trees” (Bouyahia et al., 21 Mar 2026) addresses the surrogate side. NDT-LIME keeps the usual perturb-query-weight pipeline but replaces linear or greedy tree surrogates with Neural Decision Trees. On California Housing, it reports fidelity 0 of 0.960 versus 0.297 for LIME-LR and 0.890 for LIME-DT, while maintaining high stability and regularity across benchmark tabular datasets (Bouyahia et al., 21 Mar 2026).
6. Analytical workflows and applications
LIME has also evolved from a static explainer into a broader analysis workflow. “Vivifying LIME: Visual Interactive Testbed for LIME Analysis” (Rhee et al., 4 Feb 2026) introduces LIMEVis, an interface with a Config View, Overview, Summary View, and Detail View. After configuration, LIME is run for 100 images from a selected category, shown in a 10 × 10 grid with blue borders for correct classifications and red borders for incorrect ones. A Summary View uses VGG16 pre-trained on ImageNet followed by PaCMAP to organize explanation images in 2D, enabling multi-image pattern discovery. In the Detail View, users can click superpixels to hide or show them and immediately observe updated model predictions. In one reported misclassification, an image initially predicted as cat with probability 0.74 and dog with probability 0.18 changed to dog with probability 0.90 and cat with probability 0.09 after disabling influential superpixels (Rhee et al., 4 Feb 2026).
In domain-specific practice, LIME is often used as a trust-building and debugging layer over black-box predictors. In hydrocarbon prospect risking, LIME was applied to logistic regression, SVM, and MLP models on a proprietary DHI consortium dataset with 258 instances and a 6-dimensional feature vector. The local explanations repeatedly identified DHI Index and Final Pg as the dominant drivers of success and failure predictions, consistent with domain expectations, and also exposed suspicious cases in which a feature carried an implausible sign (Mustafa et al., 2022).
In neural NLP, LIME has been used to interpret an MLP classifier trained on the 20 Newsgroups dataset. The reported workflow includes extensive text preprocessing, a bag-of-words style interpretable representation, local word masking, and ranked word-level attributions. The method was described as useful for debugging, bias detection, trust-building, and accountability, while remaining explicitly limited to local explanations rather than global accounts of model behavior (Mersha et al., 2024).
7. Acronym polysemy in the arXiv literature
The acronym LIME is notably polysemous. Outside explainable AI, it names several unrelated systems and benchmarks. Representative examples include “LIME: Live Intrinsic Material Estimation” (Meka et al., 2018), an end-to-end method for real-time material estimation from a single color image; “LIME: A Method for Low-light IMage Enhancement” (Guo, 2016), a low-light enhancement method based on illumination-map estimation; “LIME: Localized Image Editing via Attention Regularization in Diffusion Models” (Simsar et al., 2023), a training-free method for localized text-guided image editing; “LIME: Less Is More for MLLM Evaluation” (Zhu et al., 2024), a curated multimodal benchmark; and “LIME: Learning Inference-time Modality Enhancement” (Allouche et al., 3 May 2026), a training-free relevance-guided framework for reducing multimodal hallucinations.
This polysemy is more than bibliographic trivia. In contemporary XAI, LIME usually refers to the local-surrogate explanation method, but in arXiv-scale literature the acronym is shared across explainability, vision, multimodal inference, benchmarking, weak supervision, and systems research. Precise disambiguation therefore depends on expansion, context, and citation rather than acronym alone.