> ## Documentation Index
> Fetch the complete documentation index at: https://docs.priorlabs.ai/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> TabPFN-3 and later versions support up to 1,000,000 rows, subject to feature count and checkpoint/API limits.
> For large datasets, use per-estimator subsampling, e.g. inference_config={"SUBSAMPLE_SAMPLES": 100_000}, in TabPFNClassifier or TabPFNRegressor from tabpfn or tabpfn_client.
> Pass raw pandas DataFrames to fit and predict. Categorical strings/categories, raw text, and missing feature values are handled automatically; no manual integer/one-hot encoding, imputation, scaling, or outlier removal is needed.

# TabPFN-4

> Our foundation model for large data - use up to 10 million training rows, weight individual observations, and model grouped or zero-heavy data with the hosted API.

Today, we’re releasing TabPFN-4. **It can learn from up to 10 million training rows in a single forward pass** and makes predictions up to **100 times faster** than TabPFN-3.5 on large tables. You can use more of the history you’ve collected and tell the model which records matter most for the prediction you want to make. Read more about what comes with it.

## API and `tabpfn-client`

### TabPFN-4

TabPFN-4 expands the training context from 1 million to 10 million rows. The API accepts up to 23,000 feature columns within a 20.48 billion cell cap. At 10 million rows, that allows 2,048 feature columns. Thanks to innovative architecture, inference time now grows subquadratically as you add rows, so using a larger dataset is more practical.

We've also updated Thinking, our most accurate offering, to make use of TabPFN-4 improvements. Set `thinking_mode=True` to use more compute during fitting to improve prediction quality.

Starting with `tabpfn-client` 0.11.0, you can select TabPFN-4 and pass `sample_weight` and `label_reliability` to `fit()`. For TabPFN-4, KV caching (`fit_mode="fit_with_cache"`) requires 0.11.1 or later, and Thinking requires 0.11.2 or later.

```bash theme={null}
pip install --upgrade "tabpfn-client>=0.11.2"
```

After upgrading, `TabPFNClassifier()` and `TabPFNRegressor()` use TabPFN-4 by default. TabPFN-4 is API-exclusive at launch with open-weights and VPC releases to come soon.

TabPFN-4 also gives you more control over how the model uses individual observations, uncertain labels, and groups of related rows.

### Sample weights and label reliability

Sample weights tell TabPFN-4 how much influence each training row should have on the end outcome. If you are predicting defaults, for example, can weight loans by outstanding balance so larger exposures carry more weight.

Label reliability tells the model how confident you are in the recorded outcome. A verified outcome can receive a score of `1.0`, while a provisional outcome can receive a lower score.

