Skip to main content
ByPrior Labs
A benchmark on a single tabular dataset. XGBoost is a commonly-used model for tabular data, so the natural question is how TabPFN compares. This notebook runs both on the same dataset and the same split, measuring ROC AUC alongside fit and predict time. TabPFN runs through the hosted API client (tabpfn-client), so its timings include the network round-trip to Prior Labs’ servers rather than pure local compute. To keep things fair on accuracy, XGBoost gets two chances: a sensible hand-picked configuration and a properly cross-validated one. Every result is collected into a single table at the end.

Setup

Installing the TabPFN client and XGBoost.

Imports and Data

Loading the dataset from OpenML and creating a stratified train/test split. We fetch the German Credit dataset directly from OpenML and split it with stratification so the class balance is preserved in both halves. A single results list accumulates each model’s score and timing for the final comparison.

Authentication

Setting TABPFN_TOKEN so the client can reach the API. The client reads the API key from the TABPFN_TOKEN environment variable, we use the set_access_token helper. Here we pull it from Colab secrets.

TabPFN, Default Settings

No configuration, no tuning, just fit and predict. We fit TabPFNClassifier from the hosted client with its defaults and time both the fit and the prediction. Because the model runs on Prior Labs’ servers, these timings include the round-trip to upload the data and return predictions. The ROC AUC and timings go straight into the results table.

XGBoost, Sensible Defaults

A reasonable hand-picked configuration with 100 boosting rounds. This is the configuration most practitioners reach for as a starting point: a moderate learning rate, depth-six trees, light subsampling, and 100 rounds. It represents XGBoost used with no tuning effort.

XGBoost, CV-Tuned

Choosing the number of trees with cross-validation and early stopping. To give XGBoost a fair shot, we tune the number of boosting rounds using 5-fold cross-validation with early stopping. This mirrors what a careful practitioner would actually ship.

Results

Comparing accuracy and speed across all three models. The table below collects ROC AUC, fit time, and predict time for each model. ROC AUC measures how well a model ranks positive cases above negative ones across every decision threshold: 1.0 is a perfect ranking, 0.5 is no better than a coin flip, so higher is better. On this dataset TabPFN reaches the highest ROC AUC with no tuning at all. XGBoost is faster on data this small, but TabPFN’s times here are dominated by the hosted API round-trip rather than compute, and even after cross-validation XGBoost does not close the accuracy gap.