# FT-Transformer (2021)

> Tested deep tabular models under one tuning protocol and found that a plain Transformer over per-feature embeddings beat the rest.

Page: https://mralbu.github.io/ai-datasets/p/ft-transformer

## Key facts

- Title: Revisiting Deep Learning Models for Tabular Data
- Authors: Yury Gorishniy, Ivan Rubachev, Valentin Khrulkov, Artem Babenko
- Venue: NeurIPS 2021
- Category: Tabular
- Paper: https://www.alphaxiv.org/abs/2106.11959

## Why it matters

Papers on deep tabular models each used their own datasets and protocols, so their claims could not be compared. This one gave the field a common yardstick, two strong baselines and the Transformer design that later tabular networks started from, while stating plainly that gradient-boosted trees were not beaten.

## The idea

Turn every column into its own token: a numerical value multiplies a learned vector and adds a learned bias, a categorical value looks up an embedding. Add a [CLS] token, run a standard Transformer over the tokens, and predict from the [CLS] output. Compare it, a ResNet-style MLP, six published tabular networks and two boosted-tree libraries on the same 11 datasets, with the same splits and the same hyperparameter search for every model.

## The result

FT-Transformer had the best average rank among nine deep models (1.8, against 3.3 for the ResNet), and the simple ResNet beat every earlier tabular network, TabNet included, on average. Against ensembles of tuned XGBoost and CatBoost there was no clear winner: the trees still won on California Housing, Adult and Yahoo, while FT-Transformer won on datasets such as Covertype and Jannis.

## The data

- [Tabular Benchmark (Grinsztajn et al.) (2022)](https://mralbu.github.io/ai-datasets/d/tabular-benchmark.md): 45 real-world tables, curated so that trees and neural networks could finally be compared on the same ground.
- [OpenML-CC18 (2018)](https://mralbu.github.io/ai-datasets/d/openml-cc18.md): 72 classification datasets hand-picked from OpenML, each with fixed cross-validation splits, so any classifier can be run on all of them with a few lines of code.

## Builds on

- [Transformer (2017)](https://mralbu.github.io/ai-datasets/p/transformer.md)
- [TabNet (2019)](https://mralbu.github.io/ai-datasets/p/tabnet.md)
- [XGBoost (2016)](https://mralbu.github.io/ai-datasets/p/xgboost.md)

## Led to

- [Trees vs deep learning (2022)](https://mralbu.github.io/ai-datasets/p/grinsztajn-2022.md)

## Part of

- [Tabular foundation models](https://mralbu.github.io/ai-datasets/t/tabular-foundation-models.md) (step 3 of 8)
