Language Models Are Good Tabular Learners

Zhenhan Huang, Kavitha Srinivas, Horst Samulowitz, Niharika S. D'Souza, Charu C. Aggarwal, Pin-Yu Chen, Jianxi GaoOpenReview 2025 · Submission to ICLR 2025 · Rejected

TDTransformer (Tabular Domain Transformer) is a novel framework that makes Transformer architectures competitive with—and often superior to—traditional tree-based models like XGBoost on tabular data. By utilizing specialized embedding strategies for different column types and a unique "Column-Type Aware" positional encoding, it successfully bridges the gap between natural language processing and structured tabular data.

The Tabular Gap: Why Transformers Struggle

Despite their total dominance in language and vision tasks, Transformers have historically struggled with tabular data (e.g., spreadsheets, SQL databases). In this domain, "shallow" tree-based models like XGBoost and CatBoost have remained the gold standard.

The authors identify two primary reasons for this performance gap:

  1. Data Heterogeneity: Tabular data is a mix of text-like categories, continuous numbers, and binary flags. Standard Transformers treat everything as a uniform sequence of tokens, losing the inherent structure and meaning of these distinct data types.
  2. Numerical Reasoning: Language models are notoriously poor at "understanding" numbers. Treating a number like "1969" as a string of text digits fails to capture its magnitude or its relationship to other values in a way that neural networks can easily exploit.

The TDTransformer Approach

To solve these issues, the authors propose a "divide and conquer" approach to data embedding.

TDTransformer Architecture

The architecture relies on several key innovations:

  • Distinct Embedding Pipelines: Instead of a one-size-fits-all tokenizer, the model uses three separate paths:
  • Categorical: Concatenates column names and cell values into natural language strings, leveraging the semantic power of pre-trained language models (like BERT).
  • Numerical: Uses an adapted Piece-wise Linear Encoding (PLE). Unlike standard tokenization, PLE maps scalars directly to high-dimensional vectors, providing a crucial inductive bias that helps the model understand numerical distributions.
  • Binary: Simplifies binary flags into a specialized embedding space.
  • Alignment Layers: Because each pipeline produces embeddings in different formats, linear alignment layers project them into a common "hidden space" before they enter the main Transformer backbone.
  • Column-Type Aware (CTA) Positional Encoding: Standard Transformers use positional encodings to track word order. However, table columns are generally "permutation invariant" (their order shouldn't matter). TDTransformer only applies positional encoding to the categorical text strings where word order does matter, leaving numerical and binary columns untouched.
  • Contrastive Pre-training: The model is first trained using a self-supervised contrastive loss—learning to identify corrupted versus original rows—before being fine-tuned for specific classification tasks.

Key Insights

  • Semantics Matter: A major advantage of using a Language Model backbone is its ability to understand column names. If a column is named "Age," the model leverages pre-trained knowledge about what "Age" represents—an advantage tree-based models lack.
  • The "Aha" of CTA Positional Encoding: Traditional positional encoding actually hurts tabular performance by forcing an artificial order on columns. Restricting it to the interior of categorical cells preserves the model's flexibility.
  • PLE is the Secret Sauce for Numbers: By mapping numbers to a range of [-1, 1] using quantiles, the model avoids scaling issues that often plague deep learning on tabular data, making it far more robust to outliers.

Experimental Results

The researchers evaluated TDTransformer on a massive scale using 76 real-world tabular classification datasets from the OpenML benchmark, covering diverse domains like finance, healthcare, and social sciences.

Binary Classification Results

TDTransformer demonstrated a clear edge over both traditional and deep learning baselines:

  • Binary Classification: It achieved an average accuracy of 87.79%, outperforming CatBoost (86.12%) and XGBoost (84.97%).
  • Multiclass Classification: The lead was even more pronounced, with TDTransformer reaching 80.51% accuracy compared to CatBoost's 76.61%.
  • Superiority over DL Baselines: It consistently outperformed other specialized tabular deep learning models like SAINT, FT-Transformer, and TabM across almost all subsets of the OpenML benchmark.

Limitations and Future Work

While highly effective, the framework does have limitations. Its performance relies heavily on semantic dependency; when datasets use anonymized column names (e.g., "V1", "V2"), the model cannot leverage its pre-trained linguistic knowledge, diminishing its advantage over tree-based models. Additionally, the authors used constant hyperparameters across all 76 datasets to demonstrate "out-of-the-box" robustness, though per-dataset tuning would likely yield even better results. Future work will explore dataset-dependent hyperparameter optimization and expanding the framework to handle regression tasks.

Summary updated

BibTeX
@misc{huang2025language,
  author = {Zhenhan Huang and Kavitha Srinivas and Horst Samulowitz and Niharika S. D'Souza and Charu C. Aggarwal and Pin-Yu Chen and Jianxi Gao},
  title = {{Language Models Are Good Tabular Learners}},
  year = {2025},
  url = {https://openreview.net/forum?id=r8tMECbxOl},
  howpublished = {OpenReview},
  note = {Submitted to ICLR 2025},
}
Figure