Skip to main content
QUICK REVIEW

[Paper Review] FOCUS: Flexible Optimizable Counterfactual Explanations for Tree Ensembles

Ana Lučić, Harrie Oosterhuis|arXiv (Cornell University)|Nov 27, 2019
Explainable Artificial Intelligence (XAI)Computer Science5 citations
TL;DR

FOCUS proposes a gradient-based optimization framework for generating counterfactual explanations in tree ensemble models by introducing a differentiable approximation of non-differentiable tree structures. It produces counterfactual examples significantly closer to original instances than prior methods, enabling effective, efficient, and reliable explanations for all input instances.

ABSTRACT

Model interpretability has become an important problem in machine learning (ML) due to the increased effect that algorithmic decisions have on humans. Counterfactual explanations can help users understand not only why ML models make certain decisions, but also how these decisions can be changed. We frame the problem of finding counterfactual explanations as a gradient-based optimization task and extend previous work that could only be applied to differentiable models. In order to accommodate non-differentiable models such as tree ensembles, we use probabilistic model approximations in the optimization framework. We introduce an approximation technique that is effective for finding counterfactual explanations for predictions of the original model and show that our counterfactual examples are significantly closer to the original instances than those produced by other methods specifically designed for tree ensembles.

Motivation & Objective

  • To address the lack of effective, scalable counterfactual explanation methods for non-differentiable tree ensemble models.
  • To enable gradient-based optimization for counterfactual generation in models like random forests and gradient boosting machines.
  • To produce counterfactual examples that are minimally perturbed from the original input while changing the model’s prediction.
  • To ensure all instances in a dataset can be explained, overcoming limitations of heuristic search-based approaches.
  • To provide actionable, interpretable explanations that align with real-world feature trends and user context.

Proposed method

  • Approximate each tree split in a tree ensemble using a sigmoid function centered at the split threshold, enabling differentiability.
  • Replace the ensemble’s max operator with a softmax to create a differentiable approximation of the full model output.
  • Formulate counterfactual generation as a gradient-based optimization problem minimizing perturbation under a chosen distance metric.
  • Use the differentiable surrogate model to compute gradients and optimize input features to change the prediction with minimal change.
  • Support flexible distance functions (e.g., L2, L1, or custom) to tailor counterfactuals to specific use cases.
  • Ensure feasibility by validating that generated counterfactuals remain within realistic feature bounds and align with domain expectations.

Experimental results

Research questions

  • RQ1Can gradient-based optimization be effectively applied to non-differentiable tree ensemble models for counterfactual explanation?
  • RQ2How do counterfactual examples generated by FOCUS compare in proximity to the original instance against existing heuristic methods for tree ensembles?
  • RQ3Can FOCUS generate valid counterfactual explanations for all instances in a dataset, unlike prior approaches?
  • RQ4How do the suggested feature changes in FOCUS align with domain expectations and real-world feasibility?
  • RQ5Does the flexibility of distance functions in FOCUS improve the practicality and user relevance of counterfactual explanations?

Key findings

  • FOCUS generates counterfactual examples that are significantly closer to the original input instances than baseline methods across three evaluation metrics.
  • The method achieves superior performance in proximity, with improvements consistently observed on all tested datasets and model types.
  • FOCUS successfully generates valid counterfactual explanations for every instance in the dataset, unlike heuristic methods that fail on some inputs.
  • The counterfactual suggestions align with domain knowledge—e.g., decreasing NetFractionRevolvingBurden and increasing ExternalRiskEstimate—indicating realistic and meaningful changes.
  • The differentiable approximation enables efficient optimization, allowing FOCUS to scale to larger tree ensemble models compared to exhaustive search-based baselines.
  • The approach supports flexible distance functions, enabling customization of counterfactuals for varying user needs and constraints.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.