GraphLIME is a post-hoc, instance-level explanation framework that adapts the LIME philosophy to non-Euclidean graph data. It defines a node's local interpretable neighborhood using the Hilbert-Schmidt Independence Criterion (HSIC) to select the most relevant features from its computational graph. A linear surrogate model is then trained on these sampled perturbations to approximate the target GNN's decision boundary locally, providing feature importance scores for that specific node.
Glossary
GraphLIME

What is GraphLIME?
GraphLIME is a model-agnostic, local interpretability method for Graph Neural Networks that explains a single node's prediction by fitting a simple, interpretable model on its local neighborhood features.
Unlike structural explainers like GNNExplainer that identify critical subgraphs, GraphLIME focuses on feature attribution, explaining which node attributes drove the prediction. Its fidelity is measured by how well the local linear model mimics the complex GNN on the sampled data. This makes it particularly useful for tasks like molecular property prediction or social network analysis where understanding the influence of specific node-level features is critical for domain expert validation.
Key Features of GraphLIME
GraphLIME adapts the LIME framework to graph neural networks, providing local, interpretable explanations for individual node predictions by approximating the GNN's behavior with a simple model trained on the node's local neighborhood.
Local Fidelity through Surrogate Modeling
GraphLIME trains a Hilbert-Schmidt Independence Criterion (HSIC) Lasso model on a node's N-hop neighborhood to approximate the GNN's prediction. This surrogate model is inherently interpretable, selecting a sparse set of features that are maximally dependent on the GNN's output while minimizing redundancy. The HSIC Lasso captures non-linear dependencies, making it more expressive than standard linear surrogates.
Feature Importance Attribution
The core output is a feature importance vector for each explained node. GraphLIME identifies which input features of the node and its neighbors most influenced the prediction. This allows engineers to debug why a specific node was classified a certain way by examining the top-ranked features. The method is model-agnostic, requiring only black-box access to the GNN's predictions.
Neighborhood Sampling Strategy
To build the local interpretable model, GraphLIME samples multiple N-hop neighborhoods around the target node. It computes the GNN's prediction for each sampled neighborhood, creating a local dataset where the features are aggregated neighborhood characteristics and the target is the GNN's output. This sampling captures how variations in the local graph structure affect the prediction.
Non-Linear Dependency Detection
Unlike linear surrogate models that can miss complex relationships, the HSIC Lasso objective explicitly maximizes the statistical dependence between selected features and predictions. This allows GraphLIME to surface features that have a strong but non-linear influence on the GNN's decision, providing a more faithful local explanation than methods relying solely on linear correlation.
Comparative Advantage over GNNExplainer
While GNNExplainer identifies important subgraph structures and node features jointly, GraphLIME focuses specifically on feature-level explanations using a non-linear dependence measure. It is particularly effective when the prediction is driven by complex feature interactions within the neighborhood rather than by a specific subgraph topology. GraphLIME's HSIC Lasso naturally handles continuous features without discretization.
Faithfulness Evaluation
The quality of a GraphLIME explanation is measured using the fidelity metric, which computes how accurately the surrogate HSIC Lasso model mimics the original GNN's predictions on the sampled neighborhoods. High fidelity indicates the interpretable model reliably captures the local decision boundary. Engineers can also perform perturbation analysis by removing top-ranked features and observing the prediction change.
Frequently Asked Questions
Clear, technical answers to the most common questions about how GraphLIME interprets Graph Neural Network predictions using local surrogate models.
GraphLIME is a local interpretable model-agnostic explanation method specifically designed for Graph Neural Networks (GNNs). It explains a single node's prediction by first sampling its local n-hop neighborhood to collect a set of perturbed node features, then fitting a simple, interpretable model—typically a Hilbert-Schmidt Independence Criterion (HSIC) Lasso—on those samples. The core mechanism involves using the GNN's own hidden representations as the target for the local model, rather than the final prediction logits. This captures the non-linear feature interactions learned by the GNN. The learned coefficients of the HSIC Lasso directly indicate the feature importance for that specific node's prediction, providing a human-readable explanation of which input features drove the decision.
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
Core concepts and complementary techniques surrounding local interpretability for graph neural networks.
GNNExplainer
A model-agnostic framework that identifies a compact subgraph and a small subset of node features most influential for a GNN's prediction. It learns a continuous mask over edges and features by maximizing mutual information with the original model's output. Unlike GraphLIME's local surrogate approach, GNNExplainer directly optimizes for structural sparsity and feature selection simultaneously.
LIME (Tabular/Text)
The precursor to GraphLIME, Local Interpretable Model-agnostic Explanations works by sampling perturbed instances around a prediction, weighting them by proximity, and training a simple interpretable surrogate model (e.g., linear regression). GraphLIME adapts this core philosophy to graph domains by defining locality through node neighborhoods and using the Hilbert-Schmidt Independence Criterion (HSIC) for feature selection.
Shapley Values on Graphs
A game-theoretic approach that assigns a fair importance score to each node or edge by computing its marginal contribution across all possible coalitions of graph components. Methods like GraphSVX and GNN-Shap decompose predictions using Shapley values, providing both structural and feature-level explanations with strong axiomatic guarantees that GraphLIME's heuristic sampling lacks.
Faithfulness Metric
A quantitative evaluation score measuring how accurately an explanation reflects the GNN's true reasoning. Assessed by the drop in prediction accuracy when identified important features or edges are removed. GraphLIME explanations are often evaluated using faithfulness alongside fidelity (how well the surrogate mimics the original model) to validate the quality of local approximations.
Counterfactual Subgraphs
The minimal structural perturbations—such as removing specific edges or nodes—that would alter a GNN's prediction to a different outcome. While GraphLIME explains why a prediction occurred, counterfactual methods like CF-GNNExplainer answer what would change it, providing actionable recourse. Both approaches are complementary for building comprehensive model understanding.
Perturbation Analysis
A fidelity assessment method that measures prediction change after masking the most important nodes or edges identified by an explainer. For GraphLIME, this involves removing the features or neighbors deemed critical by the local surrogate and observing the drop in the original GNN's confidence. A larger drop indicates a more faithful 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