Optimal Counterfactual Search in Tree Ensembles: A Study Across Modeling and Solution Paradigms

📅 2026-05-07
📈 Citations: 0
Influential: 0
📄 PDF

career value

193K/year
🤖 AI Summary
This study addresses the generation of optimal counterfactual explanations for tree ensemble models under plausibility and actionability constraints, aiming to avoid suboptimal solutions that lead to excessive modifications or unfair recommendations. To this end, the counterfactual search is formulated as a combinatorial optimization problem, and a constraint programming-based method, CPCF, is proposed to uniformly handle both numerical and discrete features. The work further presents the first systematic comparison of the applicability boundaries of three paradigms—constraint programming (CP), maximum Boolean satisfiability (MaxSAT), and mixed-integer linear programming (MILP)—for this task. Experimental results across ten datasets and three types of tree ensembles demonstrate that CP generally achieves the best overall performance, while each paradigm exhibits distinct strengths: CP offers broad applicability, MaxSAT excels in sandbox voting scenarios, and MILP is well-suited for amortized inference settings.
📝 Abstract
Trust in counterfactual explanations depends critically on whether their recommended changes are truly minimal: suboptimal explanations may vastly overshoot the actual changes needed to alter a decision, and heuristic errors can affect individuals unevenly, giving some users relevant recourse while assigning others unnecessarily costly recommendations. Consequently, we study the problem of computing optimal counterfactual explanations for tree ensembles under plausibility and actionability constraints. This is a combinatorial problem: for a fixed model, counterfactual search boils down to selecting consistent branching decisions and threshold-defined regions under a distance objective. We exploit this structure through CPCF, a constraint programming (CP) formulation in which numerical features are encoded as interval domains induced by split thresholds, while discrete features retain native finite-domain representations. This yields a compact finite-domain formulation that supports multiple distance objectives without continuous split-boundary search. We then place CPCF in a broader comparison across mathematical programming paradigms: we extend a maximum Boolean satisfiability (MaxSAT) formulation, originally designed for hard-voting random forests, to soft-voting ensembles, and compare against the current state-of-the-art mixed-integer linear programming (MILP) optimal approach. Across ten datasets and three types of tree ensembles, we analyze scalability, anytime performance, and sensitivity to distance metrics. We observe that CP achieves the best overall performance. More importantly, our results identify regimes in which the specific strengths of each paradigm make it best suited: CP is most versatile overall, MaxSAT handles hard-voting ensembles particularly well, and MILP remains competitive in amortized inference settings with a moderate number of split levels.
Problem

Research questions and friction points this paper is trying to address.

counterfactual explanations
tree ensembles
optimality
actionability constraints
plausibility constraints
Innovation

Methods, ideas, or system contributions that make the work stand out.

Constraint Programming
Counterfactual Explanations
Tree Ensembles
Optimal Recourse
Mathematical Programming