
TabTransformer
Tabular and recommender199 ops328.4K params
Transformer layers over categorical column embeddings give tabular models contextual features that rival boosted trees.
Tabular and recommender · 195 operations Checked
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.
The file opened in a new tab. Use your browser's Save command there to keep it.
The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.
About this model's family
TabTransformer is a deep model for tabular data, the rows-and-columns data behind recommender systems and online advertising, built for both supervised and semi-supervised learning. It matters because tree ensembles such as gradient boosted decision trees were the state of the art for tabular data, while plain MLPs did not match them on most datasets. The idea is borrowed from NLP: run Transformer layers over the embeddings of categorical features so that each becomes a contextual embedding informed by the others.
The architecture is a column embedding layer, a stack of N Transformer layers and a multilayer perceptron on top. Only the categorical columns go through the Transformer, and their contextual embeddings are then concatenated with the raw continuous features before the MLP. Each column embedding carries a unique column identifier alongside the value embedding, and there are no positional encodings because table columns have no order. Every embedding table also holds one extra entry for a missing value. For semi-supervised settings the Transformer layers can be pre-trained on unlabeled rows with masked language modeling or replaced token detection, called TabTransformer-MLM and TabTransformer-RTD.
The reported configuration fixes the embedding dimension, layer count and attention heads at 32, 6 and 8. Across 15 datasets it beat the baseline MLP on 14 of them with an average 1.0% AUC gain. Against gradient boosted trees it performed comparably. The paper also argues the contextual embeddings make the model more stable than an MLP when categorical values are noisy or missing. The lucidrains readme sums it up as a simple architecture that came within a hair's breadth of GBDT's performance.
Key idea. Contextual embeddings for categorical features, produced by Transformer layers over column embeddings, which lift tabular deep learning past MLPs and up to tree-ensemble accuracy while supporting unsupervised pre-training on unlabeled rows.
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
@misc{huang2020tabtransformertabulardatamodeling,
title={TabTransformer: Tabular Data Modeling Using Contextual Embeddings},
author={Xin Huang and Ashish Khetan and Milan Cvitkovic and Zohar Karnin},
year={2020},
eprint={2012.06678},
archivePrefix={arXiv},
primaryClass={cs.LG},
url={https://arxiv.org/abs/2012.06678},
}