Explanation Stability measures the variance in feature importance scores produced by a local explanation method, such as LIME, when applied to the same instance with different random seeds. A stable explanation yields nearly identical feature rankings across runs, indicating that the perturbation sampling process has converged on a reliable approximation of the local decision boundary rather than fitting to noise.
Glossary
Explanation Stability

What is Explanation Stability?
Explanation stability is the property that a local interpretable model explanation remains consistent across multiple runs with different random seeds, confirming that the identified important features are robust rather than artifacts of the sampling process.
Instability arises when the kernel width is too narrow or the number of perturbed samples is insufficient, causing the surrogate model to overfit to a sparse, unrepresentative neighborhood. Techniques like OptiLIME and Bayesian LIME directly address this by optimizing hyperparameters or providing uncertainty estimates, ensuring that the generated instance-level explanation is reproducible and trustworthy for high-stakes audit scenarios.
Key Factors Influencing Stability
Explanation stability refers to the consistency of local explanations across multiple runs with different random seeds. A stable explanation indicates that the identified important features are robust rather than artifacts of the perturbation sampling process.
Random Seed Sensitivity
The perturbation sampling process in LIME relies on random number generation to create synthetic data points. Different seeds produce different neighborhoods, which can lead to divergent feature importance rankings for the same prediction.
- A stable explanation should maintain consistent top features across seeds
- High variance in feature weights signals unreliable explanations
- Seed sensitivity is a primary diagnostic for explanation trustworthiness
Kernel Width Calibration
The kernel width hyperparameter controls the effective size of the local neighborhood by determining how quickly sample weights decay with distance from the original instance.
- Too narrow: surrogate model overfits to very few samples, causing high variance
- Too wide: explanation loses local fidelity and captures global trends
- OptiLIME automates kernel width selection by balancing fidelity and stability
Sample Size Adequacy
The number of perturbed samples generated around the instance directly impacts explanation stability. Insufficient samples lead to high-variance surrogate models that produce inconsistent feature attributions.
- More samples reduce variance but increase computational cost
- Stability plateaus after a data-dependent threshold
- Text explanations typically require more samples than tabular data due to higher dimensionality
Surrogate Model Regularization
The L1 regularization (Lasso) penalty in the sparse linear surrogate model enforces sparsity but can amplify instability. Small changes in the perturbed dataset can cause different features to be selected.
- Stronger regularization increases sparsity but may reduce stability
- Bayesian LIME addresses this by providing uncertainty estimates alongside feature weights
- Explanation regularization techniques can explicitly penalize variance across runs
Data Modality Effects
Stability characteristics vary significantly by data type due to differences in perturbation strategies and interpretable representations.
- Text data: token masking creates discrete, high-dimensional neighborhoods; TF-IDF cosine distance weighting affects stability
- Image data: superpixel segmentation randomness introduces additional variance beyond perturbation sampling
- Tabular data: continuous feature discretization into quantiles can stabilize explanations by reducing the feature space
Stability Metrics and Diagnostics
Quantitative metrics exist to measure explanation stability across multiple runs with different random seeds.
- Jaccard index measures overlap between top-k feature sets across runs
- Rank correlation (Spearman's ρ) assesses consistency of feature importance ordering
- Feature weight variance directly quantifies the dispersion of individual feature attributions
- Running 10-50 repetitions and visualizing weight distributions is standard practice for auditing stability
Frequently Asked Questions
Addressing the most common technical questions regarding the consistency and robustness of local interpretable model explanations across multiple runs with different random seeds.
Explanation stability is the property that a local explanation, such as one generated by LIME, remains consistent across multiple runs with different random seeds, indicating that the identified important features are robust rather than artifacts of the sampling process. It matters because an unstable explanation erodes trust in the model auditing process. If a data scientist runs LIME twice on the same prediction and gets two different sets of top features, the explanation is not reliable for high-stakes decision-making or regulatory compliance. Stability ensures that the feature attribution reflects a true signal in the model's local decision boundary, not noise from the random perturbation sampling used to generate the surrogate model's training data. In enterprise environments governed by frameworks like the EU AI Act, unstable explanations fail to meet the standard of a meaningful, auditable justification for automated decisions.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
Key concepts that influence the consistency and reliability of local explanations across multiple runs.
Kernel Width
A critical hyperparameter controlling the effective size of the local neighborhood by determining how quickly sample weights decay with distance from the original instance.
- A narrow kernel focuses on very close perturbations, increasing local fidelity but often reducing stability due to high variance in the small sample.
- A wide kernel smooths the explanation over a larger region, improving stability but potentially missing sharp local decision boundaries.
- Selecting the optimal kernel width is the primary mechanism for balancing the fidelity-stability trade-off.
OptiLIME
An optimization framework that automatically selects the optimal kernel width for a LIME explanation.
- It operates by balancing the trade-off between local fidelity and the stability of the explanation across different random seeds.
- The algorithm searches for the largest kernel width that still maintains a predefined fidelity threshold, maximizing stability without sacrificing accuracy.
- This removes the need for manual hyperparameter tuning, providing a more objective and reproducible explanation pipeline.
Perturbation Sampling
The process of generating a synthetic neighborhood of data points by randomly altering or masking features of the original instance.
- Explanation instability often originates here: different random seeds produce different sets of perturbed samples.
- Sampling strategies vary by modality—token masking for text, superpixel masking for images, or Gaussian perturbation for tabular data.
- Increasing the number of samples generally improves stability by providing a more comprehensive view of the local decision boundary, at the cost of higher computation.
Bayesian LIME
An extension of LIME that uses Bayesian ridge regression as the surrogate model instead of standard linear regression.
- It provides uncertainty estimates alongside feature importance scores, indicating the confidence of the explanation itself.
- High variance in the posterior distribution of feature weights signals explanation instability.
- This allows practitioners to distinguish between robust, high-confidence feature attributions and those that are artifacts of the random sampling process.
Sparse Linear Model
An interpretable surrogate model that uses Lasso (L1) regularization to select only a small number of the most important features.
- The sparsity constraint directly impacts stability: a model that selects different features across runs exhibits feature selection instability.
- Ridge regression (L2) produces denser but often more stable explanations by distributing weight smoothly across correlated features.
- The choice of regularization is a key architectural decision in the explanation pipeline, trading conciseness for consistency.
Cosine Distance
A proximity measure used in LIME for text data that calculates the similarity between two documents based on the angle between their TF-IDF vector representations.
- It ignores differences in document length, focusing purely on the semantic similarity of word distributions.
- The distance metric directly determines which perturbed samples are weighted most heavily in the local regression.
- An inappropriate distance metric can introduce systematic bias into the neighborhood definition, undermining the stability and validity of the resulting explanation.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us