Tabular Foundation Models: What If We Didn’t Have to Train a Model for Every Dataset?
From the publisher’s feed, collected in the ZeroLabs newsroom.
For years, building a machine learning model for structured data has followed a fairly predictable process. We start with a dataset, explore its characteristics, preprocess the features, select an algorithm, train it, tune its parameters, evaluate its performance and, eventually, deploy it. If the results aren’t satisfactory, we return to the beginning and try something else.Tabular Foundational Models — Image by AuthorThis workflow has become second nature to many machine learning practitioners. Whether we’re predicting customer churn, detecting fraudulent transactions, forecasting sales or estimating insurance risk, the process often involves experimenting with several algorithms until we find one that works well for the problem at hand.But what if the model didn’t need to be trained from scratch every time we encountered a new dataset?What if a model had already learned how to recognize predictive patterns across thousands or millions of different learning problems, and we could simply provide our dataset and ask it to make predictions?This isn’t just a hypothetical idea anymore. A new class of machine learning models, known as Tabular Foundation Models (TFMs), is exploring precisely this possibility.The Machine Learning Workflow We KnowTabular data is arguably one of the most common forms of data encountered in real-world machine learning. Customer records, financial transactions, retail sales, healthcare information, insurance claims and operational datasets are typically organized into rows and columns. Despite the enormous variety of applications, many of these problems ultimately come down to predicting one column using the information contained in the others.Consider a customer churn dataset. We might have features such as customer tenure, monthly subscription charges, number of support tickets, contract type and payment history. The objective is to predict whether a customer is likely to leave the service.This is a straightforward supervised learning problem. We have historical observations containing both the features and the outcome we want to predict. We use this data to teach a model how the features relate to the target.In practice, however, getting a model to perform well is rarely as straightforward as calling fit().We might begin by handling missing values, encoding categorical variables, identifying outliers and exploring relationships between features. Then comes the algorithm selection process. Logistic Regression might provide a simple baseline, while Random Forests, XGBoost, LightGBM or CatBoost might capture more complex relationships. We could then tune hyperparameters, experiment with different feature combinations and evaluate the models using metrics appropriate for the problem.This process works remarkably well. In fact, gradient-boosted decision trees have remained exceptionally competitive on structured data for years, often outperforming deep learning approaches on conventional tabular benchmarks.Yet, this workflow has a fundamental characteristic: we repeatedly teach models to solve new problems using the data associated with those problems.Every new dataset introduces another modelling exercise. Even when we’ve solved similar problems before, much of the process may need to be repeated. We still need to decide which model to use, how to preprocess the data, which parameters to tune and how to evaluate the resulting predictions.Typical Process — Image by AuthorThis raises an interesting question. Could a machine learning model learn something more general about how tabular prediction problems work, rather than learning only the relationships within one particular dataset?That question is at the key of Tabular Foundation Models.From Training a Model to Reusing What a Model Has Already LearnedFoundation models have changed the way we think about machine learning in several domains.Large language models, for example, are pretrained on enormous collections of text. During this pretraining process, they learn patterns involving language, context, relationships between words and much more. Once pretrained, the same model can be used for different tasks without necessarily being trained from scratch each time. We can provide instructions, examples or context and use the model to perform a task it wasn’t specifically trained for in that exact form.The foundation model paradigm attempts to reuse knowledge learned during a large-scale pretraining process.Tabular Foundation Models bring a similar idea to structured data.TabularFM — Image by AuthorInstead of training a model specifically for a single dataset, a TFM is pretrained across a distribution of tabular learning problems. The objective is to learn patterns and relationships that can help it make predictions on datasets it hasn’t encountered before.Imagine a model exposed during pretraining to a vast number of different synthetic learning problems. Some datasets might contain linear relationships, while others contain nonlinear patterns, feature interactions, noise, irrelevant variables or different distributions. Some might involve classification, while others involve regression.Over time, the model learns from these diverse tasks.When we later introduce a new dataset, the model doesn’t necessarily need to undergo the conventional training process we would perform with XGBoost or a neural network. Instead, it can use the labelled observations we provide as context and generate predictions for new observations.This approach is commonly associated with in-context learning.The important distinction is that the model’s knowledge was acquired during pretraining. Our new dataset provides the context from which it makes predictions, rather than necessarily triggering a new conventional training process that updates the model’s weights.This is a different way of approaching the same predictive problem.But How Can a Model Learn From Data It Has Never Seen?This is probably the most common question about Tabular Foundation Models.If the model hasn’t been trained on our particular dataset, how does it know what relationships to look for? And how can it make meaningful predictions without the usual training process?The answer lies in what the model learns before we ever use it.Many prominent tabular foundation models are pretrained using synthetic data. Rather than relying exclusively on large collections of real-world tables, researchers generate a wide variety of artificial datasets that represent different possible learning problems.Let’s simplify this idea.Suppose we generate a dataset using a function such as:[ y = 3x1 + 2x2 + \epsilon ]Here, the target depends on two features and some noise. A model exposed to this dataset can learn the relationship between the features and the target.But pretraining doesn’t stop with one function. We could generate thousands of datasets with different functions, different feature distributions, different relationships, different levels of noise and different structures.One dataset might contain a linear relationship. Another might contain a nonlinear relationship. Another might have features that interact with one another. Some features might be informative, while others might be entirely irrelevant to the target.For example, another synthetic learning problem might follow:[ y = x1² + sin(x2) + epsilon ]And another could contain conditional relationships in which the way one feature influences the target depends on the value of another feature.The goal is to expose the model to a sufficiently diverse collection of learning problems so that it learns more than the patterns of a single dataset.It learns how predictive relationships can behave across different possible datasets.This is where synthetic data becomes particularly important. Real-world tabular datasets are often proprietary, sensitive, fragmented and difficult to collect at the scale required for pretraining. Synthetic data provides researchers with a way to generate large and diverse collections of learning tasks.Some approaches use Structural Causal Models, or SCMs, to generate these tasks. These models can represent relationships between variables and create different underlying structures from which synthetic observations are sampled. By varying the structures, distributions and functions used during generation, researchers can expose foundation models to a broad range of potential learning scenarios.Of course, synthetic data is not automatically representative of real-world data. The quality and diversity of the pretraining tasks matter enormously. A model can only generalize effectively to the extent that its pretraining process has equipped it to handle the patterns it encounters.But the underlying idea is fascinating: instead of training a model to solve one particular prediction problem, researchers train it across a distribution of possible prediction problems.Train under different distributions — Image by AuthorIn-Context LearningLet’s return to our customer churn example.Suppose we have a labelled dataset containing 1,000 customers. Each customer has features such as tenure, monthly charges, contract type and support interactions. We want to predict churn for another 200 customers whose outcomes are unknown.With a conventional model, we would train using the 1,000 labelled observations. During training, the model’s parameters would be adjusted to learn the relationship between the features and the target.With a tabular foundation model, the process can be different.The pretrained model receives the labelled dataset as context. The 200 customers whose outcomes we want to predict are then presented as query observations. The model uses the information contained in the context to generate predictions for those queries.Conceptually, the process looks like this:Pretrained model + labelled examples + new observations → predictionsLabelled rows act as context. The model predicts the new rows in one forward pass, without updating its weights. — Image by AuthorThe model’s pretrained parameters generally remain unchanged during this standard in-context inference process. Instead, the information contained in the labelled dataset influences the predictions through the model’s forward-pass computation.This is why the fit() method in some tabular foundation model libraries can be misleading if interpreted in exactly the same way as fit() in XGBoost or Scikit-learn's traditional estimators. The interface may look familiar, but the underlying process can be fundamentally different. In an in-context learning workflow, the dataset is prepared as context for prediction rather than used to perform conventional task-specific parameter optimization.This doesn’t mean the model performs no computation when we provide a dataset. It still needs to process the context, represent the observations and calculate predictions. Depending on the architecture, this process can be computationally demanding.The difference is that the model’s predictive knowledge was largely acquired during pretraining, rather than through a conventional training run on our particular dataset.A New Approach, Not a Replacement for Traditional Machine LearningThe emergence of Tabular Foundation Models is exciting, but it would be premature to conclude that traditional machine learning models are becoming obsolete.XGBoost, LightGBM, CatBoost and other established algorithms remain powerful tools. They are efficient, highly competitive and often particularly well suited to large-scale tabular problems. In many production environments, they may still be the most practical choice.Tabular Foundation Models introduce another approach to the modelling process. They may be particularly attractive when datasets are relatively small, when we want to establish a strong baseline quickly or when we need to solve multiple prediction tasks without repeatedly performing extensive model-development workflows.Their performance, however, depends on the dataset, the model architecture, the evaluation strategy and the computational resources available. A pretrained model isn’t automatically the best model for every problem.TFMs and gradient-boosted trees suit different situations. For many problems, it’s worth testing both. — Image by AuthorThe interesting development is not necessarily that foundation models will replace traditional algorithms. It is that we now have models capable of reusing learned predictive knowledge across datasets, potentially reducing some of the effort traditionally required to build machine learning solutions.And that leads to a deeper question.If these models can make predictions using a dataset provided as context, what actually happens inside them? How are rows and columns represented? How can transformer architectures work with numerical and categorical features? And how do models such as TabPFN, TabICL and TabFM approach this problem differently?Understanding those questions requires looking beyond the idea of in-context learning and into the architectures and pretraining strategies that make it possible.That’s where the real mechanics of Tabular Foundation Models begin.Tabular Foundation Models: What If We Didn’t Have to Train a Model for Every Dataset? was originally published in Towards AI on Medium, where people are continuing the conversation by highlighting and responding to this story.