Search

Search papers and lessons

Neural Oblivious Decision Ensembles for Deep Learning on Tabular Data

Sergei Popov, Stanislav Morozov, Artem Babenko · 2019

NODE makes an ensemble of oblivious decision trees differentiable and stacks it DenseNet-style, so gradient descent can train it end to end and it beats CatBoost and XGBoost on most tabular benchmarks.

On this page

  • Colour = topic mix
  • Linear algebra
  • Neural network basics
  • Calculus
  • Discrete math
  • Probability
  • Classical models
  • ReadReady to readNot yet

TL;DR

NODE is a neural network for tables of numbers, such as customer records or sensor readings, where the best tools until then were gradient-boosted decision trees. It builds its model out of oblivious decision trees, which use the same question at every node of one level, and it makes each choice soft and differentiable so that the whole model can be trained with gradient descent. Stacking such layers, each seeing all earlier outputs, lets it learn deeper rules. On six public datasets it beats CatBoost and XGBoost with default settings on every dataset in the paper's Table 1, and on most datasets once tuned.

Builds on: Oblivious Decision Tree, Entmax, Backpropagation, Ensemble Learning · Leads to: CatBoost: unbiased boosting with categorical features

Why it mattered

For tabular data, practitioners in the late 2010s relied on gradient-boosted decision trees for tables. Deep learning had transformed images, speech and text, but on tables its advantage was unclear. NODE is one of the first architectures reported to beat the leading boosting packages on a broad set of tabular benchmarks, and its public PyTorch code made the approach easy to try.

The paper also shows a way to bring tree models into larger systems. Because the model is differentiable, it can be placed inside a larger neural network, for example one that also reads images or text, and trained end to end.

The problem

A gradient-boosted tree ensemble is trained one tree at a time, each step chosen greedily, and the trees are not trainable by gradients. A regular decision tree also takes a different path for each input, which makes it awkward to batch on a GPU. Earlier attempts to make trees differentiable used stochastic choices. Gumbel-softmax, for example, samples one option at random, and in the paper's own tests it failed to train deep stacks.

The paper therefore needed three things at once: a tree whose output is a smooth function of its inputs, a way to learn the choice of feature without sampling, and a layered design that can use the outputs of one layer as inputs to the next. Oblivious trees help with the first, a sparse normalisation function helps with the second, and a DenseNet-style stack helps with the third.

How it works

Here is the path one input takes through a NODE model with a single layer of two trees of depth two. Each tree has two levels, so it asks two questions.

  1. Pick a feature for each level. Each level has a learned weight over all input features. A sparse normalisation function (entmax with alpha 1.5) turns those weights into a few non-zero numbers, so the level mostly looks at one or two features. The chosen feature value is a weighted sum of the inputs.
  2. Ask a soft question. At each level, subtract a learned threshold from the chosen feature and divide by a learned scale. Pass the result through a two-class sparse normalisation. This gives a number between 0 and 1 for "yes" and its complement for "no". For clear cases it is close to 0 or 1, which is what a hard tree would say.
  3. Build the choice table. With depth two there are four leaves. The chance of each leaf is the product of the level answers, for example the chance of "yes then no" is the first answer times one minus the second. The four numbers sum to 1.
  4. Weight the leaf responses. Each tree has a table of learned responses, one per leaf. The tree's output is the sum of each response times its leaf chance. If the answers are clear, one leaf dominates and the output matches a hard tree.
  5. Concatenate the trees. A layer of several trees concatenates their outputs.
  6. Stack and average. In the multi-layer version, each new layer takes as input the original features and the outputs of all previous layers, like DenseNet. The final prediction averages the outputs of all trees from all layers.
  7. Train end to end. Every feature weight, threshold, scale and leaf response is updated by mini-batch gradient descent, with the loss being cross-entropy for classification or squared error for regression.
flowchart LR
  X["Features x"] --> L1["NODE layer 1: soft trees"]
  X --> L2["NODE layer 2: soft trees"]
  L1 --> L2
  X --> L2
  L1 --> AVG["Average of all tree outputs"]
  L2 --> AVG
  AVG --> Y["Prediction"]

The math

A single tree of depth dd has dd features fif_i, thresholds bib_i and a response tensor RR with 2d2^d entries. A hard oblivious tree outputs h(x)=R[1(f1(x)−b1),…,1(fd(x)−bd)]h(x) = R[\mathbb{1}(f_1(x) - b_1), \ldots, \mathbb{1}(f_d(x) - b_d)], where 1\mathbb{1} is the step function, which is zero for negative input and one otherwise. The step function has zero gradient almost everywhere, so the paper replaces it.

Definition: Differentiable oblivious tree

