When to Trust a PFN: Detecting Harmful Shift in Tabular Foundation Models
Organizations: University of Toronto · Chalmers University of Technology · Princeton University
Abstract
Tabular prior-fitted networks (PFNs) work well across tabular classification problems but can fail silently at deployment when distributions shift. We propose CALD (Calibrated Anchor-Loss Disagreement), a lightweight unsupervised monitor that triggers an alarm to warn when a PFN might fail. By finetuning the decoder to maximize disagreement with the test-set prediction while maintaining accuracy on an ID anchor set, CALD identifies harmful OOD batches through the resulting anchor loss, requiring no labels on test batches. We prove that the post-finetune anchor loss has a strictly lower expectation under sufficiently severe shift than under ID eval, yielding a one-sided test. Across 14 datasets covering tabular and structured distribution shift, on both TabPFN and TabICL, CALD matches or outperforms baselines on harmful shifts and is markedly more resilient to benign-shift false alarms.
Figures & tables
| Benign ( ) | Harmful ( ) | |||||||||||||
| Method | Adult | Diab. | Amazon | Credit | Folktbl. | Bank | CelebA | CivilC. | Camel. | Waterb. | CIFAR | UCI | PACS | Covert. |
| 9.4 | 2.3 | 1.5 | 2.8 | 3.1 | 4.4 | 4.5 | 7.4 | 8.9 | 11.6 | 12.4 | 15.6 | 27.9 | 83.5 | |
| MSP | .00 | .64 | .78 | .55 | .53 | .00 | .63 | 1.00 | .97 | 1.00 | .96 | .74 | 1.00 | 1.00 |
| Entropy | .00 | .61 | .80 | .61 | .50 | .00 | .39 | 1.00 | .98 | 1.00 | .97 | .77 | 1.00 | 1.00 |
| Energy | .00 | .00 | .77 | .00 | .86 | .42 | .04 | 1.00 | 1.00 | 1.00 | .97 | .66 | 1.00 | .50 |
| Mahal. | .00 | .00 | .71 | .00 | .12 | .05 | .00 | .32 | .43 | .18 | .55 | 1.00 | 1.00 | 1.00 |
Appendix figures & tables36 assets
Supplementary material from the paper’s appendix.
Appendix
| Label | Statement | Source |
| Core gradient-geometry assumptions (Theorem A.9 ) | ||
| A1 (design) | Only the last-layer weight is updated; backbone is frozen. | Analysis restriction; the deployed detector updates the full decoder (Appendix D.2 ). |
| A2 (design) | Pseudolabels are fixed at and do not change during finetuning. | Pseudolabel step of Algorithm 1 . |
| A3 (standard) | and softmax residuals bounded. | Standard for trained models. |
| Assn. A.3 (key) | for . | Consequence of Nagler [39, Thm. 6.3] in the far-OOD limit; genuine empirical claim for near-OOD. |
| Assn. A.5 | Anchor correctness + eval confidence + centered, class-symmetric features + ID accuracy . | Holds for any useful PFN on ID data. |
| Failure mode | Tested | Theory | Notes |
| Distribution shift – harmful ( CALD should fire) | |||
| Covariate shift | ✓ | Thm. A.9 (far-OOD) | main use case |
| Subpopulation shift | ✓ | severity sweep (heuristic) | spurious attributes |
| Domain shift | ✓ | Thm. A.9 (far-OOD) | subset of covariate shift |
| Near-OOD (overlapping support) | partial | vacuous in Thm. A.9 | empirical only |
| Distribution shift – benign by accuracy criterion | |||
| (pp) | cald-tabpfn | cald-tabicl | KNN | MMD | Mahal. | Energy | MSP | |
|---|---|---|---|---|---|---|---|---|
| diabetes_readmission | ||||||||
| bank_marketing | ||||||||
| credit_default | ||||||||
| folktables |
| dataset | method | kind | AUROC | (pp) | |||||
|---|---|---|---|---|---|---|---|---|---|
| Diab. | cald-tabpfn | benign | |||||||
| Bank | cald-tabpfn | benign | |||||||
| Credit | cald-tabpfn | benign | |||||||
| Folktbl. | cald-tabpfn | benign | |||||||
| Diab. | cald-tabicl | benign | |||||||
| Bank | cald-tabicl | benign |
| Dataset | ID Acc | OOD Acc | (%) | (%) |
|---|---|---|---|---|
| Benign ( ) | ||||
| Adult Income † | ||||
| Diabetes Readm. † | ||||
| Amazon † | ||||
| Credit Default † | ||||
| Folktables † | ||||
| Method | Adult | Diab. | Amazon | Credit | Folktbl. | Bank | CelebA |
|---|---|---|---|---|---|---|---|
| (%) | 9.4 | 2.3 | 1.5 | 2.8 | 3.1 | 4.4 | 4.5 |
| MSP | |||||||
| Entropy | |||||||
| Energy | |||||||
| Mahal. | |||||||
| RMD |
| Method | CivilC. | Camel. | Waterb. | CIFAR | UCI | PACS | Covert. |
|---|---|---|---|---|---|---|---|
| (%) | 7.4 | 8.9 | 11.6 | 12.4 | 15.6 | 27.9 | 83.5 |
| MSP | |||||||
| Entropy | |||||||
| Energy | |||||||
| Mahal. | |||||||
| RMD |
| Standard TabPFN | Drift-Resilient TabPFN | ||||||
| Dataset | ID | OOD | (%) | ID | OOD | (%) | OOD (%) |
| Benign ( ) | |||||||
| CelebA † | |||||||
| Bank Marketing † | |||||||
| Folktables † | |||||||
| Credit Default † | |||||||
| Dataset | Model | AUROC | TPR@5% | Dir. |
|---|---|---|---|---|
| Image | ||||
| Camelyon17 (DINOv2) | TabPFN | 0.675 | 0.192 | ✓ |
| TabICL | 1.000 | 1.000 | ✓ | |
| Camelyon17 (ResNet18) | TabPFN | 0.977 | 0.914 | ✓ |
| TabICL | 0.990 | 0.932 | ✓ | |
| CIFAR-10 10.1 | TabPFN | 1.000 | 0.998 | ✓ |
| Dataset | ||||||||
|---|---|---|---|---|---|---|---|---|
| Adult Income | 0.500 | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 | 0.663 | 0.990 |
| Bank Marketing | 0.500 | 0.913 | 0.937 | 0.957 | 0.975 | 0.983 | – | – |
| Covertype | 0.500 | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 |
| UCI Heart | 0.500 | 0.808 | 0.814 | 0.745 | 0.856 | 0.963 | 0.994 | 0.976 |
| Waterbirds | 0.500 | 0.980 | 0.999 | 1.000 | 1.000 | 1.000 | – | – |
| Dataset | Model | @ | @ | @ | @ | s@ | |
|---|---|---|---|---|---|---|---|
| Adult Income | TabPFN | 1.000 | 1.000 | 1.000 | 1.000 | 1 | 0.17 |
| TabICL | 0.978 | 1.000 | 1.000 | 1.000 | 2 | 0.11 | |
| Amazon | TabPFN | 0.538 | 0.544 | 0.543 | 0.550 | 1 | 0.17 |
| TabICL | 0.592 | 0.612 | 0.624 | 0.600 | 1 | 0.06 | |
| Bank Marketing | TabPFN | 0.890 | 0.981 | 0.985 | 0.997 | 2 | 0.34 |
| TabICL | 1.000 | 0.957 | 1.000 | 1.000 | 1 | 0.06 |
| TabPFN | TabICL | |||||
|---|---|---|---|---|---|---|
| Dataset | sel. | frozen | sel. | frozen | ||
| Adult Income | 1.000 | 1.000 | 0.000 | 1.000 | 1.000 | 0.000 |
| Amazon | 0.550 | 0.606 | 0.056 | 0.600 | 0.624 | 0.024 |
| Bank Marketing | 0.997 | 0.935 | 0.062 | 1.000 | 1.000 | 0.000 |
| Camelyon17 (DINOv2) | 0.675 | 0.999 | 0.324 | 1.000 | 1.000 | 0.000 |
| Camelyon17 (ResNet18) | 0.977 | 0.998 | 0.021 | 0.990 | 0.998 | 0.008 |
| Stress regime | Mean FPR | Per-dataset range |
|---|---|---|
| Deterministic replay | 0.065 | 0.057–0.072 |
| Nondeterministic GPU kernels | 0.065 | 0.057–0.072 |
| Anchor re-drawn every round | 0.064 | 0.052–0.069 |
| Time-correlated eval stream | 0.068 | 0.063–0.075 |
| Label noise | OOD contamination | |||||||
|---|---|---|---|---|---|---|---|---|
| Dataset | ||||||||
| Adult Income | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 |
| Bank Marketing | 0.934 | 0.935 | 0.933 | 0.946 | 0.932 | 0.932 | 0.929 | 0.925 |
| CIFAR-10 10.1 | 0.920 | 0.757 | 0.835 | 0.955 | 0.963 | – | – | – |
| CivilComments | 0.991 | 0.989 | 0.988 | 1.000 | 0.991 | 0.991 | 0.988 | – |
| Covertype | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 |
| Covertype (far-OOD), | Waterbirds (near-OOD), | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Model | Metric | ||||||||||
| TabPFN | 95% | 0.939 | 0.932 | 0.919 | 0.878 | 0.537 | 0.978 | 0.976 | 0.974 | 0.971 | 0.964 |
| dispersion | 6.91 | 7.25 | 6.86 | 5.33 | 3.31 | 8.90 | 8.62 | 8.21 | 7.79 | 7.22 | |
| AUROC | – | 0.750 | 0.883 | 1.000 | 1.000 | – | 0.709 | 0.936 | 0.973 | 1.000 | |
| TabICL | 95% | 0.859 | 0.846 | 0.824 | 0.761 | 0.544 | 0.858 | 0.844 | 0.845 | 0.833 | 0.824 |
| dispersion | 10.60 | 11.00 | 10.58 | 9.19 | 7.05 | 10.87 | 10.30 | 10.49 | 9.99 | 9.79 | |
| Dataset | (q95) | AUROC (Table 10 ) | |
|---|---|---|---|
| Covertype | 0.497 | 1.000 | |
| CIFAR-10 10.1 | 0.771 | 1.000 | |
| Camelyon17 (DINOv2) | 0.920 | 0.675 | |
| Camelyon17 (ResNet18) | 0.928 | 0.977 | |
| CelebA | 0.951 | 0.919 | |
| Credit Default | 0.951 | 1.000 |
| Dataset | -gap | |
|---|---|---|
| Waterbirds | ||
| Credit Default | ||
| Diabetes Readmission | ||
| Bank Marketing | ||
| Covertype | ||
| Camelyon17 (ResNet18) |
| Dataset | Shift | only | only | |
|---|---|---|---|---|
| Adult Income | benign | 1.00 | 1.00 | 1.00 |
| Amazon | benign | 0.91 | 0.97 | 0.99 |
| Bank Marketing | benign | 0.23 | 0.00 | 0.23 |
| CelebA | benign | 0.42 | 0.97 | 0.97 |
| Credit Default | benign | 0.00 | 0.62 | 0.62 |
| Diabetes Readmission | benign | 0.00 | 1.00 | 1.00 |
| Dataset | No shift | Label-prior | Concept | Concept acc (pp) |
|---|---|---|---|---|
| Adult Income | 0.51 | 0.98 | 0.51 | 64.9 |
| Bank Marketing | 0.61 | 0.57 | 0.60 | 82.7 |
| Camelyon17 (DINOv2) | 0.55 | 0.98 | 0.55 | 91.3 |
| Covertype | 0.57 | 1.00 | 0.79 | 87.2 |
| Credit Default | 0.57 | 0.94 | 0.56 | 66.5 |
| Diabetes Readmission | 0.55 | 0.58 | 0.54 | 77.3 |
Distribution Shift Detection
Distribution shift detection identifies when data or model behavior changes between reference and deployment settings.
See all 69 papers