LIME
/ lime (like the fruit) /
LIME explains one prediction by building a tiny, simple model that mimics the big complicated one — but only in the immediate neighborhood of that single case. The intuition: a curving road looks straight if you only inspect a few feet of it. A complex model's decision surface is a writhing curve, but right around one specific input, a simple straight line can approximate it well enough to read off which features mattered for that prediction.
Mechanically, LIME takes your input, jiggles it many times to make slightly altered versions, asks the black-box model what it predicts for each, then fits an easy-to-read model (usually linear) to those local answers, weighting nearby variations most. The result is a short list like "this email was flagged as spam mainly because of the words 'winner' and 'free,' and despite the word 'meeting.'" Crucially, LIME doesn't need to know anything about the model's internals — it works on any model, treating it as a box you can only query.
LIME's gift is accessibility: a clear, local, model-agnostic explanation anyone can grasp. Its honest weaknesses are real. The explanation depends on how you define "nearby" and how you generate the jiggled samples, so running LIME twice can give different answers — it is not deterministic by default. And like all post-hoc methods, it explains a local approximation, not the model's true reasoning; trust it for intuition and debugging, not as a guarantee.
A classic demonstration: a model distinguished wolves from huskies with high accuracy. LIME, highlighting which image regions drove each verdict, revealed the model was mostly looking at snow in the background — wolf photos happened to have snowy scenes. It wasn't recognizing wolves at all; it was a snow detector.
LIME's most famous catch: a 'wolf detector' that was really detecting snow.
LIME and SHAP often get used interchangeably, but they differ: SHAP rests on game-theory guarantees and additivity; LIME fits a quick local surrogate and is faster but less stable, sometimes giving different explanations on repeated runs. When two such tools disagree about the same prediction, that disagreement is itself information worth investigating.