Decision trees are the workhorses of tabular machine learning. From the classic CART algorithm to modern powerhouses like XGBoost and LightGBM, they offer a rare combination of interpretability and performance. However, we’ve long been stuck in a binary choice: use greedy algorithms that are lightning-fast but often suboptimal, or use optimal solvers that find the best possible tree but explode in computational complexity as soon as you move beyond shallow trees or binary features.
In their paper, "Breiman meets Bellman: Non-Greedy Decision Trees with MDPs," Hector Kohler and his colleagues introduce Dynamic Programming Decision Trees (DPDT)—a framework that effectively bridges this gap by treating tree induction as a reinforcement learning problem.
TL;DR
DPDT formulates decision tree construction as a Markov Decision Process (MDP) and solves it using dynamic programming. By using greedy heuristics (like CART) to intelligently prune the search space of possible splits, it achieves near-optimal training performance with orders of magnitude less computation than exact solvers, while generalizing better to unseen data.
What Problem Does This Paper Address?
The fundamental issue with standard decision trees (like CART) is their greediness. They pick the best split right now based on local information gain (like Gini impurity), without considering how that split affects the rest of the tree. This often leads to "pathological" failures, such as the XOR problem, where no single axis-aligned split looks good initially, even though a perfect tree exists.
On the other end of the spectrum, optimal decision tree solvers try to find the tree that minimizes a global regularized loss. Because this is an NP-Hard problem, these solvers are usually restricted to very shallow trees (depth 3 or 4) or datasets that have been pre-binarized. They are computationally "heavy" and often struggle to scale to the millions of samples found in modern industrial datasets.
Methods
The authors’ core innovation is the DPDT framework, which combines the look-ahead capabilities of Bellman’s Dynamic Programming with the efficiency of Breiman’s greedy heuristics.
- MDP Formulation: They define a state as a subset of the data and the current depth. An action is either choosing a split (feature and threshold) or declaring a leaf. The "reward" is the negative training loss minus a complexity penalty.
- Heuristic Split Generation: This is the key to scalability. Instead of evaluating every possible split at every node (which is what optimal solvers do), DPDT uses a heuristic—specifically, it runs CART on the current subset—to propose a small set of $B$ candidate splits.
- Dynamic Programming: Once the search space is restricted to these "smart" candidates, the resulting MDP is a directed acyclic graph (DAG) that can be solved exactly using backward induction.
Essentially, DPDT uses a greedy algorithm to decide where to look, but uses dynamic programming to decide which path to take to minimize the global loss.
Datasets
The authors evaluated DPDT across a wide range of scenarios:
- Toy "Pathological" Data: An XOR-pattern dataset used to prove that DPDT succeeds where CART fails.
- Quant-BnB Benchmarks: 16 diverse classification datasets (e.g., room, bean, eeg, magic, bank) used to compare against state-of-the-art optimal solvers.
- Large-Scale Data: The KDD 1999 Cup dataset, featuring 5 million rows, to test scalability for deep trees (depth 10).
- Generalization Benchmarks: A curated suite of tabular datasets (from Grinsztajn et al., 2022) to compare DPDT against boosted trees and deep learning models like SAINT and FT-Transformer.
Key Insights and Ideas
- Diversity over Local Gain: Greedy methods often pick splits that look identical. DPDT’s heuristic approach allows it to consider a diverse set of candidates, and the DP solver can "see" that a locally mediocre split might lead to a much better global outcome.
- The "Optimal" Generalization Paradox: Interestingly, the paper finds that "optimal" trees (which perfectly minimize training loss) don't always generalize best. DPDT often finds trees that have slightly lower training accuracy than "optimal" solvers but significantly higher test accuracy.
- Boosting Synergy: DPDT isn't just for single trees. When used as the base learner in Gradient Boosting (replacing standard CART), it consistently outperforms boosted CART, suggesting that "smarter" weak learners lead to much stronger ensembles.
Key Results
- Efficiency: DPDT reached 99% of the optimal regularized training accuracy while performing $10^2$ to $10^4$ fewer operations than exact solvers like Quant-BnB.
- Generalization: In a head-to-head benchmark on medium-sized datasets, DPDT learned trees that generalized better than both CART and the optimal solver STreeD.
- Scalability: While optimal solvers are often stuck at depth 3 or 4, DPDT successfully induced depth-10 trees on a 5-million-row dataset in under 15 minutes.
- SOTA Performance: Boosted DPDT outperformed several specialized deep learning architectures for tabular data (like ResNet and MLP) and matched or exceeded the performance of Boosted CART.
Limitations and Future Work
The primary limitation is the current implementation. While the algorithm is theoretically efficient, the authors' implementation is in pure Python, making it slower in wall-clock time than highly optimized C++ libraries like scikit-learn or XGBoost.
The authors suggest that the next logical step is an industry-ready C++ implementation. Integrating DPDT as a plugin for XGBoost or LightGBM could potentially set a new standard for tabular machine learning by providing the "look-ahead" benefits of dynamic programming at the scale of modern big data.
Summary updated