Where Tree Ensembles Decide: Structural Local Explanation with Decision Predicate Graphs

Sylvio Barbon Junior, Luca LongoarXiv 2026 · arXiv

TL;DR

The local Decision Predicate Graph (local DPG) provides a structural "map" of how a tree ensemble reaches a specific prediction by tracing every decision rule executed across all trees. It identifies the critical predicate—the single most influential threshold that, if crossed, is most likely to flip a prediction or correct an error, offering a more precise debugging tool than standard feature attribution methods like SHAP.

What Problem Does This Paper Address?

Tree ensembles (like Random Forests and Gradient Boosting Machines) are workhorses for tabular data, but they are notoriously difficult to interpret. A single prediction is the result of aggregating hundreds of decision trees, each following its own path of "if-then" rules.

Current Explainable AI (XAI) methods generally fall into two camps:

  1. Influence-based (e.g., SHAP, LIME): These tell you which features were important but not which specific thresholds the model used.
  2. Input-space (Counterfactuals): These suggest how to change the input to get a different result but don't explain the model's internal logic.

There is a "structural gap": we don't know exactly which of the thousands of internal decision thresholds are doing the heavy lifting for a specific sample. The authors aim to bridge this by looking at the logical structure of the model itself.

Figure 1: Taxonomy of the explanation methods for tree ensembles reviewed in Section 2, by the view of a prediction they adopt and by their scope.

Methods

The authors propose a five-step approach to generate a local explanation:

  1. Trace Extraction: For a given input $x$, they record the exact root-to-leaf path (trace) followed in every tree of the ensemble.
  2. Class Support Calculation: They compute the contribution of each tree to the final prediction, ensuring the explanation is "faithful" to the model's actual output.
  3. Graph Construction (local DPG): They merge these individual traces into a single Directed Acyclic Graph (DAG). Unlike previous global DPGs, this is built only from the paths relevant to the specific sample. Each node represents a predicate (e.g., $age > 30$), and edges are annotated with the specific trees that executed them.
  4. Critical Predicate Selection: They estimate the "gain" for every executed predicate. The critical predicate is the one that, if its threshold were crossed, would move the ensemble's prediction most strongly toward a target class (e.g., the correct class in the case of an error).
  5. Validation: They perform a "whole-model intervention" by moving the feature value just past the critical threshold and re-evaluating the entire ensemble to see if the prediction actually flips.
Table 1: Positioning of explanation methods for tree ensembles, in the order of Figure 1. Scope: local (L) or global (G). Access: model-direct (d) or model-agnostic (a). Executed paths: complete, with the trees of each predicate ( ), or summarised ( ). Target class: chosen, including the true class ( ), any other class ( ), or per-class outputs without contrast ( ). Intervention: input change (I) or threshold crossing (T). A dash marks an absent property.

Datasets

The method was evaluated using 16 public numeric classification datasets from OpenML and scikit-learn (including well-known ones like diabetes, iris, and digits). These datasets ranged from 4 to 617 features and 2 to 26 classes. The researchers tested across four ensemble families: Random Forests, Bagging, AdaBoost, and Gradient Boosting (GBM).

Key Insights and Ideas

  • Influence $\neq$ Decision Relevance: A feature might have high attribution (SHAP value), but that doesn't mean every threshold on that feature is equally important. The critical predicate identifies the specific "tipping point" in the model's logic.
  • Threshold Sharing: In many ensembles, different trees often reuse the same or very similar split thresholds. The local DPG leverages this "sharing" to find predicates that affect many trees simultaneously.
  • Explanatory Debugging: By targeting the true class of a wrong prediction, the critical predicate acts as a debugger. It points directly to the part of the model's logic that caused the error.
  • Verifiable Records: The local DPG serves as a "verifiable record of computation." It doesn't just summarize; it shows exactly which trees were involved in which part of the decision.

Key Results

  • Error Recovery: For wrong predictions, crossing the single critical predicate recovered the true class in 46–69% of cases. This significantly outperformed using the top-ranked feature from TreeSHAP (which only recovered the class 29–50% of the time).
  • Fault Localization: On synthetic data with "planted faults" (intentionally introduced errors), the critical predicate identified the faulty threshold in 46–71% of cases, compared to just 6–21% by random selection.
  • Efficiency: Building the local DPG is relatively inexpensive, taking between 87 and 461 ms per sample, making it viable for real-time explanation.
  • Separation Contrast: The critical predicate was found to separate "differently predicted neighbors" (similar samples with different outcomes) much better than random or nearest-threshold predicates.

Limitations and Future Work

  • Not Compact: While useful for automated analysis, the full local DPG is often too large for a human to read comfortably (averaging 173 to 885 nodes).
  • No "Free Lunch" for Repair: Interestingly, the authors found that simply "editing" the model by neutralizing or moving the critical predicates did not improve the model's performance on unseen data. This suggests that fixing a model requires more evidence than a few local errors provide.
  • Feature Constraints: The current implementation is limited to numeric features. Future work is needed to extend this to categorical splits and regression tasks.
  • Human-Centric Evaluation: The authors acknowledge that while the method is mathematically sound, user studies are needed to determine how well humans can actually use these graphs for debugging.

Summary updated

Abstract

Tree ensembles are among the most accurate models for tabular data, yet the computation behind a single prediction is spread over hundreds of decision rules. Feature attributions and counterfactuals explain such predictions through the influence of features or a change of the input, leaving open which of the thresholds applied by the trees a prediction responds to, while structural explanations compress these rules and lose the trees behind them. To address this gap, we propose a local Decision Predicate Graph (local DPG), which gathers the rules executed for a sample into a verifiable record of the computation, with a class support that reproduces every explained prediction. From these rules we select the critical predicate, the executed predicate whose crossing is estimated to move the model most strongly toward a chosen class, which offers the user a concrete threshold and the trees that share it, without an external explainer. Across 16 datasets and four ensemble families, it separates differently predicted neighbours better than random and nearest-threshold predicates. A single crossing recovers the true class in 46-69% of wrong predictions, against 29-50% when the same rule is applied to the feature ranked first by TreeSHAP, a measure close to the selection criterion, and on planted faults it finds the faulty threshold in 46-71% of the resulting errors, against 6-21% at random. Although training-free edits of these predicates did not reduce the error on unseen data, the critical predicate complements attributions and counterfactuals by naming where a prediction can be changed.
BibTeX
@misc{junior2026where,
  author = {Sylvio Barbon Junior and Luca Longo},
  title = {{Where Tree Ensembles Decide: Structural Local Explanation with Decision Predicate Graphs}},
  year = {2026},
  eprint = {2611.18382},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.18382},
}
Figure