Gradient boosting has owned tabular data for a decade. The deep-learning community has repeatedly tried to change that: TabNet in 2019, NODE in 2020, FT-Transformer in 2021, SAINT in 2022.

On public benchmarks like the adult census dataset, these models sometimes edge out XGBoost. On market data, in every honest test I have run, they do not. This article explains why, implements the two worth knowing, and shows the narrow conditions where a deep tabular model becomes competitive.

Quick answer

  • TabNet uses sequential attention to select features per row. Interpretable, slow, and rarely beats XGBoost on noisy financial data.
  • FT-Transformer tokenises each feature and attends across them. Strong on large clean tabular sets; overfits small market sets.
  • Plain MLP is the honest baseline people skip. It is closer to XGBoost than the fancier options.
  • Gradient boosting wins because it encodes the right inductive bias: axis-aligned splits on a small number of features.
  • When deep tabular wins: huge datasets (>500k rows), many categorical interactions, and multi-task heads.

Why trees keep winning

The argument is structural, not tribal.

1. Axis-aligned splits fit the data-generating process

Market features are ratios, z-scores, deltas. Their effect on the target is often monotone within a region and changes at a threshold: "when VIX z > 1.5, momentum flips". A decision tree represents that with one split. An MLP must approximate the step function with many sigmoid units.

2. Trees are invariant to monotone transforms

Feed XGBoost log(volume) or volume; the splits are equivalent. Feed that to an MLP and the optimisation changes. Financial features are full of heavy tails, and trees are immune to the transform you did not have time to tune.

3. Trees handle irrelevant features gracefully

Add 200 noise columns. XGBoost ignores most of them. A deep net's capacity gets partly allocated to fitting the noise. In trading, most candidate features are noise, so this matters a lot.

4. The signal is weak and the data is small

A 50k-row dataset with a 2% edge cannot support a 1M-parameter model. The bias-variance tradeoff is decisive, and boosting sits on the right side of it.

TabNet: the interpretable one

The idea

TabNet processes features through a sequence of decision steps. At each step, an attentive transformer produces a mask over features, selecting a sparse subset. The selected features feed a small MLP whose output contributes to the final prediction. Sparsity is enforced with an entropy penalty.

Two selling points:

  1. Instance-level feature selection — you can see which features each row used.
  2. No feature preprocessing — it handles raw numerics.

Implementation

# pip install pytorch-tabnet from pytorch_tabnet.tab_model import TabNetClassifier import numpy as np clf = TabNetClassifier( n_d=32, n_a=32, # decision / attention embedding dims n_steps=4, # sequential decision steps gamma=1.4, # sparsity control n_independent=2, n_shared=2, momentum=0.02, lambda_sparse=1e-4, optimizer_params=dict(lr=2e-3), scheduler_params=dict(step_size=10, gamma=0.9), verbose=0, seed=42, ) clf.fit( X_train, y_train, eval_set=[(X_valid, y_valid)], eval_metric=["auc"], max_epochs=200, patience=30, batch_size=1024, virtual_batch_size=128, ) p = clf.predict_proba(X_test)[:, 1] 

Honest verdict

Metric TabNet XGBoost
AUC (1-step dir.) 0.522 0.550
Fit time, 6 folds 14 min 40 s
Feature mask stability across folds low n/a

TabNet's masks are interesting to look at, but unstable: the same feature gets selected in one fold and ignored in the next. That instability is a symptom of the underlying signal being weak, not a bug in TabNet. When the data does not have a strong sparse feature subset, the attention mechanism is fitting noise.

In one test it did something genuinely useful: it identified an interaction between dte_bucket and iv_rank that a linear model missed and that XGBoost only found at depth 5. But the AUC lift was +0.004 — inside the fold noise. Not worth a 20x runtime increase.

FT-Transformer: the attention one

The idea

Each feature is embedded into a d-dimensional vector, a [CLS] token is prepended, and a standard Transformer encoder attends across features. The [CLS] output feeds a classification head.

This is the tabular analogue of BERT, and it works well on large, clean datasets.

Implementation sketch

