Abstract
Supervised learning with tabular data presents unique challenges, including low data sizes, the absence of structural cues, and heterogeneous features spanning both categorical and continuous domains. Unlike vision and language tasks, where models can exploit inductive biases in the data, tabular data lacks inherent positional structure, hindering the effectiveness of self-attention mechanisms. While recent transformer-based models like TabTransformer, SAINT, and FT-Transformer (3T) have shown promise, they typically operate without leveraging structural cues such as positional encodings (PEs), as no prior structural information is usually available. In this work, we find both theoretically and empirically that structural cues, specifically PEs, can be a useful tool to improve generalization performance for tabular transformers. We find that PEs impart the ability to reduce the effective rank (a form of intrinsic dimensionality) of the features, effectively simplifying the task by reducing the dimensionality of the problem, yielding improved generalization. To that end, we propose Tab-PET (PEs for Tabular Transformers), a graph-based framework for estimating and inculcating PEs into embeddings. We empirically demonstrate that graph-derived PEs significantly improve performance across 50 classification and regression datasets for 3T. Our work highlights an unexpected role of PEs in tabular transformers, revealing how they can be harnessed to improve generalization.
Introduction
Deep learning has revolutionized vision and language by exploiting inherent data structures, such as the spatial locality of pixels or the sequential order of words. Tabular data, however, lacks a natural ordering. Features are often heterogeneous, and datasets are frequently small. Because tabular features are essentially unordered, standard Transformers treat them as "exchangeable" tokens.
While models like FT-Transformer and SAINT have shown promise, the prevailing consensus has been that positional encodings (PEs) are unnecessary for tabular data because there is no inherent "position" to encode. Tab-PET challenges this notion, arguing that even if features lack a sequence, they possess a relational structure that can be harnessed to improve generalization.
The Tab-PET Framework
The authors propose a four-step framework to inject structural inductive biases into tabular Transformers:
- Data Preparation: Continuous features are standardized, and categorical features are one-hot encoded.
- Graph Estimation: Features are treated as nodes in a graph. Relationships are estimated using either causality-based algorithms (e.g., LiNGAM) or association-based methods (e.g., Spearman correlation).
- PE Creation: The framework computes the Graph Laplacian of the feature graph and extracts its eigenvectors. These eigenvectors capture the topology of the feature space. The top-$k$ and bottom-$k$ eigenvectors are selected to form the PEs.
- Integration: These fixed PEs are scaled by a hyperparameter ($\alpha$) and concatenated to the standard feature embeddings before being processed by the Transformer layers.
Key Insights: Regularization through Rank Reduction
A core theoretical and empirical contribution of this work is the discovery that PEs act as a form of structural regularization. By adding these PEs, the model reduces the "effective rank" (intrinsic dimensionality) of its internal representations. This effectively simplifies the optimization problem and prevents the model from overcomplicating the relationships between features, which is particularly beneficial in low-data regimes.
Furthermore, the study found that dense association-based graphs (specifically those using Spearman correlation) yielded more stable and pronounced performance gains than sparse causal graphs. Dense graphs provide a richer signal for the Transformer's attention mechanism. Additionally, using fixed PEs derived from the data's statistical structure proved more effective than trying to learn PEs from scratch, which often leads to overfitting in tabular tasks.
Experimental Results
Tab-PET was evaluated on 50 OpenML datasets, covering a balanced mix of classification and regression tasks. Key findings include:
- State-of-the-Art Performance: Tab-PET variants of FT-Transformer and SAINT became the top-performing models, outperforming baseline Transformers and state-of-the-art Gradient Boosted Decision Trees (GBDTs) like XGBoost and CatBoost.
- Consistent Improvements: Spearman-based PEs provided an average improvement of 1.72% in classification and 4.34% in regression across all 50 datasets.
- Efficiency: Spearman-based graph estimation is computationally inexpensive, typically adding less than a minute of overhead to the training pipeline.
Conclusion and Future Work
Tab-PET demonstrates that positional encodings are a powerful tool for tabular Transformers, not by providing spatial coordinates, but by enforcing structural regularization. While the method is highly effective, it remains sensitive to the scaling factor $\alpha$, which requires validation tuning. Future research may explore adaptive methods to automatically select the optimal number of eigenvectors and scaling factors, as well as scaling these graph-based approaches to datasets with extremely high feature dimensionality.
Summary updated