.predict() (or .predict_proba() for classifiers) on a TabPFNClassifier or TabPFNRegressor, you may see:
Large training set
UseSUBSAMPLE_SAMPLES to draw a balanced subset of training rows for each estimator. As a starting point, set SUBSAMPLE_SAMPLES=50_000 and increase n_estimators so that n_estimators × SUBSAMPLE_SAMPLES covers your full training set; samples beyond this product may not be seen by any estimator. Lower SUBSAMPLE_SAMPLES if you still encounter OOM errors.
Large test set
Batch your test set to avoid loading too many test rows into memory at once. Start withCHUNK_SIZE = 1000 and increase if memory allows.
By default, the transformer re-encodes the training context on every
.predict() call. Batching reduces peak memory usage but increases total prediction time. Setting fit_mode="fit_with_cache" additionally caches the transformer KV-cache after .fit(), skipping this re-encoding on subsequent .predict() calls.Large training set and test set
Combine both approaches: subsample the training context and batch the test set.Reduce memory footprint
If the above doesn’t resolve the error, try enablingmemory_saving_mode. This trades compute for lower peak memory usage:
Hardware and Memory requirements
The table below shows rough VRAM estimates for TabPFN v3 default settings (1 estimator, 200 features, 1000 test rows, no subsampling; these are not default settings) on a basic T4 GPU. Actual usage scales with the number of features, training rows, and test rows.
Use the workarounds above to reduce memory usage. If none of the above resolves the error, your GPU does not have enough VRAM for your dataset size. If you cannot get access to powerful enough hardware, consider the TabPFN API Client (no local GPU required).
Fast Inference
Distill TabPFN into a compact MLP or tree ensemble for low-memory production deployments.
FAQ
Common questions about GPU requirements, speed, and API rate limits.