Branches: Efficiently Seeking Optimal Sparse Decision Trees via AO*

Ayman Chaouki, Jesse Read, Albert Bifet

Introduction

In the world of interpretable machine learning, Decision Trees (DTs) remain a gold standard. However, practitioners face a fundamental tension: models must be highly accurate, yet sparse enough (with few splits) for humans to easily understand and trust them.

The paper introduces BRANCHES, a novel algorithm that finds the mathematically optimal sparse decision tree by framing the search as an AND/OR graph problem solved via the AO* algorithm. By moving away from traditional depth-first search and natively supporting multi-way splits for non-binary features, BRANCHES achieves state-of-the-art performance and provides superior "anytime" solutions when computational time is limited.

The Challenge of Optimal Decision Trees

Finding the "best" tree that perfectly balances accuracy and sparsity is an NP-complete optimization nightmare. Most practitioners rely on "greedy" algorithms like CART or C4.5. While fast, these heuristics often produce messy, suboptimal trees that are deeper and more complex than necessary.

Recent breakthroughs have utilized Dynamic Programming (DP) and Branch & Bound techniques to find truly optimal trees. However, these methods predominantly rely on Depth-First Search (DFS). While DFS is memory-efficient, it requires users to pre-define a maximum depth hyperparameter. If this depth is guessed incorrectly, the algorithm either misses the optimal tree entirely or wastes hours searching unnecessarily deep spaces.

The BRANCHES Approach

The authors propose a paradigm shift: formulating the search for an optimal tree as a traversal through an AND/OR graph.

  • OR nodes represent a choice: "Which feature should I split on here?"
  • AND nodes represent a requirement: "To evaluate this split, I must solve both the left and right child branches."
AND/OR Graph Formulation

To navigate this graph efficiently, BRANCHES employs the AO* algorithm, a best-first search strategy. The "secret sauce" enabling this approach is a novel heuristic called the Purification Bound. This bound allows the algorithm to prune massive sections of the search space by estimating the best possible accuracy a branch could achieve before actually computing it.

Crucially, unlike many competing methods (such as GOSDT or MurTree) that require categorical data to be converted into binary features, BRANCHES natively supports multi-way splits (ordinal encoding). This allows the algorithm to handle categorical data much more naturally and efficiently.

Experimental Setup

The researchers evaluated BRANCHES using 11 datasets from the UCI repository, including well-known benchmarks like Monk’s problems (1, 2, and 3), Tic-tac-toe, Car-evaluation, Nursery, Mushroom, Zoo, and Balance-scale.

They tested these datasets using different encodings—standard binary, "one-hot" binary (dropping one category), and ordinal encoding—to demonstrate the computational efficiency gained by allowing multi-way splits.

Key Findings & Results

The Power of Multi-way Splits

The "aha moment" of the paper is Theorem E.1, which proves that binary encoding creates a massive number of "unnecessary" branches that bloat the search space. By supporting ordinal features directly, BRANCHES can find optimal trees in a fraction of the time.

Unmatched Efficiency and Optimality

BRANCHES is guaranteed to find the globally optimal tree (for a given sparsity penalty $\lambda$) upon termination. In head-to-head tests against state-of-the-art algorithms like GOSDT, BRANCHES was faster on almost every dataset, often by orders of magnitude in terms of iterations.

Performance Comparison on UCI Datasets

For example, on the Mushroom dataset using ordinal encoding, BRANCHES converged to the optimal solution in just 6 iterations (0.15 seconds). In contrast, competitors using binary encoding frequently hit the 5-minute timeout limit.

Superior "Anytime" Behavior

Because BRANCHES uses a best-first approach, it explores the most promising parts of the tree first. If a user sets a strict time limit and the algorithm hasn't finished, the "best so far" solution it provides is typically much closer to the true optimum than what a depth-first algorithm would offer.

Python vs. C++

In a surprising twist, the authors' Python implementation of BRANCHES often outperformed state-of-the-art competitors written in highly optimized C++. This highlights that the underlying strategy (AO* on AND/OR graphs) is vastly more important than raw execution speed.

Complexity Guarantees

The authors provided a new theoretical upper bound on the number of branch evaluations. Numerically, this bound is significantly tighter (smaller) than previous bounds for algorithms like OSDT, proving its theoretical superiority alongside its empirical success.

Limitations and Future Directions

The primary trade-off for the speed of BRANCHES is memory consumption. Best-first search algorithms like AO* must store the search graph in memory, which can become taxing for extremely large datasets or highly complex problem spaces.

The authors suggest several promising paths forward to mitigate this:

  1. C++ Implementation: Porting the Python code to C++ and adding multi-threading could widen the performance gap even further.
  2. Hybrid Search: Developing a strategy that uses Best-First Search until memory is full, then seamlessly switches to Depth-First Search.
  3. Stronger Heuristics: Using auxiliary classifiers (like a small neural network) to provide even tighter bounds for the AO* search, potentially pruning even more of the graph before it is explored.

Summary updated

BibTeX
@inproceedings{chaouki2025branches,
  author = {Ayman Chaouki and Jesse Read and Albert Bifet},
  title = {{Branches: Efficiently Seeking Optimal Sparse Decision Trees via AO*}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=lQWTRVrArk},
}
Figure