import torch import torch.nn as nn class FTTransformer(nn.Module): def __init__(self, n_features, d=64, n_heads=8, n_layers=3, dropout=0.1): super().__init__() self.embed = nn.Parameter(torch.randn(n_features, d) * 0.02) self.cls = nn.Parameter(torch.randn(1, 1, d) * 0.02) layer = nn.TransformerEncoderLayer( d, n_heads, d * 4, dropout, batch_first=True, activation="gelu") self.encoder = nn.TransformerEncoder(layer, n_layers) self.head = nn.Sequential(nn.LayerNorm(d), nn.Linear(d, 1)) self.drop = nn.Dropout(dropout) def forward(self, x): # x: [B, F] numeric -> project each feature to d, add its embedding tokens = x.unsqueeze(-1) * self.embed.unsqueeze(0) # [B, F, d] tokens = self.drop(tokens) tokens = torch.cat([self.cls.expand(x.size(0), -1, -1), tokens], dim=1) h = self.encoder(tokens) return self.head(h[:, 0]).squeeze(-1) 

The x.unsqueeze(-1) * embed trick is a scalar-times-vector projection. In the paper each feature gets its own linear layer; the shared version above is a cheaper approximation that works on small data.

Honest verdict

Dataset size FT-Transformer XGBoost
5k rows 0.508 0.545
50k rows 0.531 0.550
500k rows 0.556 0.552

The crossover is real but far away. You need hundreds of thousands of rows and a genuinely rich feature set before attention over features pays. Most retail trading datasets are two orders of magnitude smaller.

The plain MLP: the baseline nobody runs

Before TabNet or FT-Transformer, run a 2-layer MLP. It is often within 0.01 AUC of both, at 1% of the complexity.

import torch.nn as nn mlp = nn.Sequential( nn.Linear(n_features, 128), nn.GELU(), nn.Dropout(0.3), nn.Linear(128, 64), nn.GELU(), nn.Dropout(0.3), nn.Linear(64, 1), ) 

Three things make an MLP competitive with trees on tabular data:

  1. Feature normalisation — standardise, and clip outliers at ±3σ.
  2. Aggressive dropout — 0.3–0.5 on market data, not 0.1.
  3. Weight decay + early stopping — the regularisation is doing the work the tree does structurally.

Even with all three, in my runs the MLP lands at 0.535 vs XGBoost's 0.550. Closer than TabNet, but still behind, and with far more hyperparameters to get wrong.

A quick note on library ergonomics

Practical experience with these libraries matters more than the papers. A few notes that save days:

  • TabNet silently ignores eval_set unless you also pass eval_name, and its early stopping is on the validation metric you specify — check which one.
  • FT-Transformer reference implementations vary widely. Some normalise features inside the model, some outside; mixing them double-normalises and quietly degrades accuracy.
  • Seed variance is large. Run three seeds minimum before concluding that one model beat another; a single-seed 0.004 AUC gap is meaningless.

The one setup where deep tabular wins

Multi-task learning

If you want to predict several related targets at once — direction, magnitude, and volatility regime — a shared trunk with multiple heads is genuinely better than three separate XGBoost models, because the tasks regularise each other.

