Tree-based machine learning models, such as XGBoost and Random Forests, are highly vulnerable to adversarial examples. While the discovery of these imperceptible perturbations has sparked massive research into making Deep Neural Networks (DNNs) more robust, the robustness of tree-based models has been largely overlooked.
Because tree-based models are non-smooth, discrete, and non-differentiable, standard gradient-based defense mechanisms like adversarial training cannot be directly applied. Furthermore, naive attempts to apply adversarial training to boosted trees fail because boosting is additive; non-robust trees built in early rounds remain in the final ensemble, leaving the model permanently vulnerable. To address this, researchers have introduced a novel, scalable framework for training inherently robust decision trees and gradient-boosted ensembles by framing the node-splitting process as a min-max optimization problem.
The Core Method: Robust Splitting
Standard decision trees are built greedily. At each node, the algorithm searches for a feature and a threshold that maximizes a specific score, such as Information Gain.
To build defenses directly into the tree, the authors propose Robust Splitting. Instead of maximizing the standard score, the algorithm seeks to maximize the minimum possible score under any $L_\infty$ adversarial perturbation of the training data within a radius $\epsilon$. This creates a max-min saddle point problem.
Solving this inner minimization exactly is an NP-hard 0-1 integer programming problem. The adversary can independently perturb any data point near the split threshold (the "ambiguity set") to either the left or right child node to ruin the split's purity. To make this scalable, the authors introduce clever approximations:
- For Single Trees (Information Gain): They mathematically prove that the adversary's optimal strategy is to balance the class ratios between the left and right leaves. This allows them to use an exact, efficient $O(|I|)$ greedy algorithm to find the worst-case perturbation.
- For GBDTs (e.g., XGBoost): Because GBDTs use complex loss functions via Taylor expansions, the authors approximate the worst-case scenario by evaluating just four representative perturbation cases: (1) no perturbation, (2) push all ambiguous points left, (3) push all ambiguous points right, or (4) swap their sides. The algorithm takes the minimum score among these four cases in $O(1)$ time, making it highly scalable for massive datasets.
Key Insights
- Robust vs. Non-Robust Features: Just like in DNNs, a standard decision tree might choose to split on a feature that yields a slightly higher accuracy but is easily manipulated by an adversary. Robust splitting forces the tree to select features that maintain their predictive power even when the data is perturbed.
- Robustness Acts as Regularization: The robust splitting criterion naturally penalizes splits that have many data points sitting very close to the decision boundary. Because of this conservative splitting behavior, robust trees sometimes actually achieve higher standard test accuracy on small datasets by avoiding overfitting to noise.
- Why Standard Adversarial Training Fails for Boosting: If you try to adversarially train a GBDT by adding adversarial examples at each boosting round, the model still fails. Because boosting is an additive process, the non-robust trees generated in the first few rounds are permanently baked into the ensemble, acting as a weak link. Robustness must be embedded into the split-finding process of every single tree.
Performance and Results
The authors evaluated their framework on a mix of image and tabular datasets, testing against several attack methods including Cheng's gradient-free $L_\infty$ attack and Kantchelian's exact Mixed Integer Linear Programming (MILP) attack.
For single trees, the $L_\infty$ distortion required to successfully fool the robust models increased by 1.5x to over 2x compared to naturally trained trees.
For GBDTs, the improvements were massive. On the MNIST dataset, a naturally trained XGBoost model could be fooled by a tiny $L_\infty$ perturbation of 0.072. The robust GBDT required a perturbation of 0.373 (a 5.18x increase) to be fooled. As shown below, this distortion is so large that the adversarial images visibly look like different digits or objects to human eyes, meaning the model is effectively robust to imperceptible attacks.
Accuracy Trade-offs: To maintain comparable clean accuracy to natural models, robust GBDTs generally require higher model capacity (e.g., deeper trees or more estimators). This mirrors a known phenomenon in DNN adversarial training, where robustness often comes at a slight cost to standard accuracy unless model size is increased.
Limitations and Future Work
While highly effective, the framework primarily focuses on $L_\infty$ norm perturbations. Although it improves $L_1$ and $L_2$ robustness as a byproduct, it is not explicitly optimized for them. Additionally, the $O(1)$ approximation used for GBDTs is a heuristic rather than a provable theoretical bound. Future work may extend this framework to other traditional tree-scoring metrics, like Gini impurity for CART, and formally adapt it to Random Forests.
Summary updated