Tabular anomaly detection (TAD) aims to identify samples that deviate from the majority in tabular data and is critical in many real-world applications. However, existing methods follow a ``one model for one dataset (OFO)'' paradigm, which relies on dataset-specific training and thus incurs high computational cost and yields limited generalization to unseen domains. To address these limitations, we propose OFA-TAD, a generalist one-for-all (OFA) TAD framework that only requires one-time training on multiple source datasets and can generalize to unseen datasets from diverse domains on-the-fly. To realize one-for-all tabular anomaly detection, OFA-TAD extracts neighbor-distance patterns as transferable cues, and introduces multi-view neighbor-distance representations from multiple transformation-induced metric spaces to mitigate the transformation sensitivity of distance profiles. To adaptively combine multi-view distance evidence, a Mixture-of-Experts (MoE) scoring network is employed for view-specific anomaly scoring and entropy-regularized gated fusion, with a multi-strategy anomaly synthesis mechanism to support training under the one-class constraint. Extensive experiments on 34 datasets from 14 domains demonstrate that OFA-TAD achieves superior anomaly detection performance and strong cross-domain generalizability under the strict OFA setting. The source code is available at https://github.com/Shiy-Li/OFA-TAD.
Figures & tables
Figure 1: The difference between OFO and OFA paradigm.
Figure 2: The distance varies in different transformations, where R: Raw, S: Standardized, and Q: Quantile.
Figure 3: The pipeline of OFA-TAD. First, the multi-view distance encoding module extracts normalized neighbor-distance profiles from multiple transformation-induced metric spaces to obtain transferable representations. Then, the Mixture-of-Experts (MoE) scoring network leverages view-specific experts and an entropy-regularized gating mechanism to adaptively fuse distance-based anomaly evidence. A multi-strategy anomaly synthesis module is employed to generate diverse pseudo-anomalies for model training.
Dataset
LOF
KNN
iForest
DSVDD
AE
MCM
LUNAR
DRL
DisentAD
OFA-TAD
In-Domain Target Datasets
abalone
0.7284
0.7997
0.7371
0.6756
0.8014
0.7450
0.8084
0.8071
0.7789
0.8178
arrhythmia
0.8075
0.8014
0.7931
0.7566
0.7260
0.7848
0.7623
0.7467
0.7567
0.8095
breastw
0.9776
0.9764
0.9975
0.9913
0.9778
0.9977
0.9836
0.9949
0.9960
0.9791
cardio
0.9374
0.9062
0.9352
0.9571
0.9500
0.8710
0.9121
0.9431
0.9480
0.9322
census
0.5451
0.6751
0.6364
0.6916
0.6916
0.6696
0.6565
0.5914
0.8345
0.6955
Table 1: AUROC comparison between baselines and OFA-TAD. The best results are highlighted in bold .
Figure 4: Average rank of different methods across 34 datasets.
Variant
AUROC
AUPRC
F1
OFA-TAD
0.8345
0.6629
0.6352
w/o Gating
0.8218
0.6498
0.6211
w/o MoE
0.8204
0.6448
0.6177
w/o Attention
0.8187
0.6383
0.6029
w/o Position
0.8281
0.6404
0.6124
w/o Noise Inject
0.8203
0.6011
0.5788
Table 2: Ablation results w.r.t. average AUROC, AUPRC, and F1.
Figure 5: Performance with varying context nodes.
Figure 6: Gating weight heatmaps across datasets.
Figure 7: model scaling laws on data size.
Appendix figures & tables11 assets
Supplementary material from the paper’s appendix.
Appendix
Dataset
Category
Train
Test
# Samples
# Features
# Anomaly
% Anomaly
In-domain datasets
satellite
Astronautics
✓
-
6435
36
2036
31.64
satimage-2
Astronautics
-
✓
5803
36
71
1.22
shuttle
Astronautics
-
✓
49097
9
3511
7.15
vertebral
Biology
✓
-
240
6
30
12.50
yeast
Biology
-
✓
1484
8
507
34.16
Appendix
Table 3: The statistics of in-domain datasets.
Dataset
Category
Train
Test
# Samples
# Features
# Anomaly
% Anomaly
Out-of-domain datasets
cover
Botany
-
✓
286048
10
2747
0.96
Wilt
Botany
-
✓
4819
5
257
5.33
SpamBase
Document
-
✓
4207
57
1679
39.91
campaign
Finance
-
✓
41188
62
4640
11.27
fraud
Finance
-
✓
284807
29
492
0.17
Appendix
Table 4: The statistics of out-of-domain datasets.
Dataset
LOF
KNN
iForest
DSVDD
AE
MCM
LUNAR
DRL
DisentAD
OFA-TAD
In-Domain Target Datasets
abalone
0.8273
0.8799
0.8496
0.8056
0.8856
0.8602
0.8839
0.8862
0.8700
0.8903
arrhythmia
0.6114
0.6034
0.5769
0.5091
0.3999
0.5832
0.5677
0.5676
0.5396
0.6212
breastw
0.9532
0.9962
0.9973
0.9894
0.9670
0.9977
0.9689
0.9945
0.9961
0.9740
cardio
0.7599
0.7663
0.7886
0.8425
0.8194
0.5593
0.7826
0.8117
0.8085
0.8058
census
0.1175
0.1626
0.1451
0.1905
0.2074
0.1650
0.1654
0.1500
0.4003
0.1748
Appendix
Table 5: AUPRC comparison between baselines and OFA-TAD. The best results are highlighted in bold .
Dataset
LOF
KNN
iForest
DSVDD
AE
MCM
LUNAR
DRL
DisentAD
OFA-TAD
In-Domain Target Datasets
abalone
0.7785
0.8107
0.7710
0.7395
0.8140
0.7720
0.8154
0.8131
0.7957
0.8229
arrhythmia
0.5758
0.5909
0.5909
0.5121
0.4848
0.5758
0.5780
0.5061
0.5152
0.6061
breastw
0.9456
0.9749
0.9816
0.9682
0.9414
0.9749
0.9526
0.9782
0.9707
0.9439
cardio
0.6705
0.6818
0.6708
0.7477
0.7273
0.5254
0.6955
0.7375
0.7364
0.7205
census
0.0592
0.1447
0.1112
0.2025
0.2228
0.1576
0.1620
0.1542
0.4044
0.1593
Appendix
Table 6: F1 comparison between baselines and OFA-TAD. The best results are highlighted in bold .
Figure 8: Average rank under F1 across target datasets (the lower the better).
Source Size
Valid Trials
Mean AUROC
Std
2
21
82.44
0.10
3
30
82.74
0.17
4
30
82.85
0.15
5
21
82.98
0.15
Appendix
Table 7: Source-combination robustness over random trials (measured by AVG AUROC %).
Dataset
OFA-TAD
w/o G
w/o MoE
w/o A
w/o P
w/o N
w/o E
w/o I
w/o M
In-Domain Target Datasets
abalone
0.8178
0.8165
0.8103
0.8144
0.8065
0.8028
0.8055
0.8078
0.8008
arrhythmia
0.8095
0.8114
0.8092
0.8038
0.8059
0.7980
0.7997
0.8078
0.7979
breastw
0.9791
0.9959
0.9964
0.9955
0.9950
0.9736
0.9627
0.9785
0.9827
cardio
0.9322
0.9536
0.9559
0.9548
0.9247
0.9152
0.9225
0.9358
0.9314
census
0.6955
0.6895
0.6923
0.6858
0.6964
0.6907
0.6892
0.6932
0.6993
Appendix
Table 8: Ablation results w.r.t. per-dataset AUROC. The best results are highlighted in bold , where G: gating, A: attention, P: position, N: noise injection, E: extrapolation, I: interpolation, M: masking.
Dataset
OFA-TAD
w/o G
w/o MoE
w/o A
w/o P
w/o N
w/o E
w/o I
w/o M
In-Domain Target Datasets
abalone
0.8903
0.8905
0.8879
0.8895
0.8822
0.8763
0.8760
0.8827
0.8791
arrhythmia
0.6212
0.6298
0.6294
0.5856
0.6088
0.5712
0.5706
0.6153
0.5846
breastw
0.9740
0.9958
0.9964
0.9951
0.9941
0.9480
0.9346
0.9743
0.9774
cardio
0.8058
0.8358
0.8436
0.8413
0.7950
0.7006
0.7151
0.8097
0.8075
census
0.1748
0.1703
0.1724
0.1688
0.1757
0.1696
0.1694
0.1731
0.1808
Appendix
Table 9: Ablation results w.r.t. per-dataset AUPRC. The best results are highlighted in bold , where G: gating, A: attention, P: position, N: noise injection, E: extrapolation, I: interpolation, M: masking.
Dataset
OFA-TAD
w/o G
w/o MoE
w/o A
w/o P
w/o N
w/o E
w/o I
w/o M
In-Domain Target Datasets
abalone
0.8229
0.8214
0.8155
0.8188
0.8111
0.8085
0.8128
0.8136
0.8082
arrhythmia
0.6061
0.6263
0.6212
0.6061
0.5788
0.5606
0.5788
0.5879
0.5697
breastw
0.9439
0.9749
0.9749
0.9735
0.9741
0.9540
0.9372
0.9397
0.9573
cardio
0.7205
0.7424
0.7443
0.7462
0.7080
0.6875
0.7034
0.7284
0.7239
census
0.1593
0.1509
0.1545
0.1506
0.1591
0.1445
0.1453
0.1564
0.1722
Appendix
Table 10: Ablation results w.r.t. per-dataset F1. The best results are highlighted in bold , where G: gating, A: attention, P: position, N: noise injection, E: extrapolation, I: interpolation, M: masking.
Figure 9: Performance with varying context size on the rest of target datasets.
Figure 10: Gating weights on additional target datasets.
Anomaly detection on tabular data is commonly studied under three supervision regimes, including one-class settings that assume access to anomaly-free training samples, fully unsupervised settings with unlabeled and potentially contaminated training data, and semi-supervised settings with limited anomaly labels. Existing deep learning approaches typically train dataset-specific models under the assumption of a single supervision regime, which limits their ability to leverage shared structures across anomaly detection tasks and to adapt to different supervision levels. We propose ICLAD, an in-context learning foundation model for tabular anomaly detection that generalizes across both datasets and supervision regimes. ICLAD is trained via meta-learning on synthetic tabular anomaly detection tasks, and at inference time, the model assigns anomaly scores by conditioning on the training set without updating model weights. Comprehensive experiments on 57 tabular datasets from ADBench show that our method achieves state-of-the-art performance across three supervision regimes, establishing a unified framework for tabular anomaly detection.
Jack Yi Wei, Narges Armanfard
Department of Electrical and Computer Engineering, McGill University, Canada · Mila - Quebec Artificial Intelligence Institute, Montreal, Canada
Unsupervised tabular anomaly detection (TAD) aims to identify anomalous rows in tabular data using normal training samples. While conventional methods rely on dataset-specific training and configuration search, recent tabular foundation models (TFMs) enable zero-shot anomaly detection on unseen datasets via in-context learning. Most TFM-based approaches, however, require anomaly-specific pretraining from scratch, making detection inherently dependent on synthetic TAD-specific priors and costly to update. Some approaches instead repurpose pretrained general-purpose TFMs for TAD to avoid this burden, but rely on computationally expensive formulations with restrictive anomaly inductive biases. In this work, we introduce TaskBridge, a new framework that efficiently repurposes pretrained general-purpose TFMs for unsupervised TAD by constructing virtual supervised tasks that directly recast anomaly detection as supervised in-context inference of TFMs. The resulting virtual tasks induce predictive structures under which normal queries and their target pairs receive high support, whereas anomalies tend to violate the induced structures and receive lower support, providing direct anomaly evidence. Across 790 real-world datasets, TaskBridge consistently outperforms 30 baselines, including state-of-the-art TFM-based approaches, without anomaly-specific TFM pretraining or dataset-specific model optimization.
Tabular anomaly detection (TAD), which focuses on identifying abnormal samples that deviate from the majority in tabular data, has received growing attention. Recently, there has been an emerging trend towards unified TAD, which seeks to detect anomalies across different datasets using a single generalizable model. In unified TAD, aligning heterogeneous data remains challenging. While existing methods often rely on distance-based unified feature construction, they may obscure the semantics of the original features. Moreover, existing approaches typically formulate anomaly detection as a binary classification task, which may overlook diverse anomaly patterns from various datasets and be misled by unrepresentative synthetic anomalies. To address these challenges, we propose an in-COntext REconstruction approach for unified TAD (CORE for short). It introduces a decorrelated feature alignment module to directly align heterogeneous features into a unified representation space, which retains their semantic information. Meanwhile, CORE formulates unified TAD as an in-context reconstruction problem, eliminating the need for labeled or synthesized anomalies. Specifically, the in-context reconstruction module reconstructs each sample by leveraging contextual normal samples to capture dataset-specific distributions, such that reconstruction errors reflect its deviation from normality, facilitating unified TAD on arbitrary unseen datasets.
Yunfeng Zhao, Qingfeng Chen, Yue Tan +4
1Guangxi University · 2Griffith University · 3Jilin University