class MultiTaskNet(nn.Module): def __init__(self, n_features, hidden=128): super().__init__() self.trunk = nn.Sequential( nn.Linear(n_features, hidden), nn.GELU(), nn.Dropout(0.3), nn.Linear(hidden, hidden // 2), nn.GELU(), ) self.dir_head = nn.Linear(hidden // 2, 1) self.mag_head = nn.Linear(hidden // 2, 1) self.vol_head = nn.Linear(hidden // 2, 3) def forward(self, x): h = self.trunk(x) return self.dir_head(h), self.mag_head(h), self.vol_head(h) 

Loss:

loss = (bce(dir_logit, y_dir) + 0.3 * huber(mag, y_mag) + 0.2 * cross_entropy(vol_logit, y_vol)) 

The weights matter. Direction is the primary task; the others are auxiliary. In one test this improved direction AUC from 0.541 (single-task MLP) to 0.549 — matching XGBoost, with the bonus of calibrated magnitude and regime outputs.

Very large datasets

Above ~500k rows with many categorical interactions, FT-Transformer and even TabNet start to earn their runtime. That is real, but it is not the regime most traders operate in.

Entity embeddings for high-cardinality categoricals

If you have 1,000 symbols or 500 strike levels, learned embeddings can beat one-hot and beat target encoding (which leaks). CatBoost's ordered statistics are the safer alternative, but embeddings are a legitimate reason to reach for a neural net.

A fair benchmark protocol

If you want to settle this on your own data, run this exact protocol:

1. Same purged walk-forward folds for every model. 2. Same features, same scaler fit on train only. 3. Same calibration method (Platt on validation). 4. Report: AUC, directional accuracy, net P&L after costs, fit time. 5. Report fold-level std, not just the mean. 

The last point is the one people skip. If XGBoost scores 0.550 ± 0.030 and FT-Transformer scores 0.556 ± 0.045, the Transformer has not won. It has produced a noisier estimate.

Model AUC mean AUC std Net P&L Time
Logistic 0.510 0.012 +1.2% 5 s
MLP (2-layer) 0.535 0.026 +3.1% 6 min
TabNet 0.522 0.031 +1.9% 14 min
FT-Transformer 0.531 0.038 +2.4% 21 min
XGBoost 0.550 0.022 +6.8% 40 s

Read the std column. The deep models have both a lower mean and a higher variance — worse on both axes. That is the whole story.

Why the papers disagree

A reasonable objection: the FT-Transformer paper reports wins over XGBoost on many datasets. Why the gap?

  1. Dataset size. The paper's benchmarks include datasets with 500k+ rows. At that scale the crossover is real.
  2. Tuning budget. The paper tunes the Transformer heavily and uses reasonable boosting defaults. Reverse the budget and the ranking flips.
  3. Clean features. Benchmark tabular data has well-behaved features. Market features are heavy-tailed, collinear, and often leak-contaminated.
  4. Metric. Accuracy on balanced classes is not net P&L after costs on imbalanced, drifting data.

None of this makes the papers wrong. It makes them inapplicable to the median trading dataset. The lesson is to check whether a paper's regime matches yours before adopting its conclusion.

Failure modes

  1. No feature scaling. MLPs and TabNet are sensitive; trees are not. Forgetting this alone can cost 0.03 AUC.
  2. Dropout too low. 0.1 is a vision default. Market tabular data needs 0.3+.
  3. No early stopping. Deep tabular models overfit within 20 epochs on 50k rows.
  4. Judging interpretability by masks. TabNet masks are unstable across folds; do not build a thesis on them.
  5. Comparing a tuned net to default XGBoost. Tune both or neither.

FAQ

Q: Is TabNet better than XGBoost?
On most market datasets, no. It is competitive on large, clean tabular data and useful when you need instance-level feature attribution that is stable — which, on noisy data, it usually is not.

Q: When should I use FT-Transformer?
Above ~500k rows with rich feature interactions, or when you need a shared trunk for multi-task learning. Below that, tune XGBoost instead.

Q: Why does my MLP beat XGBoost by 0.04 AUC?
Check for leakage in feature scaling, fold construction, or early stopping on the test set. A 0.04 gap over a well-tuned tree on tabular market data is a red flag, not a result.

Q: Can embeddings replace target encoding?
Yes, and more safely. Learned embeddings do not see the label directly, so they avoid the target-leakage trap that hand-built target encoding creates.

Q: Are deep tabular models worth learning?
Yes, as a tool for multi-task and high-cardinality problems. Not as a replacement for boosting on a 50k-row price-direction task.

The takeaway

Deep tabular models are not worse algorithms. They are algorithms for a different regime: large, clean, interaction-rich datasets. Market data is small, noisy, and drift-prone, which is gradient boosting's home turf.

Run the MLP baseline, run the tree, and only reach for TabNet or FT-Transformer when you have a specific reason — scale, multi-task structure, or high-cardinality categoricals. The fanciest model in the room is rarely the one that makes money.

About the author

Shakti Tiwari is an AI/ML builder, author and NISM-Series-XII certified options educator, and the founder of Option Trading with AI (optiontradingwithai.in). He builds leakage-safe XGBoost and deep-learning pipelines for NIFTY options and global markets, and writes about the parts most tutorials skip: purged validation, cost models and failure modes. Books: Option Trading with AI and The AI Opportunity.

Educational research only. Not investment advice. Shakti Tiwari is NISM-Series-XII certified as an educator, not a SEBI-registered Research Analyst or Investment Adviser. Trading carries substantial risk of loss.