All models

FTTransformer-rtdl

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

Tabular and recommender · 124 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 (15 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
895.5K
Operations
124
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
m972
Graph hash
1c83f18aba078b88d1c017b7ceb81bc6eaf1d0b87fddbfe9d895d1668cd52a71
Skeleton hash
3162bbf899342fa50e9958e68b8f0dad4c9e41d5040a05d42331461b4f9b0a51
Architecture hash
821284525a2bc7b1967cc090128e98d3e2bf0396b1036020c655784c33321c31
Diagram SHA-256
21cc848543e5f58907db9db07b0e5d30a16f656910513517eb89394fb7f62f2c
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}, 
}