Atlas · skill

LIME

LIME explains an individual model prediction by fitting a simpler surrogate around that input. It perturbs interpretable parts of the example, observes the original model's outputs and learns which local changes matter, producing an explanation whose meaning depends on the chosen neighborhood and representation.

toolExplainability & Fairness

What it is

LIME, short for Local Interpretable Model-agnostic Explanations, separates the model being explained from an interpretable surrogate such as a sparse linear model. Nearby perturbed samples are weighted by similarity to the target example, and the surrogate is fitted to approximate predictions in that neighborhood. For text, interpretable features may indicate whether words are present; for images, they may represent regions. The method can work without access to model internals because it queries predictions. Its coefficients describe the fitted local approximation, not necessarily the original model's global structure or a causal relationship between real-world features and outcomes.

What the work involves

The practitioner selects an interpretable representation, perturbation strategy and locality weighting that make sense for the data. They inspect surrogate fidelity near the target and repeat explanations to assess stability. Useful artifacts include the explanation, neighborhood settings and examples where the approximation is weak. Perturbations should avoid impossible or misleading inputs where feasible, particularly with correlated tabular features. The explanation is used for a specific question such as debugging a prediction, with the reference conditions stated clearly so users do not mistake local coefficients for universal importance values.

Illustrative example

An image classifier labels a scene as a particular animal. LIME removes different image regions and fits a local explanation, showing that the background strongly influences the prediction. The developer verifies the clue using other backgrounds and targeted tests before changing the training set. The highlighted regions suggest a failure hypothesis; they do not by themselves establish that the classifier recognizes no meaningful animal features.

Limits and common mistakes

Explanations can change with random sampling, kernel width or feature representation. Unrealistic perturbations can produce a convincing surrogate for behavior outside the data distribution. LIME also does not resolve confounding or establish causation. A good explanation reports its local fidelity and remains narrow in scope, especially when the model is nonlinear nearby or features interact in ways a simple surrogate cannot represent well.

Prerequisites

No prerequisites.

Related skills

Sources and further reading

Last updated: 2026-10-10