CT-BERT: Learning Better Tabular Representations Through Cross-Table Pre-training

Chao Ye, Guoshan Lu, Haobo Wang, Liyao Li, Sai Wu, Gang Chen, Junbo Zhao · OpenReview

Abstract

Tabular data is one of the most common data forms, yet extracting common knowledge across heterogeneous tables remains a significant challenge. Unlike Computer Vision or Natural Language Processing, tabular data lacks inherent spatial or sequential structure. We propose CM2 (Cross-table Masked Modeling), a framework for large-scale pre-training across diverse tables. We curate OpenTabs, a dataset of 46 million samples from nearly 2k high-quality tables. CM2 utilizes a semantic-aware feature encoder and a prompt Masked Table Modeling (pMTM) objective. Extensive empirical results on 16 datasets demonstrate that CM2 achieves state-of-the-art performance, significantly outperforming prior deep learning and gradient-boosting approaches.

Introduction: The Tabular Pre-training Gap

While large-scale pre-training has revolutionized NLP and CV, tabular data mining has largely remained confined to single-table or fixed-schema models. A model trained on one table typically cannot generalize to another with different columns.

Comparison of pre-training paradigms across Vision, NLP, and Tabular domains.

The authors identify three primary "cross-table hurdles":

  1. Limited Pre-training Corpus: The lack of a high-quality, large-scale dataset for tables.
  2. Encoder Heterogeneity: The extreme variation in column types and quantities across different tables.
  3. Lack of Structural Priors: Tables are permutation invariant; swapping rows or columns does not change the data's meaning, unlike the spatial structure of images or the sequential order of text.

Methodology: The CM2 Framework

To overcome these hurdles, the researchers introduced the CM2 framework, focusing on two core innovations.

Semantic-aware Tabular Neural Network

Traditional models often use simple lookup tables for features. CM2 instead treats each cell as a "feature phrase" combining the [Column Name + Feature Value].

  • Categorical features are tokenized and processed via a pre-trained BERT model.
  • Numerical features are normalized and scaled by their word-embedded column names.

This approach allows the model to understand semantic relationships across different databases—for instance, recognizing that "hot" in a temperature column and "high" in a pressure column share underlying semantic characteristics.

Comparison of word-level modeling (past works) versus feature-level modeling (CM2).

Crucially, positional encodings are discarded to respect the permutation-invariant nature of tabular data. By modeling at the feature level rather than flattening tables into sentences, CM2 preserves structural information while leveraging NLP-style semantic understanding.

Prompt Masked Table Modeling (pMTM)

Inspired by BERT’s Masked Language Modeling, CM2 employs prompt Masked Table Modeling (pMTM). The model masks approximately 35% of features in a row. Since tables lack a natural sequence, the model is provided with column names as "prompts" to reconstruct missing values. This context enables the model to learn complex inter-variable relationships, such as how "income" correlates with "job" and "age".

Data and Evaluation

The study introduces OpenTabs, a massive curated dataset of 46 million tabular samples from sources like OpenML, UCI, and Kaggle. Strict cleaning protocols were applied, including a "semantic relevance score" to ensure column headers provide meaningful context. The model was evaluated on 16 diverse public benchmarks covering classification, regression, and anomaly detection.

Key Results and Insights

  • State-of-the-Art Performance: CM2 outperformed strong baselines, including XGBoost, LightGBM, and FT-Transformer, across the 16 evaluation datasets.
  • Few-Shot Learning: In scenarios with limited labeled data (5-shot or 10-shot), the pre-trained CM2 model showed significant gains over models trained from scratch, demonstrating successful transfer of "shareable knowledge."
  • Versatility: The architecture proved competitive in both regression and anomaly detection without modification, suggesting its potential as a foundation model for tabular data.

Conclusion

CM2 represents a significant step toward a "BERT moment" for tabular data. By treating column names as semantic anchors and modeling at the feature level, it overcomes the heterogeneity of cross-table data. While currently operating at 50 million parameters, future scaling aims to reach the billion-parameter scale seen in other domains, potentially unlocking even deeper generalizable representations for structured data.

Summary updated

BibTeX
@inproceedings{ye2023ct,
  author = {Chao Ye and Guoshan Lu and Haobo Wang and Liyao Li and Sai Wu and Gang Chen and Junbo Zhao},
  title = {{CT-BERT: Learning Better Tabular Representations Through Cross-Table Pre-training}},
  booktitle = {The Web Conference},
  year = {2023},
}
Figure