# TreeGrad-Ranker: Feature Ranking via $O(L)$-Time Gradients for Decision Trees

Source: [TreeGrad-Ranker: Feature Ranking via $O(L)$-Time Gradients for Decision Trees](<https://www.sota2.com/research/paper/698eaffbc97a0b3e3b5e667b>)

Collection index: [llms.txt](<https://www.sota2.com/research/llms.txt>)

Data updated: 2026-04-23T05:00:12.895Z

Authors: Weida Li, Yaoliang Yu, Bryan Kian Hsiang Low

Published: 2026-02-12T06:17:12.000Z

## Abstract

We revisit the use of probabilistic values, which include the well-known Shapley and Banzhaf values, to rank features for explaining the local predicted values of decision trees. The quality of feature rankings is typically assessed with the insertion and deletion metrics. Empirically, we observe that co-optimizing these two metrics is closely related to a joint optimization that selects a subset of features to maximize the local predicted value while minimizing it for the complement. However, we theoretically show that probabilistic values are generally unreliable for solving this joint optimization. Therefore, we explore deriving feature rankings by directly optimizing the joint objective. As the backbone, we propose TreeGrad, which computes the gradients of the multilinear extension of the joint objective in $O(L)$ time for decision trees with $L$ leaves; these gradients include weighted Banzhaf values. Building upon TreeGrad, we introduce TreeGrad-Ranker, which aggregates the gradients while optimizing the joint objective to produce feature rankings, and TreeGrad-Shap, a numerically stable algorithm for computing Beta Shapley values with integral parameters. In particular, the feature scores computed by TreeGrad-Ranker satisfy all the axioms uniquely characterizing probabilistic values, except for linearity, which itself leads to the established unreliability. Empirically, we demonstrate that the numerical error of Linear TreeShap can be up to $10^{15}$ times larger than that of TreeGrad-Shap when computing the Shapley value. As a by-product, we also develop TreeProb, which generalizes Linear TreeShap to support all probabilistic values. In our experiments, TreeGrad-Ranker performs significantly better on both insertion and deletion metrics. Our code is available at https://github.com/watml/TreeGrad.

## Recorded benchmark results

A research result applies to its stated dataset, split, metric and evaluation configuration. Compare like-for-like settings, preserve the metric's unit and direction, and distinguish paper-reported results from independent reproduction. The best result recorded here is not a claim of exhaustive, current global coverage.

- [First-order Shapley value calculation on Fashion-MNIST sparse setting](<https://www.sota2.com/research/sota/first-order-shapley-value-calculation-on-fashion-mnist-sparse-setting.md>): First-order Shapley value calculation; Fashion-MNIST sparse setting; Runtime (s): 104.485.

- [First-order Shapley value calculation on CalHousing small setting](<https://www.sota2.com/research/sota/first-order-shapley-value-calculation-on-calhousing-small-setting.md>): First-order Shapley value calculation; CalHousing small setting; Runtime (s): 0.186.

- [First-order Shapley value calculation on CalHousing large setting](<https://www.sota2.com/research/sota/first-order-shapley-value-calculation-on-calhousing-large-setting.md>): First-order Shapley value calculation; CalHousing large setting; Runtime (s): 1079.476.

- [First-order Shapley value calculation on CalHousing (sparse setting)](<https://www.sota2.com/research/sota/first-order-shapley-value-calculation-on-calhousing-sparse-setting.md>): First-order Shapley value calculation; CalHousing (sparse setting); Runtime (s): 14.772.

- [First-order Shapley value calculation on CovType small setting](<https://www.sota2.com/research/sota/first-order-shapley-value-calculation-on-covtype-small-setting.md>): First-order Shapley value calculation; CovType small setting; Runtime (s): 0.091.

- [First-order Shapley value calculation on CovType large setting](<https://www.sota2.com/research/sota/first-order-shapley-value-calculation-on-covtype-large-setting.md>): First-order Shapley value calculation; CovType large setting; Runtime (s): 3.881.

- [First-order Shapley value calculation on CovType sparse setting](<https://www.sota2.com/research/sota/first-order-shapley-value-calculation-on-covtype-sparse-setting.md>): First-order Shapley value calculation; CovType sparse setting; Runtime (s): 0.679.

- [First-order Shapley value calculation on Fashion-MNIST small setting](<https://www.sota2.com/research/sota/first-order-shapley-value-calculation-on-fashion-mnist-small-setting.md>): First-order Shapley value calculation; Fashion-MNIST small setting; Runtime (seconds): 1.97.

- [First-order Shapley value calculation on Fashion-MNIST large setting](<https://www.sota2.com/research/sota/first-order-shapley-value-calculation-on-fashion-mnist-large-setting.md>): First-order Shapley value calculation; Fashion-MNIST large setting; Runtime (s): 738.263.

## Original sources and implementation

[Original paper](<https://arxiv.org/abs/2602.11623>)

[PDF](<https://arxiv.org/pdf/2602.11623.pdf>)
