TL;DR
TabGemma adapts large language models (LLMs) for tabular data prediction by treating table rows as text sequences. By introducing a standardized scientific notation for numbers, continuing pretraining on a massive table corpus, and using an efficient n-gram retrieval mechanism, TabGemma achieves state-of-the-art classification performance on semantically rich tabular datasets, outperforming heavily tuned AutoML frameworks.
What Problem Does This Paper Address?
Real-world tabular datasets are rarely just numbers; they are often a messy mix of numeric values, categories, and rich textual information (like descriptive column headers or free-text cells). Traditional tabular models like gradient-boosted decision trees (XGBoost, LightGBM) excel at processing numbers but fail to grasp the deeper semantic meaning of text fields without complex, hand-crafted preprocessing pipelines.
Conversely, while Large Language Models (LLMs) possess deep semantic understanding, adapting them to tabular prediction introduces two major hurdles:
- Unstable Numeric Tokenization: Standard subword tokenizers break down raw decimals inconsistently (e.g., treating "3141.5" and "31.415" completely differently), making it hard for the model to learn mathematical relationships.
- Context Window Limitations: In-context learning (ICL) requires feeding example rows (exemplars) directly into the prompt. For large tables, standard LLM context windows quickly overflow.
Methods
The authors introduce TabGemma, a schema-agnostic tabular predictor built on top of the 12B Gemma 3 base model. Its architecture spans three core components:
- Canonical Row Serialization: To fix numeric tokenization, all numbers are normalized into signed, base-10 scientific notation with four significant digits (e.g.,
3141.592becomes+3.1416e+03). This forces the tokenizer to generate predictable, reusable subpatterns (like+ande+0). Rows are then serialized into a linear sequence using special cell-separator (EOC) and end-of-row (EOR) tokens. - Continued Pretraining: TabGemma undergoes continued pretraining on a tabular column-imputation objective. The model learns to predict a masked target column causally conditioned on the remaining feature tokens, directly aligning its training with downstream classification and regression tasks.
- N-Gram-Based Retrieval: To scale to large datasets during inference, TabGemma uses a fast, stateless retrieval mechanism. Cells are vectorized using a bag of character n-grams, hashed into a 256-dimensional vector, concatenated into row embeddings, and indexed using FAISS. At inference time, the system retrieves the $k=128$ most similar rows to serve as in-context exemplars within Gemma's 128k-token window.
Datasets
- Pretraining: The model was pretrained on the T4 dataset, a massive corpus containing 3 million real-world tables extracted from the web.
- Evaluation: TabGemma was evaluated across three distinct benchmarks covering 123 total tasks:
- CARTE: 51 tasks (11 binary classification, 40 regression) focused on rich text and semantic features.
- TextTab: 21 tasks (9 classification, 12 regression) emphasizing textual metadata.
- TabArena-Lite: 51 tasks (38 classification, 13 regression) representing conventional, numeric-heavy tabular problems.
Key Insights and Ideas
- Scientific Notation is a Superpower for LLM Numerics: Standardizing numbers into scientific notation drastically reduces token variability. It allows the LLM to leverage its existing token embeddings to learn magnitude and scale more effectively than processing raw decimals.
- Semantics Trump Pure Statistics in Low-Data Regimes: On text-heavy tables, TabGemma's pre-existing world knowledge allows it to excel even with very few training examples, outperforming traditional models that only look at statistical correlations within the current dataset.
- Classification Scales Monotonically with Context: Unlike many prior LLM tabular approaches where performance plateaus, TabGemma's classification accuracy steadily improves as more retrieved context rows ($k$) are added to the prompt, validating the use of long-context models.
Key Results
On semantically rich classification benchmarks, TabGemma established a new state of the art, outperforming even AutoGluon—an AutoML framework that stacks multiple heavily tuned traditional predictors.
- CARTE Classification: TabGemma achieved 79.3% accuracy, outperforming AutoGluon (78.9%) and ConTextTab (76.9%).
- TextTab Classification: TabGemma reached 84.1% accuracy, matching ConTextTab and beating AutoGluon (83.9%).
However, the results also highlighted a clear performance split: while TabGemma dominates in semantic classification, it lags behind conventional approaches on regression tasks and purely numeric benchmarks like TabArena (where AutoGluon scored 88.5% accuracy compared to TabGemma's 84.8%).
Limitations and Future Work
Despite its success in classification, TabGemma faces several limitations that point to future research directions:
- The Regression Gap: The model struggles with continuous regression targets, indicating that scientific notation tokenization, while helpful, still doesn't fully solve fine-grained arithmetic reasoning for continuous outputs.
- Scale and Width Bottlenecks: On exceptionally wide tables (many columns) or massive datasets, retrieval precision drops, and the 128k context window can still become a constraint.
- Permutation Equivariance: Serializing tables into text inherently forces an artificial row and column order. The authors suggest exploring ensembling techniques over permuted inputs to mitigate this order bias.
Summary updated