الانتقال إلى المحتوى
Machine LearningSupervised Learning· 7 دقائق للقراءة

Why Tree Ensembles Still Beat Deep Learning on Most Tabular Data

On rows and columns, gradient-boosted trees usually match or beat neural networks, with far less tuning.

ReadIn

مقال كل يوم يفرق معاك

22 نوفمبر 2026
  • كاتب موثّق
محتويات المقال

A team has a table of 3,000 customers, 20 columns, and a churn label that follows a few business rules nobody wrote down. They build a neural network first, because that's what powers everything in the news: scaled inputs, early stopping, a hidden layer of 100 units. Cross-validated accuracy settles at 0.871. A colleague hands the same table to HistGradientBoostingClassifier with default settings and gets 0.996 in a few seconds. The scripts below rebuild a table like that synthetically, so you can rerun the whole story.

The common misconception

"Neural networks are the most powerful models we have, so they should be the default for tabular data too." Smart people believe it for good reasons:

  • took over images, audio and text, so it looks like the general-purpose winner.
  • Theory says a large enough network can approximate almost any function, so in principle nothing is out of reach.
  • Papers proposing new tabular networks regularly report beating tree ensembles on their chosen benchmarks.

The half-truth: a network can represent the function. The real question is whether it finds that function from a few thousand rows, with the tuning budget you have. When Shwartz-Ziv and Armon re-tested several deep tabular models against XGBoost, XGBoost did better across their datasets, including the datasets from the deep models' own papers, and it needed much less tuning.

What actually happens

Grinsztajn, Oyallon and Varoquaux (2022) compared tree ensembles (Random Forest, gradient-boosted trees, XGBoost) with four deep architectures (MLP, ResNet, FT-Transformer, SAINT) on 45 datasets, training sets capped at 10,000 rows, with about 20,000 compute hours of random hyperparameter search per model. Trees came out ahead at every search budget. Then the authors asked why, and found that each model's fits tables differently.

Targets in tables are irregular

A tree splits on one column at a time: "tenure under 6 months", "more than 3 support tickets". Its prediction is piecewise constant, a staircase of flat regions. Business targets often jump at thresholds exactly like that. Networks lean toward smooth functions. In the paper, smoothing the training targets hurt the trees badly but barely changed the networks: the real targets were irregular, trees captured the jumps, and networks blurred them.

Most columns don't matter, and networks pay for each one

At every node, a tree picks the column with the best split, so a useless column is rarely chosen. An MLP feeds every input into every first-layer unit, so it has to learn to cancel each useless one. The paper found that removing uninformative columns narrowed the gap between MLP-style networks and the other models, and adding random ones widened it: the same lesson as k-nearest neighbors in "More Features Can Make a Model Worse".

Each column means something on its own

"Age" and "price" mean something by themselves; a mix like 0.3 × age − 0.7 × price usually doesn't. An MLP is rotation-invariant: rotate the inputs and it can learn the same thing. That sounds like a strength, but on tables it means the network has to rediscover that the original columns matter. When the authors randomly rotated their datasets, the ranking reversed and networks came out ahead of trees.

The two scripts below build that churn table: 20 columns, a target made of threshold rules on 3 of them, and 17 columns of noise. Each script scores its model on the original columns and on a random rotation of them.

Python
import numpy as npfrom sklearn.model_selection import cross_val_scorefrom sklearn.neural_network import MLPClassifierfrom sklearn.pipeline import make_pipelinefrom sklearn.preprocessing import StandardScalerrng = np.random.default_rng(0)X = rng.normal(size=(3000, 20))  # 20 columns, only the first 3 mattery = ((X[:, 0] > 0.5) & (X[:, 1] < 0)) | (X[:, 2] > 1.2)  # rule-like targetQ, _ = np.linalg.qr(rng.normal(size=(20, 20)))  # a random rotationnet = make_pipeline(StandardScaler(),  # networks need scaled inputs                    MLPClassifier(early_stopping=True, random_state=0))for name, data in [("original", X), ("rotated", X @ Q)]:    score = cross_val_score(net, data, y, cv=3).mean()    print(f"Network, {name} columns: accuracy {score:.3f}")# Network, original columns: accuracy 0.871# Network, rotated columns: accuracy 0.880

The network scores about the same either way, 0.871 and 0.880: column directions mean nothing special to it. The trees reach 0.996 on the real columns and fall to 0.853 once every column is a blend of all 20. That's the paper's third finding in miniature: the trees win here because they split on one meaningful column at a time.

Less work for an equal or better result

in scikit-learn also asks for less preparation. A split compares values within one column, so scaling changes nothing. HistGradientBoostingClassifier handles missing values natively, takes categorical columns through categorical_features, and turns on early stopping by default above 10,000 samples. Google's decision forests course adds that forests have fewer hyperparameters with good defaults, and train much faster than neural networks on datasets under a million examples.

Where networks still earn their place

Trees aren't a law of nature. In the paper's larger benchmark, with training sets of 50,000 rows, more data narrowed the gap in most cases. Shwartz-Ziv and Armon found that an ensemble of deep models and XGBoost beat XGBoost alone. And when a table sits next to text, images or audio, a network is the natural way to learn from all of it.

QuestionTree ensembleNeural network
PreprocessingNo scaling; native missing values and categoriesScaling, encoding and imputation first
Threshold-like targetsA natural fit: piecewise constantBiased toward smooth functions
Uninformative columnsMostly skipped by split selectionMixed into every first-layer unit
TuningFew hyperparameters, good defaultsArchitecture, learning rate, epochs, and more
Values outside the training rangePredicts flat at the edgeCan follow a trend
Text, images, audioNot the right toolWhere it shines

How to apply it in your project

  1. Start with a tree-ensemble baselineFit HistGradientBoostingClassifier or HistGradientBoostingRegressor on the raw columns with default settings. That score is the every other model must beat.
  2. Check a linear model tooA regularized linear model takes seconds to fit. If it ties the trees, keep the simpler one.
  3. Tune a few knobs, not dozenslearning_rate, max_leaf_nodes, min_samples_leaf and l2_regularization cover most of what tuning buys for gradient boosting.
  4. Try a network when you have a reasonLots of rows, text or image columns, or a need for learned embeddings are good reasons. Use the same cross-validation splits and a comparable tuning budget, or the comparison tells you nothing.
  5. Test the edgesIf future inputs can go beyond the training range, evaluate on the latest period you have, so a flat tree forecast shows up before production does.

Key takeaways

  • On typical tabular data, tree ensembles usually match or beat neural networks; a 45-dataset benchmark found them ahead at every tuning budget.
  • Irregular targets, uninformative columns and meaningful column directions all favor trees.
  • In the scripts, rotating the columns dropped trees from 0.996 to 0.853, while the network stayed near 0.87–0.88.
  • Start with gradient boosting as your baseline; bring in a network for large data, unstructured inputs, or after a fair comparison.

📚 المصادر

  1. Why do tree-based models still outperform deep learning on tabular data? — Grinsztajn, Oyallon, Varoquaux (arXiv)
  2. Tabular Data: Deep Learning is Not All You Need — Shwartz-Ziv, Armon (arXiv)
  3. Ensembles: Gradient boosting, random forests, bagging — scikit-learn User Guide
  4. Decision Trees — scikit-learn User Guide
  5. Decision Forests — Google for Developers

التعليقات (0)