Each feature choice becomes a weighted sum f^i(x)=∑jxj⋅entmaxα(Fij)\hat{f}_i(x) = \sum_j x_j \cdot \text{entmax}_\alpha(F_{ij}) over learned weights FF. Each step becomes ci(x)=σα((fi(x)−bi)/τi)c_i(x) = \sigma_\alpha((f_i(x) - b_i)/\tau_i), where σα(z)=entmaxα([z,0])\sigma_\alpha(z) = \text{entmax}_\alpha([z, 0]) and τi\tau_i is a learned scale. The choice tensor C(x)C(x) is the outer product of the pairs [ci,1−ci][c_i, 1 - c_i], and the tree output is h^(x)=∑Ri1…idCi1…id(x)\hat{h}(x) = \sum R_{i_1 \ldots i_d} C_{i_1 \ldots i_d}(x).

Step 2 in symbols

The two-class normalisation σα\sigma_\alpha of a number zz returns a probability cc and its complement 1−c1 - c. If zz is large and positive, cc is close to 1, and the output moves toward the "yes" leaf. If zz is far below zero, it moves toward "no". The sparse version can return exactly 0 or 1 for clear cases, which is what makes the soft tree agree with the hard one.

Step 3 in symbols

With d=2d = 2, the four leaf chances are c1c2c_1 c_2, c1(1−c2)c_1 (1 - c_2), (1−c1)c2(1 - c_1) c_2 and (1−c1)(1−c2)(1 - c_1)(1 - c_2). They sum to 1 because c1+(1−c1)=1c_1 + (1 - c_1) = 1 and the same holds for c2c_2.

Step 6 in symbols

The prediction averages all tree outputs across layers. If layer ℓ\ell contributes mm trees, the final output is the mean of all h^\hat{h} from all layers, restricted to the first coordinates needed for the task.

Worked examples

Example
Example 1: the two-class normalisation (tiny)

Use σ1.5\sigma_{1.5} on the two scores [z,0][z, 0] with z=2z = 2. Entmax with alpha 1.5 is hard to hand-compute, so use the simpler sparsemax, which is the alpha 2 case, on the three scores [2,1,0][2, 1, 0] and compare it with softmax.

  1. Sparsemax: sort the scores as 2, 1, 0. Try support size 1: the test 1+1×2=31 + 1 \times 2 = 3 is greater than the sum of the top one, which is 2, so support size 1 is valid.
  2. The threshold is τ=(2−1)/1=1\tau = (2 - 1)/1 = 1.
  3. Output: max⁡(z−τ,0)\max(z - \tau, 0) gives [1,0,0][1, 0, 0]. Exactly one choice, no spread.
  4. Softmax on the same scores: e2≈7.39e^2 \approx 7.39, e1≈2.72e^1 \approx 2.72, e0=1e^0 = 1, total about 11.11. Output about [0.665,0.245,0.090][0.665, 0.245, 0.090].

Interpretation: softmax gives every feature a share of the weight, while sparsemax picks one. Entmax with alpha 1.5 sits between them, which is why the paper prefers it for feature choice: it is sparse, but smooth enough for gradients.

Example
Example 2: one soft tree, two levels (standard)

A depth-2 tree with c1=0.9c_1 = 0.9 and c2=0.2c_2 = 0.2, and leaf responses R00=1R_{00} = 1, R01=3R_{01} = 3, R10=5R_{10} = 5, R11=7R_{11} = 7, where the first index is the first answer and 0 means "yes". Use c1c_1 as the chance of "yes" at level 1 and c2c_2 at level 2.

  1. Leaf chances: R00R_{00} gets 0.9×0.2=0.180.9 \times 0.2 = 0.18. R01R_{01} gets 0.9×0.8=0.720.9 \times 0.8 = 0.72. R10R_{10} gets 0.1×0.2=0.020.1 \times 0.2 = 0.02. R11R_{11} gets 0.1×0.8=0.080.1 \times 0.8 = 0.08.
  2. Check they sum to 1: 0.18+0.72+0.02+0.08=1.000.18 + 0.72 + 0.02 + 0.08 = 1.00.
  3. Output: 0.18×1+0.72×3+0.02×5+0.08×70.18 \times 1 + 0.72 \times 3 + 0.02 \times 5 + 0.08 \times 7.
  4. Each product: 0.180.18, 2.162.16, 0.100.10, 0.560.56. Sum: 0.18+2.16+0.10+0.56=3.000.18 + 2.16 + 0.10 + 0.56 = 3.00.

Interpretation: the soft output is 3.0, a weighted blend of the four responses. If c1c_1 and c2c_2 were both exactly 1, only R00R_{00} would count, and the tree would return 1, the hard answer for "yes then yes".

Example
Example 3: reading the reported table (realistic)

