T AB N ET :
A TTENTIVE I NTERPRETABLE T ABULAR
L EARNING
Anonymous authors
Paper under double-blind review
A BSTRACT
We propose a novel high-performance interpretable deep tabular data learning network, TabNet.
TabNet utilizes a sequential attention mechanism that softly selects features to reason from at each decision step and then aggregates the processed information to make a ﬁnal prediction decision.
By explicitly selecting sparse features, TabNet learns very efﬁciently as the model capacity at each decision step is fully utilized for the most relevant features, resulting in a high performance model.
This sparsity also enables more interpretable decision making through the visualization of feature selection masks.
We demonstrate that TabNet outperforms other neural network and decision tree variants on a wide range of tabular data learning datasets and yields interpretable feature attributions and insights into the global model behavior.
I NTRODUCTION
Deep neural networks have been demonstrated to be very powerful in understanding images (He et al., 2015; Simonyan & Zisserman, 2014; Zagoruyko & Komodakis, 2016), text (Conneau et al., 2016;
Devlin et al., 2018; Lai et al., 2015) and audio (van den Oord et al., 2016; Amodei et al., 2015; Chiu et al., 2018), yielding many important artiﬁcial intelligence use cases.
For these data types, a major enabler of the rapid research and development progress is the availability of canonical neural network architectures to efﬁciently encode the raw data into meaningful representations.
Integrated with simple decision-making layers, these canonical architectures yield high performance on new datasets and related tasks with small extra tuning effort.
For example, consider the image understanding task – variants of convolutional layers with residual connections, e.g. the notable ResNet (He et al., 2015) architecture, can yield reasonably good performance on a new image dataset (e.g. in medical imaging) or a slightly different visual recognition problem (e.g. segmentation).
Our focus in this paper is tabular (structured) data.
Tabular data is indeed the most common data type in the entire addressable artiﬁcial intelligent market (Chui et al., 2018).
Yet, canonical neural network architectures for tabular data understanding have been under-explored.
Instead, variants of ensemble decision trees still dominate data science competitions with tabular data (Kaggle, 2019b).
A primary reason for the popularity of tree-based approaches is their representation power for decision manifolds with approximately hyperplane boundaries that are commonly observed for tabular data.
In addition, decision tree-based approaches are easy to develop and fast to train.
They are highly-interpretable in their basic form (e.g. by tracking decision nodes and edges) and various interpretability techniques have been shown to be effective for their ensemble form, e.g. (Lundberg et al., 2018).
On the other hand, conventional neural network architectures based on stacked convolutional or multilayer perceptrons, may not be the best ﬁt for tabular data decision manifolds due to being vastly overparametrized – the lack of appropriate inductive bias often causes them to fail to ﬁnd robust solutions for tabular decision manifolds (Goodfellow et al., 2016).
We argue here that neural network architectures for tabular data should be redesigned to account for a ‘decision-tree-like’ mapping.
Given the aforementioned beneﬁts and reasonable performances of tree-based methods, why is deep learning worth exploring for tabular data?
One obvious motivation is pushing the performance albeit an increased computational cost, especially with more training data.
In addition, introduction of a high-performance deep neural network architecture unlocks the beneﬁts of gradient descent-based end-to-end deep learning for tabular data.
For example, decision tree learning (even with gradient boosting) does not utilize back-propagation into their inputs to use an error signal to guide efﬁcient learning of complex data types.
On the other hand, with a deep neural network architecture, complex data types like images can be integrated into tabular data efﬁciently.
Another well-known challenge for tree-based methods is learning from streaming data.
Most algorithms for tree learning need global statistical information to select split points and straightforward modiﬁcations such as (Ben-Haim &
Tom-Tov, 2010) typically yield lower accuracy compared to learning from full data at once, yet deep neural networks show great potential for continual learning (Parisi et al., 2018).
Lastly, deep learning models learn meaningful representations which enable new capabilities such as data-efﬁcient domain adaptation (Goodfellow et al., 2016), generative modeling (e.g. using variational autoencoders or generative adversarial networks (Radford et al., 2015) or semi-supervised learning (Dai et al., 2017).
As one example of these potential new capabilities, we demonstrate the potential of semi-supervised learning in the Appendix, showing the potential beneﬁts of information extraction from unlabeled data which non-deep learning models are much weaker at.
[Figure]
In this paper we propose TabNet, a deep neural network architecture to make a signiﬁcant leap forward towards the optimal model design for tabular data learning.
Motivated by the key problems for tabular data discussed above, the design of TabNet has two goals that are often not considered jointly: state-of-the-art performance and interpretability.
With decision tree motivations, TabNet brings sparsity-controlled soft feature selection, but individually for each instance.
Unlike other instance-wise feature selection methods like (Chen et al., 2018) or (Yoon et al., 2019), TabNet employs a single deep learning architecture with end-to-end learning , to map the raw data to the ﬁnal decision with soft feature selection .
The key aspects and contributions of TabNet are:
In order to learn ﬂexible representations and enable ﬂexible integration into end-to-end learning, unlike most tabular data methods, TabNet inputs raw tabular data without any feature preprocessing and is trained using conventional gradient descent-based optimization .
To improve performance and interpretability, TabNet utilizes a sequential attention mechanism to choose which features to reason from at each decision step , as shown in Fig.
We design this feature selection to be instance-wise such that the model can decide which features to focus on separately for each input – e.g., for income classiﬁcation capital gain may be a more important feature to focus on for a middle-aged individual.
Explicit selection of sparse features enables interpretability as well as more efﬁcient learning as the model parameters are fully utilized for the most salient features at the corresponding decision step.
Overall, our careful architecture design leads to two valuable properties for real world tabular learning problems: (1) TabNet outperforms other published tabular data learning models on various datasets for classiﬁcation and regression problems from different domains; and (2) TabNet enables two kinds of interpretability : local interpretability that visualizes the importance of input features and how they are combined, and global interpretability that quantiﬁes the amount of contribution of each input feature to the trained model.
R ELATED W ORK
Feature selection: Feature selection in machine learning broadly refers to the techniques for judicious selection of a subset of features that are useful to build a good predictor for a speciﬁed response variable.
Commonly-used feature selection techniques such as forward feature selection and LASSO regularization (Guyon & Elisseeff, 2003) attribute importance to the features based on the entire training data set, and are referred as global methods.
On the other hand, instance-wise feature selection refers to selection of the most important features, individually and differently for each input.
Instance-wise feature selection was studied in (Chen et al., 2018) by training an explainer model to maximize the mutual information between the selected features and the response variable, and in (Yoon et al., 2019) by using an actor-critic framework to mimic a baseline model while optimizing the feature selection.
(Ma et al., 2018) uses partial variational autoencoder to dynamically decide which piece of information to acquire next sequentially, that can be adapted for instance-wise feature selection.
Unlike these approaches, our proposed method employs soft feature selection with controllable sparsity in end-to-end learning – a single model jointly performs feature selection and output mapping, enabled by the speciﬁc design of the architecture.
Thus, we demonstrate superior performance with very compact representations.
Tree-based learning: Tree-based models are the most common machine learning approaches for tabular data learning.
The prominent strength of tree-based models is their efﬁcacy in picking global features with the most statistical information gain (Grabczewski & Jankowski, 2005).
To improve the performance of standard tree-based models by reducing the model variance, one common approach is ensembling.
Among ensembling methods, random forests (Ho, 1998) use random subsets of data with randomly selected features to grow many trees.
XGBoost (Chen & Guestrin, 2016) and LightGBM (Ke et al., 2017) are the two recent ensemble decision tree approaches that dominate most of the recent data science competitions.
They are based on learning the structures of trees at ﬁrst, and then updating the leaves with the streaming data.
Integration of neural networks into decision trees: One direction to address the limitations of decision trees is integration of neural networks.
Representing decision trees with canonical neural network building blocks, as in (Humbird et al., 2018), yields redundancy in representation and inefﬁcient learning.
Soft (neural) decision trees (Wang et al., 2017; Kontschieder et al., 2015) are proposed with differentiable decision functions, instead of non-differentiable axis aligned splits to construct trees.
Yet, abandoning axis-aligned splits loses the automatic feature selection ability, which is important for learning from tabular data.
In (Yang et al., 2018), a soft binning function is proposed to simulate decision trees in neural networks, which needs to enumerate all possible decisions and is inefﬁcient.
In (Ke et al., 2019), a novel neural network architecture is proposed, with the motivations of explicitly leveraging expressive feature combinations and reducing model complexity.
However, learning is based on transferring knowledge from a gradient boosted decision tree.
Thus, it yields very limited performance improvement compared to it, and interpretability was not considered.
In (Tanno et al., 2018), a deep learning framework is proposed based on adaptively growing the architecture from primitive blocks while representation learning into edges, routing functions and leaf nodes of a decision tree.
Our proposed model TabNet differs from these methods as it embeds the soft feature selection ability into a sequential attention-based network architecture, with controllable sparsity.
Attentive table-to-text models: Table-to-text models extract textual information from tabular data.
Recent works (Liu et al., 2017)
(Bao et al., 2019) propose an architecture based on sequential mechanism for ﬁeld-level attention.
Despite the high-level similarities in the architecture, TabNet aims to perform the ultimate classiﬁcation or regression task considering the entire input features, rather than mapping them to a different data type.
T AB N ET MODEL 3. P RINCIPLES
We initially consider the implementation of a decision tree-like output manifold using conventional neural network building blocks (Fig. 2).
Individual feature selection is the key idea to obtain decision boundaries in hyperplane form, which can be generalized for linear combination of features where constituent coefﬁcients determine the proportion of each feature in the decision boundary.
We aim to generalize this type of tree-like functionality by:
• Utilizing sparse instance-wise feature selection, learned based on the training dataset.
• Constructing a sequential multi-step architecture, where each decision step can contribute to a portion of the decision that is based on the selected features.
• Improving the model capacity by non-linear processing of the selected features.
• Ensembling via higher feature dimension and more decision steps.
3. O VERALL ARCHITECTURE
Fig.
3 depicts the TabNet architecture.
Tabular data inputs are comprised of numerical and categorical features.
We use the raw numerical features and we consider mapping of categorical features with
[Figure]
[Figure]
FC (
[Figure]
Feature
[Figure]
Feature transformer
Mask Attentive transformer + x N steps
Feature transformer
Attentive transformer
Softmax
BN + F C B N G L U F C B N G L U + F C B N G L U 0. + F C B N G L U 0. Shared across decision steps Decision step dependent
Split
Split F C B N S p a r s e m a x +
Prior scales + … (b) Feature transformer Features Feature transformer
Feature transformer Mask Attentive transformer + x N steps Feature transformer Attentive transformer
Softmax
BN + F C B N G L U F C B N G L U + F C B N G L U 0. + F C B N G L U 0. Shared across decision steps Decision step dependent
Split
Split
F C B N
S p a r s e m a x +
Prior scales + … (c
[Figure]
Attentive transformer selection of the most salient features at each decision step.
trainable embeddings 1 .
We do not consider any global normalization of features, but merely apply batch normalization.
We pass the same D -dimensional features f ∈ (cid:60) B × D to each decision step, where B is the batch size.
TabNet is based on sequential multi-step processing, with N steps decision steps.
The i th step inputs the processed information from the ( i − 1) th step to decide which features to use and outputs the processed feature representation to be aggregated into the overall decision.
The idea of top-down attention in sequential form is inspired from its applications in processing visual and language data such as for visual question answering (Hudson & Manning, 2018) or in reinforcement learning (Mott et al., 2019) while searching for a small subset of relevant information in high dimensional input.
Ablation studies in Appendix focus on the impact of various TabNet design choices, explained next.
Overall, the performance is not too sensetitive to most hyperparameters, and guidelines on selection of the important hyperparameters are also provided in Appendix.
Feature selection: We employ a learnable sparse mask M [ i ] ∈ (cid:60) B × D for soft selection of the salient features.
Through sparse selection of the most salient features, the learning capacity of a decision step is not wasted on irrelevant features, and thus the model becomes more parameter efﬁcient.
The masking is in multiplicative form, M [ i ] · f .
We use an attentive transformer (see Fig. 3) to obtain the masks using the processed features from the preceding step, a [ i − 1 ] :
[Equation]
Sparsemax normalization (Martins & Astudillo, 2016) encourages sparsity by mapping the Euclidean projection onto the probabilistic simplex, which is observed to be superior in performance and aligned with the goal of sparse feature selection for most real-world datasets.
Note that Eq.
1 has the normalization property, (cid:80) Dj =1 M [ i ] b , j = 1 .
h i is a trainable function, shown in Fig.
3 using a fully-connected layer, followed by batch normalization.
P [ i ] is the prior scale term, denoting how much a particular feature has been used previously:
[Equation]
where γ is a relaxation parameter – when γ = 1 , a feature is enforced to be used only at one decision step and as γ increases, more ﬂexibility is provided to use a feature at multiple decision steps. P [ 0 ] is initialized as all ones.
To further control the sparsity of the selected features, we propose sparsity regularization in the form of entropy (Grandvalet & Bengio, 2004):
[Equation]
where (cid:15) is a small number for numerical stability.
We add the sparsity regularization to the overall loss, with a coefﬁcient λ sparse .
Sparsity may provide a favorable inductive bias for convergence to higher accuracy for some datasets where most of the input features are redundant.
Feature processing: We process the ﬁltered features using a feature transformer (see Fig. 3) to obtain the features that are split for the decision step output and information for the subsequent step:
[Equation]
where d [ i ] ∈ (cid:60) B × N d and a [ i ] ∈ (cid:60) B × N a .
For parameter-efﬁcient learning and efﬁcient convergence with the high model capacity, a feature transformer should comprise layers that are shared across all decision steps (as the same features are input across different decision steps), as well as decision step-dependent layers.
In Fig.
3, we show the implementation of a block as concatenation of two shared layers and two decision step-dependent layers.
Each fully-connected layer is followed by batch normalization and gated linear unit (GLU) nonlinearity (Dauphin et al., 2016) 2 , eventually connected to a normalized residual connection with normalization.
Normalization with √ 0 .
5 helps to stabilize learning by ensuring that the variance throughout the network does not change dramatically, as discussed in (Gehring et al., 2017).
For faster training, we aim for very large batch sizes in practice.
To improve performance with large batch sizes, all batch normalization operations, except the one applied to the input features, are implemented in ghost batch normalization (Hoffer et al., 2017) form, with a virtual batch size B V and momentum m B .
For the input features, we observe the beneﬁt of low-variance averaging and hence avoid ghost batch normalization.
After the last layer, we split the processed representation into d [ i ] and a [ i ] .
Inspired by decision-tree like aggregation as in Fig.
2, we construct the overall decision embedding as:
[Equation]
Finally, we apply a linear mapping W ﬁnal
d
out , for the ﬁnal decision.
When discrete outputs are required, we additionally employ a softmax function during training (and argmax during inference).
E XPERIMENTS
We evaluate the performance of TabNet in wide range of problems, that contain regression or classiﬁcation tasks.
We speciﬁcally focus on tabular datasets with published benchmarks, based on notable tree-based and neural network-based approaches.
For all datasets, categorical inputs are mapped to a single-dimensional trainable scalar with a learnable embedding 3 and numerical columns are input without and preprocessing.
4 We use standard classiﬁcation (softmax cross entropy) and regression (mean squared error) loss functions and we train until convergence.
Hyperparameters of the TabNet models are optimized on a validation set and listed in Appendix.
TabNet performance is not very sensitive to most hyperparameters as shown with ablation studies in Appendix.
In all of the experiments where we cite results from other papers, we use the same training, validation and testing data split with the original work.
Adam optimization algorithm (Kingma & Ba, 2014) and Glorot uniform initialization are used for training of all models.
4. P ERFORMANCE
Comparison to methods that integrate explicit feature selection.
For this comparison, we consider the 6 synthetic tabular datasets from (Chen et al., 2018).
As the datasets are small (10k training samples), efﬁcient feature selection is crucial for high performance in this task.
The synthetic datasets are constructed in such a way that only a subset of the features determine the output.
For Syn1, Syn and Syn3 datasets, the ‘salient’ features are the same for all instances, so that an accurate global feature selection mechanism should be optimal.
E.g., the ground truth output of the Syn2 dataset only depends on features X 3 - X 6 .
For Syn4, Syn5 and Syn6 datasets, the salient features are instance dependent.
E.g., for Syn4 dataset, X 11 is the indicator, and the ground truth output depends on either
X 1 - X 2 or X 3 - X 6 depending on the value of X 11 .
This instance dependence makes global feature selection suboptimal, as the globally-salient features would be redundant for some instances.
[Table]
Table 1 shows the performance of TabNet vs. other techniques, including no selection, using only globally-salient features, Tree Ensembles (Geurts et al., 2006), LASSO regularization,
L2X
(Chen et al., 2018) and INVASE (Yoon et al., 2019).
We observe that TabNet outperforms all other methods and is on par with INVASE.
For Syn1, Syn2 and Syn3 datasets, we observe that the TabNet performance is very close to global feature selection.
For Syn4, Syn5 and Syn6 datasets, we observe that TabNet improves global feature selection, which would contain redundant features.
(Feature selection is visualized in Sec.
All other methods utilize a predictive model with 43k parameters, and the total number of trainable parameters is 101k for INVASE due to the two other networks in the actor-critic framework.
On the other hand, TabNet is a single neural network architecture, and the total number of parameters is 26k for Syn1-Syn3 datasets and 31k for Syn4-Syn6 datasets.
This compact end-to-end representation is one of TabNet’s valuable properties.
Comparison to models that do not employ explicit feature selection.
We compare TabNet to high-performance tabular data learning models that are demonstrated on the following problems:
• Forest cover type (Dua & Graff, 2017): Classiﬁcation of forest cover type from cartographic variables.
• Poker hand (Dua & Graff, 2017):
Classiﬁcation of the poker hand from the raw input features of suit and rank attributes of the cards.
• Sarcos robotics arm inverse dynamics (Vijayakumar & Schaal, 2000): Regression for inverse dynamics of seven degrees-of-freedom of an anthropomorphic robot arm.
• Higgs boson (Baldi et al., 2014):
Distinguishing between a signal process which produces Higgs bosons and a background process which does not.
Tables ( (cid:63)(cid:63) ), the amount of node hours reﬂects the measure of the count of searched models for the ensemble and their complexity.
6 A single TabNet model, without ﬁne-grained hyperparameter search, can outperform the accuracy of ensemble models with very thorough hyperparameter search.
[Table]
[Table]
Tables 6, 3, 4, and 5 show the performance comparisons.
We observe that TabNet outperforms multi-layer perceptrons and the variants of ensemble decision trees on all four datasets.
TabNet allocates the learning capacity to salient features, and it yields a more compact model in terms of the number of parameters.
When the model size is constrained, we observe the superior performance of
[Table] [Table] TabNet even compared to the decision tree variants.
The performance is only slightly worse than the evolutionary sparsiﬁcation algorithms (Mocanu et al., 2018).
Yet, the sparsity learned in TabNet is structured unlike the alternative approaches – i.e. it does not degrade the operational intensity of the model (Wen et al., 2016) and can efﬁciently utilize modern multi-core processors.
Also note that we do not consider any matrix sparsiﬁcation techniques such as adaptive pruning (Narang et al., 2017) which could further improve the parameter-efﬁciency.
4. I NTERPRETABILITY
The feature selection masks in TabNet can be used to build insights on selected features at each step.
Such capability would not be possible for conventional neural networks with fully-connected layers, as each subsequent layer hidden units would jointly process all features without sparsity-controlled selection mechanism.
For feature selection masks, if M b , j [ i ] = 0 , then j th feature of the b th sample should have 0 contribution to the overall decision.
If f i were a linear function, the coefﬁcient M b , j [ i ] would correspond to the feature importance of f b , j .
Although each decision step employs non-linear processing, their outputs are combined later in a linear way.
Our goal is to quantify an aggregate feature importance beyond analysis of each step as well.
Combination of the masks at different decision steps require a coefﬁcient that can weigh the relative importance of each step in the decision.
We use η b [ i ] = (cid:80) N d c =1 ReLU ( d b , c
[ i ]) to denote the aggregate decision contribution at i th decision step for the b th sample.
Intuitively, d b , c
[ i ] < 0 , then all features at i th decision step should havecontribution to the overall decision and as its value increases, it plays a higher role in the overall linear combination given in Eq. 5.
Scaling the decision mask at each decision step with η b [ i ] , we propose the aggregate feature importance mask as:
[Equation]
Normalization is used to ensure (cid:80)
[Equation]
[Figure] [Figure]
[Figure] [Figure]
Figs. 4 and 5 show the aggregate feature importance masks for the synthetic datasets discussed in Sec.
4.1 (for better illustration here, unlike Sec.
4.1, the models are trained with 10M training samples rather than 10K as we obtain sharper feature selection masks).
The ground truth output of the Syn2 dataset only depends on features X 3 - X 6 , and the ground truth output of the Syn3 dataset only depends on features X 7 - X 10 .
We observe that the aggregate masks are almost all-zero for irrelevant features and they merely focus on relevant ones.
For Syn4 dataset, X 11 is the indicator, and the ground truth output depends on either X 1 - X 2 or X 3 - X 6 depending on the value of X 11 .
For
Syn6 dataset, X 11 is the indicator, and the ground truth output depends on either X 3 - X 6 or X 7 - Xdepending on the value of X 11 .
For both, TabNet yields accurate instance-wise feature selection – it uses majority of the weights in two masks to focus on X 11 , and assigns almost all-zero weights to irrelevant features (the ones other than one of the two feature groups based on the value of X 11 ).
[Figure]
Fig. 6(a) shows the feature importance score of the top feature obtained with TabNet vs. other explainability techniques from (Ibrahim et al., 2019) for mushroom edibility prediction.
Mushroom edibility is a simple pattern recognition problem - TabNet achieves 100% test accuracy.
It is indeed known (Dua & Graff, 2017) that with “Odor” feature only, a model can get > 98 .
5% test accuracy (Dua & Graff, 2017), so a high feature importance is expected for it, as observed with TabNet.
Fig.
6(b) shows the importance ranking of features for TabNet vs. other explainability techniques from (Lundberg et al., 2018)
(Nbviewer, 2019) for Adult Census Income prediction.
TabNet achieves 85.7% test accuracy for this problem.
We observe the commonality of the most important features (“Age”, “Capital gain/loss”, “Education number”, “Relationship”) and the least important features (“Native country”, “Race”, “Gender”, “Work class”).
For the same problem, Fig. 6(c) shows the impact of the most important feature on the output decision by visualizing the T-SNE of the decision manifold.
A clear separation between age groups is observed, underlining the importance of the “Age” feature, as suggested by its high value in the aggregate feature importance mask of TabNet.
C ONCLUSIONS
We propose TabNet, a novel deep learning architecture for tabular learning.
TabNet utilizes a sequential attention mechanism to choose a subset of semantically-meaningful features to process at each decision step.
The selected features are processed to the representation, that contributes to the overall decision output and sends information to the next decision step.
Instance-wise feature selection enables efﬁcient learning as the model capacity is fully used for the most salient features, and also yields more interpretable decision making via visualization of selection masks.
We demonstrate that TabNet outperforms previous work across tabular datasets from different domains.
A S IMPLIFIED DIAGRAM FOR T AB N ET FEEDFORWARD PASS
Features Attentive transformerh 1 ( ) +
Step
BN
Split
Split
ReLU
Split
ReLU
Step
Output
Feature transformerf 1 ( )
FC [" # ," % ," & ]
Mask M[1]
=
Mask M[2]
=
[0,0,1] [(" # , (" % , (" & ] d [)]
d [*]
Attentive transformerh 2 ( )
Feature transformerf 2 ( ) [(" # , (" % , (" & ] [(" # , (" % , (" & ] [(" # ,0,0] [0,0, (" & ] a [,] a [)]
Feature transformerf 0 ( )
B R ESULTS ON A RETAIL DATASET WITH TIME COMPONENT
In this section, we show additional results on a real-world tabular data learning problem - Rossmann store sales forecasting (Kaggle, 2019a).
This dataset has time-dependent features.
Time information is input as day, month, and year columns.
We observe that TabNet outperforms alternative methods that are commonly used for such problems.
[Table]
C E XPERIMENT HYPERPARAMETERS
For all datasets, we start hyperparameter tuning with a pre-deﬁned value space.
N d and
N a are chosen from { 8 , 16 , 24 , 32 , 64 , 128 } , N steps is chosen from { 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 } , γ is chosen from { 1 . 0 , 1 . 2 , 1 . 5 , 2 . 0 } , λ sparse is chosen from { 0 , 0 . 000001 , 0 . 0001 , 0 . 001 , 0 . 01 , 0 . 1 } ,
B is chosen from { 256 , 512 , 1024 , 2048 , 4096 , 8192 , 16384 , 32768 } , B V is chosen from { 256 , 512 , 1024 , 2048 , 4096 } and m B is chosen from { 0 . 6 , 0 . 7 , 0 . 8 , 0 . 9 , 0 .
If the model size is not under the desired cutoff (e.g. for Table 5 comparisons), we decrease the value to satisfy the model size constraint.
All TabNet models use N d = N a = 16 , B = 3000 , B V = 100 , m B = 0 .
For Syn1 we use λ sparse = 0 .
02 , N steps = 4 and γ = 2 . 0 ; for Syn2 and Syn3 we use λ sparse = 0 .
01 , N steps =and γ = 2 . 0 ; and for Syn4, Syn5 and Syn6 we use λ sparse = 0 .
005 , N steps = 5 and γ = 1 . 5 .
Each feature transformer block uses two shared and two decision step-dependent fully-connected layer, ghost batch normalization and GLU blocks.
All models use Adam optimization a learning rate of 0.02 (decayed 0.7 every 200 iterations with an exponential decay) for 4k iterations.
For visualizations in Section 4.2, we also train TabNet models with datasets of size 10M samples.
For this case, we choose N d = N a = 32 , λ sparse = 0 .
001 , B = 10000 , B V = 100 , m B = 0 .
Adam optimization is used with a learning rate of 0.02 (decayed 0.9 every 2k iterations with an exponential decay) for 15k iterations.
For Syn2 and Syn3, N steps = 4 and γ = 2 .
For Syn4 and
Syn6, N steps = 5 and γ = 1 . 5 .
C. F OREST COVER TYPE DATASET
We use the exact same partitioning of the train, evaluation and test datasets with (Mitchell et al., 2018) for a fair comparison.
TabNet model uses N d = N a = 64 , λ sparse = 0 . 0001 , B = 16384 , B V = 512 , m B = 0 .
N steps = 5 and γ = 1 . 5 .
Each feature transformer block uses two shared and two decision stepdependent fully-connected layer, ghost batch normalization and GLU blocks.
Adam optimization is used with a learning rate of 0.02 (decayed 0.95 every 0.5k iterations with an exponential decay) for 130k iterations.
C. P OKER HANDS DATASET
TabNet uses N d = 24 , N a = 8 , λ sparse = 0 .
001 , B = 4096 , B V = 256 , m B = 0 .
8 , N steps =and γ = 1 . 5 .
Each feature transformer block uses two shared and two decision step-dependent fully-connected layer, ghost batch normalization and GLU blocks.
Adam optimization is used with a learning rate of 0.02 (decayed 0.9 every 10k iterations with an exponential decay) for 71k iterations.
C. S ARCOS DATASET
TabNet-S model uses N d = N a = 8 , λ sparse = 0 . 0001 , B = 4096 , B V = 256 , m B = 0 .
N steps = 3 and γ = 1 . 2 .
Each feature transformer block uses one shared and two decision stepdependent fully-connected layer, ghost batch normalization and GLU blocks.
Adam optimization is used with a learning rate of 0.01 (decayed 0.95 every 8k iterations with an exponential decay) for 600k iterations.
TabNet-M model uses N d = N a = 64 , λ sparse = 0 . 0001 , B = 4096 , B V = 128 , m B = 0 . 8 ,
N steps = 7 and γ = 1 . 5 .
Each feature transformer block uses two shared and two decision stepdependent fully-connected layer, ghost batch normalization and GLU blocks.
Adam optimization is used with a learning rate of 0.01 (decayed 0.95 every 8k iterations with an exponential decay) for 600k iterations.
The TabNet-L model uses N d = N a = 128 , λ sparse = 0 . 0001 , B = 4096 , B V = 128 , m B = 0 . 8 ,
N steps = 5 and γ = 1 . 5 .
Each feature transformer block uses two shared and two decision stepdependent fully-connected layer, ghost batch normalization and GLU blocks.
Adam optimization is used with a learning rate of 0.02 (decayed 0.9 every 8k iterations with an exponential decay) for 600k iterations.
C. H IGGS DATASET
TabNet-S model uses N d = 24 , N a = 26 , λ sparse = 0 . 000001 , B = 16384 , B V = 512 , m B = 0 . 6 ,
N steps = 5 and γ = 1 . 5 .
Each feature transformer block uses two shared and two decision stepdependent fully-connected layer, ghost batch normalization and GLU blocks.
Adam optimization is used with a learning rate of 0.02 (decayed 0.9 every 20k iterations with an exponential decay) for 870k iterations.
TabNet-M model uses N d = 96 , N a = 32 , λ sparse = 0 . 000001 , B =
For gradient boosted trees, we use the implementation (Tensorﬂow, 2019).
We choose the learning rate of 0.1 and optimize the maximum depth to 8, based on the performance.
The Gradient boosted tree-S model uses 50 trees, the Gradient boosted tree-M model uses 300 trees and the Gradient boosted tree-L model uses 3000 trees.
C. M USHROOM EDIBILITY DATASET
TabNet model uses N d = N a = 8 , λ sparse = 0 .
001 , B = 2048 , B V = 128 , m B = 0 .
9 , N steps =and γ = 1 . 5 .
Each feature transformer block uses two shared and two decision step-dependent fully-connected layer, ghost batch normalization and GLU blocks.
Adam optimization is used with a learning rate of 0.01 (decayed 0.8 every 400 iterations with an exponential decay) for 10k iterations.
C. A DULT CENSUS INCOME DATASET
TabNet model uses N d = N a = 16 , λ sparse = 0 . 0001 , B = 4096 , B V = 128 , m B = 0 .
N steps = 5 and γ = 1 . 5 .
Each feature transformer block uses two shared and two decision stepdependent layer, ghost batch normalization and GLU blocks.
Adam optimization is used with a learning rate of 0.02 (decayed 0.4 every 2.5k iterations with an exponential decay) for 7.7k iterations.
When only 40 labeled examples are used instead of the full dataset, based on re-optimization of hyperparameters on the validation set, we modify B = 128 , λ sparse = 0 .
01 and the learning rate of 0.005 (decayed 0.95 every 10 iterations with an exponential decay) for 100 iterations. C. R OSSMANN DATASET
TabNet model uses N d = N a = 32 , λ sparse = 0 .
001 , B = 4096 , B V = 512 , m B = 0 . N steps = 5 and γ = 1 . 2 . Each feature transformer block uses two shared and two decision stepdependent fully-connected layer, ghost batch normalization and GLU blocks. Adam optimization is used with
a learning rate of 0.002 (decayed 0.95 every 2000 iterations with an exponential decay) for 15k iterations.
D G UIDELINES FOR HYPERPARAMETER SELECTION
We consider datasets ranging from ∼ 10K to ∼ 10M training points, with varying degrees of ﬁtting difﬁculty.
TabNet obtains high performance for all with a few general principles on hyperparameter selection:
• Most datasets yield the best results for N steps ∈ [3 , 10] .
Typically, we observe that when there are more information-bearing features, the optimal value of N steps tends to be higher.
On the other hand, increasing it beyond some value may adversely affect training dynamics as some paths in the network becomes deeper and there are more potentially-problematic ill-conditioned matrices.
A very high value of N steps typically suffers from overﬁtting and yields poor generalization.
• Adjustment of the values of N d and N a is the most efﬁcient way of obtaining a trade-off between performance and complexity.
N d = N a is a reasonable choice for most datasets.
A very high value of N d and N a may suffer from overﬁtting and yield poor generalization.
• An optimal choice of γ can have a major role on the overall performance.
Typically a larger N steps value favors for a larger γ .
• A large batch size is beneﬁcial for performance - if the memory constraints permit, as large as 1-10 % of the total training dataset size is suggested.
The virtual batch size is typically much smaller than the batch size.
• Initially large learning rate is important, which should be gradually decayed until convergence.
When the model size is constrained, the hyperparameter search becomes more complicated.
Because the optimal ways to increase the representation capacity may be chosen among different options, such as increasing the number of steps or the unit size.
For example, increasing the number of units while slightly decreasing the step size can be a better way of optimal utilization of the limited capacity constrained by the size on the number of parameters.
E A BLATION STUDIES
In Table 7, we show the impact of various design and hyperparameter choices.
For all cases, the number of iterations is optimized on the validation set.
[Table]
Base ( N d = N a = 64 , γ = 1 . 5 , N steps = 5 , λ sparse = 0 . 0001 , feature transformer block composed of two shared and two decision step-dependent layers,
B = 16384 )
[Table]
99 (0) 470k
Decreasing capacity via number of units (with N d = N a = 32 ) 94.99 (-2.00) 129k
Decreasing capacity via number of decision steps (with
N steps = 3 ) 96.22 (-0.77) 328k
Increasing capacity via number of decision steps (with
N steps = 9 ) 95.48 (-1.51) 755k
Decreasing capacity via all-shared feature transformer blocks 96.74 (-0.25) 143k
Increasing capacity via decision step-dependent feature transformer blocks 96.76 (-0.23) 703k
Replacing feature transformer block with a single shared layer 95.32 (-1.67) 35k Replacing feature transformer block with a single shared layer, with ReLU instead of GLU 93.92 (-3.07) 27k Replacing feature transformer block with two shared layers 96.34 (-0.66) 71k Replacing feature transformer block with two shared layers and 1 decision step-dependent layer 96.54 (-0.45) 271k
Replacing feature transformer block with a single decision-step dependent layer 94.71 (-0.28) 105k Replacing feature transformer block with a single decision-step dependent layer, with N d = N a =96.24 (-0.75) 208k Replacing feature transformer block with a single decision-step dependent layer, with N d = N a = 128 and replacing GLU with ReLU 95.67 (- [Table]
32) 139k
Replacing feature transformer block with a single decision-step dependent layer, with N d = N a = 256 and replacing GLU with ReLU 96.
[Table]
278k
Reducing the impact of prior scale (with γ = 3 . 0 ) 96.49 (
[Table]
[Table] 470k Increasing the impact of prior scale (with γ = 1 . 0 ) 96.
[Table]
[Table]
470k
No sparsity regularization (with λ sparse = 0 ) 96.
[Table]
) 470k
High sparsity regularization (with λ sparse = 0 .
[Table]
12) 470k
Small batch size ( B = 4096 ) 96.42 (
[Table]
57) 470k
Obtaining high performance necessitates appropriately-adjusted model capacity based on the characteristics of the dataset.
Decreasing the number of units N d , N a or the number of decision steps
N steps are efﬁcient ways of gradually decreasing the capacity without signiﬁcant degradation in performance.
On the other hand, increasing these parameters beyond some value causes optimization issues and do not yield performance beneﬁts.
Replacing the feature transformer block with a very simpler alternative, such as a single shared layer, can still give strong performance while yielding a very compact model architecture.
This shows the importance of the inductive bias introduced with feature selection and sequential attention.
To push for the performance further, increasing the depth of the feature transformer is the effective approach.
While increasing the depth, parameter sharing between feature transformer blocks across different decisions is an efﬁcient way to decrease model size without signiﬁcant degradation from performance.
We indeed observe the beneﬁt of partial parameter sharing, compared to fully decision step-dependent blocks or fully shared blocks.
We observe the empirical beneﬁt of GLU, compared to conventional nonlinearities like ReLU.
The strength of sparse feature selection depends on the two parameters we introduce: γ and λ sparse .
We show that optimal choice of these two is important for performance.
A γ close to 1, or a high λ sparse may yield too tight constraints on the strength of sparsity and may hurt performance.
On the other hand, there is still the beneﬁt of a sufﬁcient low γ and sufﬁciently high λ sparse , to aid learning of the model via a favorable inductive bias.
Lastly, given the ﬁxed model architecture, we show the beneﬁt of large-batch training, enabled by ghost batch normalization (Hoffer et al., 2017).
The optimal batch size for TabNet seems considerably higher than the conventional batch sizes used for other data types, such as images or speech.
F M IXUP TRAINING
In (Zhang et al., 2017), mixup training was shown to be beneﬁcial for tabular data learning, on small-scale datasets with simple neural network models comprising fully-connected layers.
We experiment mixup training with TabNet and did not observe superior performance compared to standard softmax training.
For Covertype dataset, the best mixup model (for mixup parameter α =0.3) yields a test accuracy of 96.28%, roughly 0.7% lower than softmax training.
For Higgs dataset, for the best TabNet-S model, the best mixup model (for mixup parameter α =0.1) yields a test accuracy of 78.11%, roughly 0.1% lower than softmax training.
We hypothesize that linearization of the inputs may cause signiﬁcant shifts in the input distribution and thus adversely affect the feature selection blocks of TabNet.
G S EMI - SUPERVISED LEARNING
[Figure] We explore the capability of TabNet in learning semantically-meaningful representations by integrating it into an autoencoder framework (Baldi, 2012).
For this purpose, we propose a simple decoder architecture, shown in Fig. 8.
The decoder is composed of a feature transformer block (as given in Fig. 3), followed by a fully-connected layer at each decision step.
Different decision steps are summed to output the reconstructed features.
We propose an additive reconstruction loss (with a coefﬁcient λ unsup ) between the input features X and the reconstructed features ˆ X .
The reconstruction loss (computed over unlabeled data batch of size B U ) is in the form of L2 loss, normalized with the population standard deviation of the ground truth data, and scaled by S :
[Equation]
Normalization with the input value is observed to be crucial, as the tabular data features may have very different ranges.
A straightforward approach in conventional reconstruction loss is scaling with a uniform mask, S b , j = 1 /D .
As a more promising alternative, we propose that scaling should be based on feature importance values, such that the autoencoder should prioritize learning the representation for features that are the most important for decision making.
We use the feature important mask
S b , j = M (cid:48)
agg − b , j / (cid:80)
Dj =1 M (cid:48)
agg − b , j to promote learning for the most salient features.
M (cid:48) agg is inferred from the TabNet for the batch of unlabeled training samples, and ﬁxed in the computation of loss to avoid the trivial solutions of ﬁtting the easiest features.
For semi-supervised learning experiments, we consider the Adult Census Income dataset.
We randomly choose 50 samples as the labeled set.
We ﬁx the TabNet model with the aferomentioned hyperparameters.
As the original learning hyperparameters overﬁt very quickly for 50 samples, we reoptimize the learning rate to 0.01 (decayed 0.9 every 100 iterations with an exponential decay) and trained for 800 iterations.
For the autoencoder, we also ﬁx the TabNet architecture, and optimize the decoder and learning hyperparameters.
We use a decoder architecture with N d = N a = 16 ,
B = 128 , and m B = 0 .
We use an unlabeled batch size of B U = 2048 .
The model with uniform masking uses λ unsup = 0 .
2 , λ sparse = 0 .
005 , the number of decoder steps of N steps = 6 and a learning rate of 0.005 (decayed 0.95 every 4k iterations with an exponential decay) and trained for 20.6k iterations.
The model with feature importance mask uses λ unsup = 0 .
1 , λ sparse = 0 .
005 , the number of decoder steps of N steps = 4 and a learning rate of 0.01 (decayed 0.9 every 10k iterations with an exponential decay) and trained for 63k iterations.
Since feature importance masking focuses on reconstructing the most salient features, the learning capacity of the optimal decoder is lower
[Table]
Table 8 shows the semi-supervised learning performance, along with the two supervised learning benchmarks: when trained without additional unlabeled data and when trained after labeling the entire dataset.
We observe a signiﬁcant boost in performance with the contributions from the unlabeled data, closing the gap towards the supervised learning baseline of the entire dataset.
Focusing on the most important features in autoencoding helps improving the semi-supervised learning performance.