SubgraphX is an explainability method for Graph Neural Networks (GNNs) that frames explanation as a subgraph identification problem. It employs Monte Carlo Tree Search (MCTS) to efficiently explore the combinatorial space of possible subgraphs, guided by a Shapley value-based reward function that measures each subgraph's contribution to the model's prediction without requiring retraining.
Glossary
SubgraphX

What is SubgraphX?
SubgraphX is a post-hoc explainability method for Graph Neural Networks that uses Monte Carlo Tree Search to efficiently identify the most critical subgraph structures responsible for a model's prediction.
Unlike gradient-based or perturbation methods that score individual edges or nodes in isolation, SubgraphX directly searches for a connected, compact subgraph that maximizes mutual information with the target prediction. This MCTS-driven exploration, combined with a graph information bottleneck objective, allows it to capture higher-order structural interactions and node feature synergies that single-edge explainers miss, producing more faithful and human-interpretable explanations for tasks like molecular property prediction.
Key Features of SubgraphX
SubgraphX uses Monte Carlo Tree Search (MCTS) to efficiently explore the combinatorial space of subgraphs and identify the most critical structural motifs driving a Graph Neural Network's prediction.
Monte Carlo Tree Search Exploration
Unlike gradient-based or perturbation methods that evaluate nodes in isolation, SubgraphX employs MCTS to perform a guided search over the subgraph space. The algorithm builds a search tree where each node represents a subgraph, using the Shapley value as the reward signal to direct the search toward highly explanatory structures. This balances exploration of diverse subgraphs with exploitation of promising candidates, avoiding the local optima that plague greedy masking approaches.
Shapley Value as Scoring Function
SubgraphX uses the graph Shapley value to quantify a subgraph's contribution to the prediction. This game-theoretic metric computes the marginal contribution of the subgraph across all possible coalitions of nodes, ensuring the explanation satisfies efficiency, symmetry, dummy, and additivity axioms. The Shapley value provides a theoretically principled alternative to heuristic importance scores, guaranteeing that the identified subgraph is both necessary and sufficient for the original prediction.
Connected Subgraph Constraint
SubgraphX enforces a connectivity constraint during the MCTS rollout, ensuring that the final explanation is a single connected component rather than a scattered set of disconnected nodes. This produces explanations that correspond to meaningful structural motifs—such as functional groups in molecular graphs or cohesive communities in social networks—rather than arbitrary node collections that are difficult for humans to interpret.
Multi-Level Explanation Granularity
The method supports explanations at multiple levels of granularity by controlling the MCTS search depth and the pruning threshold. At coarse levels, SubgraphX identifies large functional modules; at fine levels, it pinpoints specific critical edges and nodes. This hierarchical capability allows practitioners to zoom in from a high-level structural rationale down to the precise atomic interactions that flipped the model's decision.
Model-Agnostic Architecture
SubgraphX operates as a post-hoc, model-agnostic explainer requiring only black-box access to the trained GNN's prediction function. It makes no assumptions about the internal architecture—whether GCN, GAT, GIN, or GraphSAGE—and does not require gradients or intermediate activations. This makes it applicable to proprietary or API-wrapped models where internal access is restricted.
Monte Carlo Sampling for Efficiency
Computing exact Shapley values over all possible subgraph coalitions is combinatorially intractable. SubgraphX addresses this through Monte Carlo sampling within the MCTS framework, approximating the Shapley value by sampling coalitions from the search tree. This approximation converges efficiently while maintaining the axiomatic guarantees of the Shapley framework, making the method practical for graphs with hundreds or thousands of nodes.
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.
Frequently Asked Questions
Explore the core mechanisms, algorithms, and evaluation criteria behind SubgraphX, a Monte Carlo Tree Search-based method for explaining Graph Neural Network predictions.
SubgraphX is a post-hoc explainability method for Graph Neural Networks (GNNs) that identifies the most critical subgraph structure responsible for a specific prediction. It works by framing the explanation task as a search problem over the combinatorial space of possible subgraphs. The core mechanism is Monte Carlo Tree Search (MCTS), an algorithm typically used in game-playing AI. SubgraphX iteratively builds a search tree where each node represents a candidate subgraph. It uses a Shapley value-based scoring function to evaluate the importance of a subgraph, guiding the MCTS to efficiently explore and prune the search space without enumerating all possibilities. The final output is the subgraph with the highest score, providing a human-interpretable structural explanation for the GNN's decision on a graph-level or node-level task.
Related Terms
Core concepts and methods for interpreting predictions made by Graph Neural Networks, focusing on subgraph-level explanations.
Monte Carlo Tree Search (MCTS)
The core search algorithm powering SubgraphX. MCTS efficiently explores the vast space of possible subgraphs by iteratively performing four steps:
- Selection: Traversing the tree from the root to a leaf node using a search policy (like UCB1) that balances exploration and exploitation.
- Expansion: Adding one or more child nodes to the tree to represent new subgraph candidates.
- Simulation: Evaluating the chosen subgraph's importance using a Shapley value-based scoring function.
- Backpropagation: Updating the statistics of all traversed nodes with the simulation result. This guided search avoids exhaustive enumeration, making subgraph discovery tractable.
Shapley Value Scoring
SubgraphX uses the Shapley value from cooperative game theory to assign a fair importance score to a candidate subgraph. The subgraph is treated as a coalition of nodes/edges, and its marginal contribution to the GNN's prediction is computed across all possible permutations of graph components. This ensures the explanation satisfies key axioms:
- Efficiency: The sum of contributions equals the total prediction.
- Symmetry: Identical components receive equal scores.
- Dummy: Irrelevant components receive zero score.
- Additivity: Scores are additive across games. This provides a theoretically grounded, unbiased measure of subgraph importance.
Graph Pruning
The process of systematically removing nodes or edges deemed irrelevant by an explainability metric to create a sparser, more interpretable subgraph that preserves the original prediction. In the context of SubgraphX, the output is a pruned subgraph—the minimal connected structure that is most influential for the GNN's decision. Pruning serves as both an explanation and a fidelity check: if removing the identified subgraph causes a significant prediction drop, it confirms the explanation's faithfulness.
Faithfulness Metric
A quantitative evaluation score that measures how accurately an explanation subgraph reflects the true reasoning process of the GNN. For SubgraphX, faithfulness is typically assessed by the drop in prediction probability when the identified critical subgraph is removed from the input. A high drop indicates the explanation captured genuinely causal structures. This is contrasted with the Fidelity Metric, which measures how well the original model's prediction is reproduced when using only the explanatory subgraph as input.
Graph Rationalization
A self-explainable GNN framework where a generator module extracts a concise, causal subgraph (the rationale) and a predictor module makes a decision based solely on that rationale. Unlike post-hoc methods like SubgraphX, rationalization is built into the training process. The generator is optimized to find the minimal subgraph that maximizes mutual information with the label, often using the Graph Information Bottleneck principle to discard irrelevant structural noise.
Counterfactual Subgraphs
The minimal structural perturbations to a graph—such as removing specific edges or nodes—that would alter a GNN's prediction to a different outcome. While SubgraphX identifies the subgraph most responsible for the actual prediction, counterfactual explanations answer "what would need to change for a different result?" This is crucial for algorithmic recourse in high-stakes applications like loan approvals or drug discovery, where understanding how to flip a decision is as important as understanding the decision itself.

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