All models

pytorch_widedeep.FTTransformer

Embed every table column, numeric or categorical, then let a plain Transformer and a [CLS] token do the prediction.

Tabular and recommender · 145 operations Checked

100%

Showing the top corner; full diagram not loaded yetShowing a small copy; full diagram not loaded yetLarge diagram, not loaded yet

Open SVG

Loading diagram (22 KB)

Open in a new tab

Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.

At a glance

Parameters
134.2K
Operations
145
Framework
PyTorch
Recurrent
No
Published
NeurIPS 2021
Cited by
437 (as of 17 October 2026)
Authors
Yury Gorishniy, Ivan Rubachev, Valentin Khrulkov, Artem Babenko
License
Apache-2.0
Checked
Passed: the trace was replayed operation by operation and matched the model's own output for this input.

Files

The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.

Details
Stable ID
m8463
Graph hash
3d7444470981338ee46426621ccc7573d85ff411e2e785d0e5e89761225ccac8
Skeleton hash
3c94b319321d3b741d867ec240a04e36ed4e351e5c2255a0f3564aa5ba058810
Architecture hash
a6053403b8f19109c69244b9a7e82d93566f2fa453fc6bd3ab9ef9d9460868de
Diagram SHA-256
70911cf99cf54bc74fd62142ea1dfecc5393948677f381bb1eb8be89b6354989
TorchLens version
2.36.0
Renderer
graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
Check
Forward pass replayed in PyTorch

What it is

About this model's family

FT-Transformer, short for Feature Tokenizer plus Transformer, is a tabular model from the Yandex paper Revisiting Deep Learning Models for Tabular Data. The paper's starting point is that tabular deep learning papers rarely compare properly, so nobody knows which model performs best. Its answer is two reusable baselines, a ResNet-like network and FT-Transformer, with the second described as a simple adaptation of the Transformer architecture that outperforms other solutions on most tasks. The readme's one-sentence version is that MLP-like models are still good baselines and FT-Transformer is a new powerful adaptation of the Transformer for tabular problems.

The model turns every feature, categorical and numerical alike, into an embedding and runs a stack of Transformer layers over them, so each layer attends across the features of one row. The Feature Tokenizer gives each feature its own bias plus a learned mapping, an element-wise multiplication with a weight vector for numbers and a lookup table for categories. A [CLS] token is appended to the feature embeddings before the Transformer layers, and its final representation is passed through LayerNorm, ReLU and a linear layer for the prediction. The layers use the PreNorm variant, with the first normalization removed from the first layer for good performance. The default configuration has 3 layers, a feature embedding size of 192 and 8 attention heads. An ablation shows the feature biases are necessary, and that the vanilla Transformer backbone beats AutoInt, which the authors call the closest competitor in spirit.

Across the benchmark, FT-Transformer gets most of its edge over the ResNet on exactly the datasets where gradient boosted trees beat the ResNet, which the authors read as evidence it is a more universal tabular model. It does not win everything, though. Once hyperparameters are tuned, GBDTs dominate on some datasets, and the paper concludes there is still no universally superior solution. The cost is speed, since the readme notes FT-Transformer is slower than MLP-like models and the paper traces that to the quadratic cost of attention in the number of features. The paper was published at NeurIPS 2021.

Key idea. A Feature Tokenizer that embeds numerical as well as categorical columns with per-feature biases, feeding a vanilla PreNorm Transformer with a [CLS] token, which became a strong and more universal baseline for tabular deep learning.

  • ft-transformer
  • feature tokenizer
  • revisiting deep learning models for tabular data
  • tabular data
  • tabular deep learning
  • gbdt
  • resnet baseline
  • rtdl
  • yandex research
  • autoint
  • pytorch_tabular
  • pytorch-widedeep
  • neurips 2021

AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.

Cite the paper

@misc{gorishniy2023revisitingdeeplearningmodels,
      title={Revisiting Deep Learning Models for Tabular Data}, 
      author={Yury Gorishniy and Ivan Rubachev and Valentin Khrulkov and Artem Babenko},
      year={2023},
      eprint={2106.11959},
      archivePrefix={arXiv},
      primaryClass={cs.LG},
      url={https://arxiv.org/abs/2106.11959}, 
}