Pass either argument or both to `fit()`, with one value per training row in the same order as `X_train` - [sample weights](https://docs.priorlabs.ai/api-reference/python/tabpfn-client/classifier/fitting-and-prediction.md#fit-sample-weight) should be nonnegative, and [reliability scores](https://docs.priorlabs.ai/api-reference/python/tabpfn-client/classifier/fitting-and-prediction.md#fit-label-reliability) should range from 0 to 1.

```python theme={null}
from tabpfn_client import TabPFNClassifier

model = TabPFNClassifier()
model.fit(
    X_train,
    defaulted_train,
    sample_weight=outstanding_balance_train,
    label_reliability=label_confidence_train,
)
default_probabilities = model.predict_proba(X_test)
```

### Zero-inflated regression

A regression target is *zero-inflated* when many observations are exactly zero, but you are looking to predict the non-zero outcomes.

With this release, TabPFN improved drastically when predicting zero-inflated targets. To make use of the improvements, toggle the `zero_inflated` preset on. And if you are curious by how much we have improved, compare the on vs. off.

```python theme={null}
from tabpfn_client import TabPFNRegressor

model = TabPFNRegressor(presets="zero_inflated")
model.fit(X_train, units_sold_train)
expected_units = model.predict(X_test)
```

### Grouped data

When several rows belong to the same customer, product, or machine, pass `group_col` to a classifier or regressor, with or without Thinking. If every training group has a single label, TabPFN-4 automatically adds features computed across each group’s rows. At prediction time, it computes those features from the rows in the request.

Whenever you use `group_col` with TabPFN-4, include the group column in both the train and test tables and send all rows of each group in the same prediction call. Starting with version 0.11.2, `tabpfn-client` keeps groups together when it splits a large test set across requests.

To predict an outcome for a whole batch, set `group_col="batch_id"` and use `presets="grouped"` to pool predictions across its members.

```python theme={null}
from tabpfn_client import TabPFNClassifier

model = TabPFNClassifier(group_col="batch_id", presets="grouped")
model.fit(X_train, batch_passed_train)
pass_probabilities = model.predict_proba(X_test)
```

### Other improvements

* **Thinking quantiles.** TabPFN-Thinking regressors fit after November 1, 2026 support `output_type="median"` and quantiles from 0.001 to 0.999. [See prediction options](https://docs.priorlabs.ai/capabilities/thinking-mode.md#quantile-predictions).
* **KV cache on TabPFN-4.** `fit_mode="fit_with_cache"` works with TabPFN-4 from `tabpfn-client` 0.11.1, for fits of up to 4 million training rows. [See KV cache](https://docs.priorlabs.ai/capabilities/kv-cache.md).
* **TabPFN-4-Thinking in the Python client.** Thinking with `model_path="v4_default"` requires `tabpfn-client` 0.11.2. [See Thinking mode](https://docs.priorlabs.ai/capabilities/thinking-mode.md).
* **Automatic test-set splitting.** From `tabpfn-client` 0.11.2, `predict()` splits a test set that exceeds the per-request limits across several requests, keeping each group in one request. [See Grouped data](https://docs.priorlabs.ai/capabilities/grouped-data.md#large-test-sets).
* **Cross-validation in one API job.** Use `cross_val_predict()` to get an out-of-fold prediction for each row. If you fit preprocessing separately within each fold, pass your prepared splits to `cross_val_predict_splits()`. For longer runs, you can submit the job and retrieve the predictions later. [See the Python client reference](https://docs.priorlabs.ai/api-reference/python/tabpfn-client/regressor/fitting-and-prediction.md).

## Open-source package

Local package updates since `tabpfn` 9.2.0, through 10.3.0:

* **Lower memory use on large tables.** Preprocessing works in blocks and makes fewer copies of wide tables with date or text columns. Cached regression predictions now process up to 65,536 test rows at a time by default.
* **Faster inference.** When using cache, TabPFN-3.5 uses native grouped-query attention on CPU with PyTorch 2.9 or later. Cached predictions are also faster with an `int8` or `float8` KV cache.
* **Prediction fixes.** We fixed incorrect predictions on Apple’s MPS backend with 65,536 or more training rows, preserved `float64` output in regression when requested, and fixed `safepower` collapsing features such as years or coordinates to a constant.

## Migrating

### OSS

1. Upgrade with `pip install --upgrade tabpfn` to get the latest local presets and memory improvements.
2. **Refit local regressors saved with `tabpfn` 9.x or earlier.** Version 10 changed target preprocessing, which affects both `.tabpfn_fit` archives and pickled regressors.
3. If you maintain a custom fine-tuning loop that calls `fit_from_preprocessed`, pass `y_train_mean` and `y_train_std`. [See the 10.0 breaking changes](https://github.com/PriorLabs/TabPFN/releases/tag/v10.0.0).

### API

1. Upgrade with `pip install --upgrade "tabpfn-client>=0.11.2"` to use all the TabPFN-4 features in this release.
2. Leave `model_path` unset to use TabPFN-4 for new fits. To keep a pipeline on TabPFN-3.5, pass `model_path="v3.5_default"` when constructing the estimator. [See model selection](https://docs.priorlabs.ai/models/selecting-model-version.md).
3. Token allowances stay the same. To estimate the cost of a larger workload before running it, pass `model_version="v4"` to `estimate_cost()`. [See API metering](https://docs.priorlabs.ai/api/metering.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.