﻿# TabPFN fit semantics: labeled context state is different from gradient training

Explain standard TabPFN fit and prediction as in-context inference with fitted preprocessing and labeled context, keeping optional adaptation paths separate from ordinary estimator use.

Author: Retrivium editorial team
Updated: 2026-11-04
Canonical URL: https://retrivium.ai/journal/fg2-tabpfn-standard-fit-context-state-versus-weight-training/
Language: en

## Identify what fit means in this estimator

The familiar fit and predict interface does not imply an identical learning algorithm across libraries. TabPFN uses a pretrained model to condition predictions on labeled examples. The [project guide](https://raw.githubusercontent.com/PriorLabs/TabPFN/main/README.md) describes its in-context approach and standard estimator workflow. A technical explanation should identify the pretrained weights, dataset-specific preprocessing and labeled context separately, rather than presenting ordinary fit as a conventional gradient-training loop.

## Follow the standard fit path

The [classifier implementation](https://raw.githubusercontent.com/PriorLabs/TabPFN/main/src/tabpfn/classifier.py) initializes model variables and dataset preparation, then constructs the selected inference engine. Different fit modes decide when preprocessing and context representations are computed or retained. That creates dataset-specific state even when the base neural checkpoint remains unchanged. An unfitted estimator and one prepared with a labeled dataset are therefore different usable artifacts, despite sharing the same pretrained weight identifier.

## Keep the target task explicit

The [regressor implementation](https://raw.githubusercontent.com/PriorLabs/TabPFN/main/src/tabpfn/regressor.py) has its own target preparation and output-distribution path. Classification labels and continuous targets cannot be interchanged merely because both estimators accept a table. Preserve target encoding, schema and model-generation compatibility with the fit state. Standard in-context use should also remain distinct from optional fine-tuning or inference-tuning workflows: their available objectives and parameter changes require their own description.

## Reproduce context as well as weights

Saving only a generic model name does not recreate a fitted inference problem. A reproducible application needs the selected checkpoint, preparation settings, feature schema and the intended labeled context or equivalent supported fitted state. The [TinyTimeMixer preprocessing guide](/journal/fg2-tinytimemixer-preprocessor-training-group-scaler-state/) provides another distinction between preprocessing fit and neural learning. Treat context membership as part of the statistical task, especially when data changes between repeated predictions.

## Evaluate on examples outside the labeled context

Construct the evaluation split before preparing the estimator and preserve the boundary between context labels and unseen targets. The [entity-group split guide](/journal/data-guide-entity-group-split-design/) supports a meaningful population definition. Compare predictive accuracy and fit/predict resource costs separately. A correct explanation says which state standard fit creates and which evidence prediction may use, keeping a familiar API name from obscuring the actual in-context computation or implying that every supported adaptation path leaves neural parameters unchanged.