Table 1 reports the YearPrediction error, which is mean squared error, so lower is better. With default settings: CatBoost 80.68, XGBoost 81.11, NODE 77.43.

  1. Improvement of NODE over CatBoost: 80.68−77.43=3.2580.68 - 77.43 = 3.25.
  2. Relative: 3.25/80.68≈0.0403.25 / 80.68 \approx 0.040, about 4.0 percent lower error.
  3. Check the Epsilon classification error in the same table: CatBoost 0.1119 against NODE 0.1043. The gap is 0.00760.0076, which is 0.0076/0.1119≈0.0680.0076 / 0.1119 \approx 0.068, about 6.8 percent relative.

Interpretation: with default settings NODE is ahead on every dataset in the table. The gaps are small in some cases, such as Microsoft at 0.5584 against 0.5587, and the paper reports standard deviations over ten seeds that are of similar size for some of them, so the advantage is clear on most datasets but not on all of them.

Try it: on Higgs with tuned settings, the errors are NODE 0.2101 and XGBoost 0.2328. What is the relative reduction for NODE, and does the paper report NODE best there?

Answer: the difference is 0.2328−0.2101=0.02270.2328 - 0.2101 = 0.0227. Divide by 0.2328 to get about 0.0975, so about 9.8 percent lower error. Yes, NODE is best on Higgs in Table 2.

Results

With default hyperparameters (one layer of 2048 depth-six trees), NODE beats CatBoost and XGBoost on all six datasets in Table 1. The paper reports ten random seeds per entry.

With tuned hyperparameters (Table 2), NODE is best on Epsilon, YearPrediction and Higgs, and on Click it is ahead of both boosting packages at 0.3312 against 0.3334 for XGBoost and 0.3401 for CatBoost. On Microsoft and Yahoo, tuned XGBoost is better. The authors speculate about the cause, noting XGBoost's large advantage over CatBoost on Yahoo. The deep FCNN baseline beats GBDT on Higgs, at 0.2140, but NODE is better still at 0.2101.

The ablation in Table 3 shows that the choice function matters. On YearPrediction with one layer, softmax gets 78.41, sparsemax 78.13, and entmax 77.43. Gumbel-softmax fails to train deep stacks, with error rising to 80.49 at eight layers on YearPrediction. Entmax beats softmax at every depth tested, and beats sparsemax at one, four and eight layers. At two layers on YearPrediction sparsemax is slightly better (76.81 against 77.05), so the advantage is not uniform.

Limits: all comparisons use six datasets from the paper. The runtime in Table 4 shows that the eight-layer NODE trained in 7 minutes 42 seconds on a single GPU, against 41 seconds for CatBoost on a CPU setup and 5 minutes 39 seconds for XGBoost on a CPU setup. The paper reports that NODE inference is on par with the optimised boosting libraries, even though it is written in plain PyTorch.

Reading guide

Check yourself

QuestionRecall: what makes an oblivious decision tree oblivious?Show answer

Every internal node at the same depth uses the same splitting feature and the same threshold. So a depth-dd tree is a table with 2d2^d entries, indexed by the outcomes of dd fixed tests, rather than a free-form branching tree.

QuestionCompute: a depth-2 soft tree has c1=0.5c_1 = 0.5 and c2=0.5c_2 = 0.5, with leaf responses 0, 4, 8 and 12 in the order 00, 01, 10, 11. What is its output?Show answer

Each leaf chance is 0.250.25 because 0.5×0.5=0.250.5 \times 0.5 = 0.25 for every combination. The output is 0.25×(0+4+8+12)=0.25×24=60.25 \times (0 + 4 + 8 + 12) = 0.25 \times 24 = 6. This equals the average of the four responses, which is what happens when the two questions are fully uncertain.

QuestionWhy does the paper use a sparse normalisation such as entmax instead of softmax for feature choice?Show answer

Softmax gives every feature some weight, so each split depends on many features, which is a poor match for a decision rule that usually depends on one or two. Entmax can give exact zeros, so a split can depend on a small subset. It is still smooth, so gradients flow, which a hard argmax would not allow. The paper's ablation shows entmax with alpha 1.5 beats softmax at every depth and beats sparsemax at most depths, with Gumbel-softmax failing on deep stacks.

QuestionScenario: a team has 50,000 rows of customer data with 40 numeric columns and a 0 or 1 label. They want the best accuracy with a model they can train in under an hour on a single GPU. Would you start with NODE, and what would you check first?Show answer

NODE is a reasonable candidate because the paper shows it is competitive with tuned boosting on tables with more rows and features. Before committing, check the baseline: tune a gradient-boosted model, since the paper's Table 2 shows that tuning changes rankings. Then try NODE with a small configuration from the paper's grid, one or two layers, and compare validation error. Watch the training time, which the paper shows is slower than boosting at its scale.

Sources

Read the full paper

Sergei Popov, Stanislav Morozov, Artem Babenko, 2019. arXiv:1909.06312

NODE paper explained · ungoon.me