Abstract
The transferability of deep neural networks (DNNs) has made significant progress in image and language processing. However, due to the heterogeneity among tables, such DNN bonus is still far from being well exploited on tabular data prediction. Condensing knowledge from diverse domains, language models (LMs) possess the capability to comprehend feature names from various tables, potentially serving as versatile learners in transferring knowledge across distinct tables and diverse prediction tasks, but their discrete text representation space is inherently incompatible with numerical feature values in tables. In this paper, we present TP-BERTa, a specifically pre-trained LM for tabular data prediction. Concretely, a novel relative magnitude tokenization converts scalar numerical feature values to finely discrete, high-dimensional tokens, and an intra-feature attention approach integrates feature values with the corresponding feature names. Comprehensive experiments demonstrate that our pre-trained TP-BERTa leads the performance among tabular DNNs and is competitive with Gradient Boosted Decision Tree models in typical tabular data regime.
Introduction
Deep Neural Networks (DNNs) have revolutionized fields like computer vision and natural language processing through effective transfer learning. However, in the realm of tabular data—the structured rows and columns ubiquitous in business and science—Gradient Boosted Decision Trees (GBDTs) like XGBoost and CatBoost remain the dominant choice. The primary obstacles for DNNs in this domain are the inherent heterogeneity of tables (varying columns and distributions) and the "numerical gap," where the discrete nature of Language Models (LMs) struggles to represent continuous scalar values meaningfully.
TP-BERTa (Tabular Prediction adapted BERT) addresses these challenges by adapting pre-trained LMs to leverage their semantic "common sense" while processing numerical data with high precision.
Methodology
TP-BERTa is built upon the RoBERTa architecture and introduces two primary innovations to bridge the gap between tabular data and language modeling.
Relative Magnitude Tokenization (RMT)
To handle numerical values, TP-BERTa avoids treating numbers as simple text strings. Instead, it employs a target-aware binning method (C4.5) to discretize numerical values into 256 "magnitude tokens." To preserve the ordinal relationship between these tokens (e.g., ensuring the model knows bin 5 is closer to bin 6 than bin 100), a magnitude-aware triplet loss is utilized during training. This forces the LM to learn a continuous "number line" within its latent embedding space.
Intra-Feature Attention (IFA)
Standard LMs are sensitive to sequence order, but tabular columns are generally permutation-invariant. IFA utilizes a shared attention module to fuse a feature’s name (e.g., "Blood Pressure") with its corresponding value (e.g., "120") into a single refined vector before it enters the main LM encoder. This approach makes the model feature order-agnostic and prevents cross-column information leakage during the initial encoding phase.
Experimental Setup
The model was pre-trained on TabPertNet, a massive semantic tabular database comprising 101 binary classification and 101 regression datasets, totaling approximately 10 million samples. For downstream evaluation, the authors used 145 diverse datasets (80 classification, 65 regression). The evaluation focused on datasets with descriptive feature names to assess the model's ability to leverage semantic knowledge.
Results and Discussion
TP-BERTa demonstrates significant performance gains over existing tabular DNNs and achieves parity with industry-standard GBDTs.
Performance Comparison
As shown in the comparative analysis, TP-BERTa consistently outperforms state-of-the-art tabular DNNs such as TabNet, SAINT, and FT-Transformer. In the "typical tabular regime" of medium-sized datasets, TP-BERTa achieves an overall rank comparable to XGBoost and CatBoost, even leading in scenarios with heavy categorical features or descriptive metadata.
Semantic Transfer and Numerical Understanding
A key advantage of TP-BERTa is its ability to perform semantic transfer. It can recognize patterns across tables with different but semantically related feature names (e.g., "Male/Female" vs. "Boy/Girl"), a feat impossible for traditional GBDTs. Furthermore, ablation studies revealed that the RMT approach provides a substantial 12.45% average AUC improvement over standard "Value-to-String" methods on classification tasks, confirming the importance of magnitude-aware numerical encoding.
Conclusion and Future Work
TP-BERTa successfully adapts pre-trained LMs for tabular prediction by reconciling semantic understanding with numerical precision. While it excels when feature names are informative, its performance is naturally constrained in datasets with obfuscated or meaningless column names. Future research will explore more robust joint-task pre-training strategies and methods to reduce the computational overhead associated with Transformer-based architectures in the tabular domain.
Summary updated