Manuscript Offprint

arXiv:2610.06693

Adapting prior-data fitted networks for tabular anomaly detection

Maximilian Bershtman, Niv Cohen

ABSTRACT

While deep features have transformed anomaly detection in images and video, their impact on tabular data has been less substantial, partly due to the limited availability of strong deep representations. Recently, prior-data fitted networks (PFNs) have emerged as a promising source of such representations for tabular data. In this work, we investigate how PFN representations can be adapted and leveraged for anomaly detection.

The question is harder than it looks. No anomalies are available before deployment, so model parameters cannot be tuned with supervision, and the reference set that defines normal behavior may itself contain the very anomalies it is supposed to reveal. We begin our study using frozen TabPFN features. Scoring each sample by its distance to its nearest neighbors in feature space already gives strong results. We identify which layers to use and a feature-extraction procedure suited to the task. Next, to further improve performance, we use the reference set to fine-tune the model, so that the resulting features better separate normal samples from anomalies. On the ADBench benchmark, our fine-tuning free approach (ZEN) reaches a higher mean AUROC than every baseline, and our fine-tuned method (FOCUS) improves on it further. Our approach also generalizes across PFN models 1^{1}.

1 INTRODUCTION

Tabular data is the most common data format in real-world machine learning (Hollmann et al., 2023). This paper studies anomaly detection on tabular data, one of the oldest tasks in the field and still one of its most active (Han et al., 2022; Yoon et al., 2026; Li et al., 2026). The task is unsupervised: a detector receives a reference set of samples that describe normal behavior, and must score how strongly each new sample deviates from them. High scores should single out samples such as fraudulent transactions, unusual patient records, or compromised network traffic. The detector faces two unknowns at once. First, the anomalies: they are rare and their structure is unknown in advance, which is why the task cannot be posed as supervised classification. Second, the reference set: it may itself be contaminated, as when fraud investigators can verify only a small fraction of transactions and the unverified rest enter the historical record as normal (Dal Pozzolo et al., 2018).

We therefore study two settings. Our main setting is the contaminated regime, where the reference set contains anomalies at an unknown rate and nothing removes them before a detector sees it. The clean regime, where the reference set is anomaly-free but unlabeled, is the complementary setting.

Existing detectors handle these unknowns only partly. Detectors that excel on a clean reference set can degrade sharply once anomalies enter it (Marszałek et al., 2026), because an anomaly already in the reference set makes the test anomalies that resemble it look normal. Classical detectors remain remarkably strong (Liu et al., 2008; Zhao et al., 2019), but every deployment starts from zero, with nothing carried over. Deep methods learn richer representations (Livernoche et al., 2024; Yin et al., 2024; Li et al., 2025; Dai et al., 2025), but they too train one model per dataset, and their gains have

1^{1}Code: github.com/Maximilianb1/zen-focus-tabular-anomaly-detection not proven robust across datasets. The ADBench benchmark study reached a sobering conclusion: no unsupervised detector in its comparison came out reliably better than the others, “emphasizing the importance of algorithm selection” (Han et al., 2022).

Anomaly detection in images solved a similar problem through transfer: over the last decade it was rebuilt on representations reused from models pretrained once at scale (Yosinski et al., 2014; Bommasani et al., 2021). Features taken from generically pretrained networks and scored by simple k-nearest-neighbor distance outperformed elaborate self-supervised detectors (Bergman et al., 2020), and the same kind of features now underlies state-of-the-art industrial defect detection (Cohen & Hoshen, 2020; Roth et al., 2022). Tabular data could not follow this path, lacking comparably strong generic representations (Grinsztajn et al., 2022; Shwartz-Ziv & Armon, 2022). PANDA, an image anomaly detection method, names the absence of generic extractors for some data modalities as the main limitation of its approach (Reiss et al., 2021).

Recently, prior-data fitted networks (PFNs), with TabPFN chief among them, have emerged as strong pretrained models for tabular data, and as a potential candidate feature extractor. These models are transformers pretrained on synthetic tabular data (Hollmann et al., 2023; 2025; Grinsztajn et al., 2026), and they match or beat strong tuned baselines on supervised tabular prediction (Hollmann et al., 2025). They work by in-context learning: given a new table as context, they predict for query samples in a single forward pass, with no dataset-specific training.

Here, we ask how such a model can best be leveraged for tabular anomaly detection. So far, PFN-based work on the task has taken two routes. One pretrains a dedicated in-context detector on synthetic anomaly-detection tasks (Marszałek et al., 2026; Shen et al., 2025; Ding et al., 2026). The other keeps TabPFN frozen and uses it as a plug-in scorer over its predictions (Prior Labs, 2025; Ding et al., 2026). Adapting a pretrained PFN to the task itself remains mostly unexplored, although adaptation of PFNs has shown some success for supervised learning (Feuer et al., 2024). Notably, adaptation is especially interesting as a detector built by adapting TabPFN would inherit future improvements of the PFNs. Moreover, PFNs are never pretrained to find anomalies, so adapting one also measures how much its representations carry beyond their pretraining objective. This raises the question we study: can a general-purpose tabular foundation model be adapted into a competitive anomaly detector?

This paper shows the answer is yes. We reach it in two steps that adapt TabPFN, first without changing its weights and then by updating them (Figure 1). First, ZEN (Zero-training Embedding Neighbors) scores a test sample by its distance to its nearest neighbors in the frozen model's embedding space. We develop a feature-extraction procedure suited to the task and weight each reference sample by how much it can be trusted, so the score stays reliable even when the reference set is contaminated. Second, FOCUS (Fine-tuned One-Class Unsupervised Scoring) fine-tunes the model so that its features better separate the normal data from anomalies. Our evaluation for the contaminated settings finds that ZEN already reaches a higher mean AUROC than every baseline in our comparison, and FOCUS the highest of all.

References (100)

Couldn't load all references. Reload the page to try again.