Rigorous Explanations for Tree Ensembles

Yacine Izza, Alexey Ignatiev, Xuanxiang Huang, Peter J. Stuckey, Joao Marques-SilvaarXiv 2026

TL;DR

This paper introduces a unified propositional logic framework to compute rigorous, model-precise explanations for tree ensembles, including Random Forests and Gradient Boosted Trees. By leveraging optimized MaxSAT reasoning rather than traditional SMT solvers, the proposed approach delivers exact explanations and verifies fairness/robustness properties up to 10 times faster, pushing the scalability frontier of formal Explainable AI (XAI).

What Problem Does This Paper Address?

Tree ensembles (TEs)—such as Random Forests (RFs) and Gradient Boosted Trees (BTs)—are highly accurate and robust, frequently outperforming deep neural networks on tabular data. However, because they aggregate predictions from tens or hundreds of individual decision trees via majority or weighted voting, their internal decision-making process is a complete black box to humans.

To build trust, practitioners often turn to popular XAI tools like SHAP or LIME. However, these methods rely on heuristics or perturbations; they offer no formal guarantees, can be highly unstable, and occasionally deliver misleading explanations.

"Formal" or logic-based XAI solves this by providing model-precise explanations—specifically Abductive Explanations (AXps), which are minimal sets of features sufficient to guarantee a prediction, and Contrastive Explanations (CXps), which show what features need to change to alter a prediction. The catch? Computing these exact explanations is computationally demanding ($D^P$-complete). This paper tackles the challenge of unifying different ensemble architectures (majority vote, weighted vote, boosted trees) into a single logical framework that can scale to realistic, production-sized models.

Methods

The authors present a uniform logic-based framework that translates various tree ensemble aggregation schemes into propositional logic formulas.

  1. Unified Propositional Encoding: The authors show that Random Forests with majority voting can be reduced polynomially to Boosted Trees or linearly to Random Forests with weighted voting. This allows a single clausal representation to handle diverse ensemble types.
  2. MaxSAT-based Reasoning: Instead of using Satisfiability Modulo Theories (SMT), which natively handle real numbers but suffer from high overhead, the authors encode the linear aggregation constraints of non-uniform tree weights into a Partial Weighted MaxSAT problem.
  3. Algorithmic Optimizations: To make the MaxSAT approach scale, they introduce several novel heuristics:
  4. Incremental MaxSAT with assumptions: Reusing the solver state across multiple feature-testing iterations.
  5. Distance-based stratification: Grouping clause weights based on their proximity to the mean, preventing the solver from choking on highly diverse real-valued weights.
  6. Multi-class disjunction heuristics: A VSIDS-like class-ordering technique that prioritizes testing opponent classes that are most likely to cause a misclassification.
  7. Smallest Explanations & Verification: By exploiting the hitting set duality between AXps and CXps, the framework can compute the absolute minimum-cardinality explanations. It also extends to formal verification tasks, checking models for individual fairness and adversarial robustness ($l_0$-norm).

Datasets

The framework was evaluated on 31 publicly available datasets from the UCI Machine Learning Repository and the Penn Machine Learning Benchmarks (including ann-thyroid, banknote, ionosphere, sonar, spambase, and texture).

For the individual fairness verification experiments, the authors utilized four standard algorithmic fairness benchmarks:

  • Adult (Income prediction)
  • COMPAS (Criminal recidivism)
  • German Credit (Credit scoring)
  • Ricci (Public-sector employment promotion)

Key Insights and Ideas

  • MaxSAT Beats SMT for Real Weights: Intuitively, SMT solvers seem like the natural choice for handling the real-valued weights generated by algorithms like XGBoost. However, the authors discovered that a carefully optimized propositional MaxSAT encoding is 5 to 10 times faster than SMT (Z3). MaxSAT avoids the heavy overhead of background theory solvers and benefits directly from advanced SAT core-guided optimization techniques.
  • Verification is Cheaper than Explanation: Enforcing a condition like $\kappa(x) \neq \kappa(y)$ to find a fairness violation or adversarial example requires a simpler logical structure than finding a minimal explanation. Consequently, verification tasks can be solved in milliseconds, even when explanation generation takes seconds.
  • Eliminating the Long Tail: Standard contrastive explanations can sometimes be bloated. By optimizing for minimum cardinality, the framework completely eliminates the "long tail" of complex, uninterpretable explanations, reducing explanation sizes by up to 50%.

Key Results

  • Massive Speedups over SMT: On complex multi-class datasets like texture (11 classes), the SMT baseline frequently timed out (taking over 24 minutes), whereas the optimized MaxSAT approach consistently terminated in under 1 minute.
Assessing MaxSAT and SMT encodings of BTs for computing AXps
  • High Practical Scalability: Across all 31 benchmarks, the average runtime for computing a single explanation (AXp/CXp) remained well below 30 seconds, with the vast majority resolving in under 5 seconds.
  • Fairness Insights: The verification framework successfully proved that the German Credit model satisfied individual fairness, while exposing clear fairness violations in Adult, COMPAS, and Ricci. Notably, the Ricci model exhibited bias despite achieving 100% predictive accuracy, proving that high accuracy does not guarantee fairness.

Limitations and Future Work

  • The Tree Depth Bottleneck: While the number of clauses scales linearly with the number of trees, the number of literals grows exponentially with tree depth. This limits the current framework to ensembles with a maximum tree depth of $d \le 6$. For deeper trees ($d \ge 8-10$), the encoding becomes completely intractable.
  • Super-Linear Growth: Increasing the number of classes ($K$) multiplies the number of MaxSAT soft constraints, leading to super-linear growth in solver time for highly multi-class datasets.
  • Future Directions: The authors point to more optimized encoding schemes, symmetry breaking, and specialized compression techniques as crucial next steps to handle deeper and larger ensemble configurations.

Summary updated

BibTeX
@misc{izza2026rigorous,
  author = {Yacine Izza and Alexey Ignatiev and Xuanxiang Huang and Peter J. Stuckey and Joao Marques-Silva},
  title = {{Rigorous Explanations for Tree Ensembles}},
  year = {2026},
  eprint = {2603.29361},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2603.29361},
}
Figure