Why Does Counterintuitive Likelihood Behavior Rarely Emerge in Tabular Anomaly Detection?
Authors: Donghwan Kim, Junghun Phee, Hyunsoo Yoon
Organizations: Department of Industrial Engineering, University of Yonsei, Republic of Korea, Seoul · H. Milton Stewart School of Industrial and Systems Engineering (ISyE), Georgia Institute of Technology, USA, GA
Deep generative models with tractable likelihoods, exemplified by normalizing flows, offer an effective basis for anomaly detection through likelihood-based scoring. We demonstrate that, unlike in the image domain where deep generative models frequently assign higher likelihoods to anomalous data, such counterintuitive behavior occurs rarely in tabular settings. We first introduce a domain-agnostic formulation that enables consistent detection and evaluation of the counterintuitive phenomenon, addressing the lack of a precise definition in prior work. Through extensive experiments on 47 tabular datasets benchmarked against 13 baseline models and on 10 CV/NLP embedding datasets from ADBench, we show that the phenomenon is consistently rare in general tabular data and that normalizing flow likelihood achieves competitive anomaly detection performance. We further provide theoretical and empirical analyses attributing this disparity to differences in dimensionality and feature correlation between tabular and image data. Therefore, our results indicate that likelihood-based detection with normalizing flows is a practical approach for tabular anomaly detection.
Figures & tables
Method
AUROC ↑
AUPRC ↑
Avg. Rank ↓
Top2 Cum. Ratio ↑
Fail Ratio ↓
PCA
0.7715
0.5209
7.13
0.15
0.45
LOF
0.8169
0.5606
6.11
0.17
0.26
IF
0.8014
0.5060
6.23
0.19
0.21
OCSVM
0.6562
0.3833
10.34
0.06
0.77
COPOD
0.7471
0.4419
8.40
0.11
0.57
ECOD
0.7425
0.4530
8.74
0.06
0.68
Table 1: (Top): Evaluation performance on 47 tabular datasets. (Bottom): Evaluation performance on 10 CV/NLP embedding datasets. Top2 Cum. Ratio indicates the proportion of datasets where a method ranks within the top-2 in AUROC, and Fail Ratio indicates the proportion where it ranks 9th or lower.
In-dist ( P ) / Out-dist ( Q )
1024
512
256
30
In-dist ( P ) / Out-dist ( Q )
1024
512
256
30
CIFAR-10 / SVHN
0.2311
0.2924
0.2984
0.3143
SVHN / CIFAR-10
0.9917
0.9843
0.9486
0.8520
CIFAR-100 / SVHN
0.0843
0.1160
0.2036
0.3490
SVHN / CIFAR-100
0.9933
0.9536
0.9137
0.8622
CelebA / SVHN
0.1207
0.1782
0.2745
0.4711
SVHN / CelebA
0.9976
0.9811
0.9722
0.9481
Table 2: AUROC scores for likelihood tests as a function of the number of retained independent components using RealNVP with MLP (images preprocessed by ICA). The left block corresponds to H(P)>H(Q) , and the right block corresponds to H(P)<H(Q) .
Figure 1: (Left, Center) : Estimation of ID according to changes in ρ . The x-axis represents the value of ρ and the y-axis represents dimension. The horizontal line represents the ambient dimension. (Right) : Log-scale scatter plot for ID estimate and ambient dimension using the TwoNN method of real dataset and synthetic dataset sampled by N(0,Id) . The estimated ID for the image dataset are from Table 1 in Pope et al. (2021) . The distance recorded in the legend represents the average value of the distance between each point and the green line indicating when the ID estimate and ambient dimension are the same. Each blue/red point corresponds to one ADBench/image dataset.
Dataset
MNIST
CIFAR-10
CIFAR-100
SVHN
MLE
13
26
23
19
TwoNN
15
11
9
7
d -Ratio
0.019
0.004
0.003
0.002
Dataset
magicgamma
satellite
landsat
waveform
MLE
5
9
11
16
TwoNN
7
15
14
17
Table 3: (Top): ID estimates for real datasets. (Bottom): Among the 28 datasets on which NF-SLT ranks ≥3 , the fraction whose d -Ratio falls below each threshold. The d -Ratio is the ratio of the ID (TwoNN) to the ambient dimension. Image-dataset results follow Pope et al. (2021) .
Appendix figures & tables33 assets
Supplementary material from the paper’s appendix.
Appendix
Figure 2: Performance of NF-SLT implemented by NICE across different dimensions. The y-axis represents AUROC, and the x-axis indicates the dimensionality of the data. The titles of each subfigure specify distributions’ parameters. Subplots 1 and 2 have a larger In/Out of Distribution difference than Subplots 3 and 4, and the speed of performance decay as the dimension increases becomes faster as the distribution difference becomes smaller.
Figure 3: Performance of NF-SLT implemented by RealNVP across different dimensions. The y-axis represents AUROC, and the x-axis indicates the dimensionality of the data. The titles of each subfigure specify distributions’ parameters.
Figure 4: Histogram of log-likelihood values for the 1st subfigure in Figure 2
Figure 5: Histogram of log-likelihood values for the 2nd subfigure in Figure 2
Figure 6: Histogram of log-likelihood values for the 3rd subfigure in Figure 2
Figure 7: Histogram of log-likelihood values for the 4th subfigure in Figure 2
Figure 8: Histogram of latent norm values for the 1st subfigure in Figure 3
Figure 9: Histogram of volume values for the 1st subfigure in Figure 3
Figure 10: Histogram of latent norm values for the 3rd subfigure in Figure 3
Figure 11: Histogram of volume values for the 3rd subfigure in Figure 3
In-dist ( P ) / Out-dist ( Q )
1024
512
256
30
In-dist ( P ) / Out-dist ( Q )
1024
512
256
30
CIFAR-10 / SVHN
0.1262
0.0950
0.1729
0.3547
SVHN / CIFAR-10
0.9932
0.9807
0.9460
0.8670
CIFAR-100 / SVHN
0.0668
0.0975
0.2015
0.3410
SVHN / CIFAR-100
0.9926
0.9783
0.9436
0.8723
CelebA / SVHN
0.1598
0.2179
0.2988
0.4728
SVHN / CelebA
0.9969
0.9857
0.9709
0.9389
CIFAR-100 / CIFAR-10
0.4804
0.5058
0.4982
0.5021
CIFAR-10 / CIFAR-100
0.5415
0.5287
0.5257
0.5630
CelebA / CIFAR-10
0.8424
0.8511
0.8344
0.6492
CIFAR-10 / CelebA
0.6350
0.5878
0.6747
0.7326
Appendix
Table 4: AUROC scores for likelihood tests as a function of dimensionality (number of retained principal components) using RealNVP with MLP (images preprocessed by PCA). The left block corresponds to H(P)>H(Q) and the right block corresponds to H(P)<H(Q) .
In-dist ( P ) / Out-dist ( Q )
1024
512
256
30
In-dist ( P ) / Out-dist ( Q )
1024
512
256
30
CIFAR-10 / SVHN
0.2311
0.2924
0.2984
0.3143
SVHN / CIFAR-10
0.9917
0.9843
0.9486
0.8520
CIFAR-100 / SVHN
0.0843
0.1160
0.2036
0.3490
SVHN / CIFAR-100
0.9933
0.9536
0.9137
0.8622
CelebA / SVHN
0.1207
0.1782
0.2745
0.4711
SVHN / CelebA
0.9976
0.9811
0.9722
0.9481
CIFAR-100 / CIFAR-10
0.5133
0.5169
0.5046
0.5037
CIFAR-10 / CIFAR-100
0.4970
0.5081
0.5146
0.5588
CelebA / CIFAR-10
0.8511
0.8501
0.8364
0.6515
CIFAR-10 / CelebA
0.3988
0.4041
0.4692
0.6725
Appendix
Table 5: AUROC scores for likelihood tests as a function of dimensionality (number of retained independent components) using RealNVP with MLP (images preprocessed by ICA). The left block corresponds to H(P)>H(Q) and the right block corresponds to H(P)<H(Q) .
In-dist ( P ) / Out-dist ( Q )
32×32
16×16
8×8
In-dist ( P ) / Out-dist ( Q )
32×32
16×16
8×8
CIFAR-10 / SVHN
0.0716
0.3586
0.4512
SVHN / CIFAR-10
0.9902
0.9777
0.9195
CIFAR-100 / SVHN
0.0846
0.4448
0.3918
SVHN / CIFAR-100
0.9900
0.9798
0.9481
CelebA / SVHN
0.1541
0.3056
0.7037
SVHN / CelebA
0.9850
0.9968
0.9982
CIFAR-100 / CIFAR-10
0.4857
0.4933
0.5016
CIFAR-10 / CIFAR-100
0.5259
0.5446
0.5567
CelebA / CIFAR-10
0.7481
0.7137
0.7557
CIFAR-10 / CelebA
0.5087
0.6181
0.6751
Appendix
Table 6: AUROC scores for likelihood tests as a function of image size using Glow (images resized by bilinear interpolation). The left block corresponds to H(P)>H(Q) , and the right block corresponds to H(P)<H(Q) .
Ratio
1.00
0.95
0.90
0.85
0.80
0.75
NF-SLT
0.8180
0.8561
0.8579
0.8377
0.8246
0.8240
MCM
0.7242
0.7217
0.7189
0.7161
0.7158
0.6978
Appendix
Table 7: AUROC on the InternetAds dataset for NF-SLT and MCM as a function of the retained dimensionality. The ratio denotes the fraction of principal components retained out of 500 PCs (after PCA reduction to 500 dimensions).
Type
Metric
GOAD
DeepSVDD
NeuTraLAD
ICL
MCM
DRL
NF-SLT
Local
AUROC
0.7297
0.9605
0.9664
0.9646
0.9948
0.9545
0.9919
AUPRC
0.7922
0.9678
0.9702
0.9697
0.9953
0.9635
0.9926
Clustered
AUROC
1
1
0.9174
1
1
1
1
AUPRC
1
1
0.8620
1
1
1
1
Global
AUROC
1
1
1
1
1
1
1
AUPRC
1
1
1
1
1
1
1
Appendix
Table 8: Anomaly detection performance across various anomaly types for deep models.
Dataset
DeepSVDD
GOAD
NeuTraLAD
ICL
MCM
DRL
NF-SLT
InternetAds
0.6013 / 7
0.7356 / 5
0.7112 / 6
0.8815 / 1
0.7973 / 3
0.7603 / 4
0.8746 / 2
campaign
0.7929 / 3
0.2837 / 7
0.7814 / 4
0.6933 / 6
0.7987 / 2
0.7525 / 5
0.8059 / 1
census
0.6421 / 3
0.4140 / 6
0.4991 / 5
0.3917 / 7
0.7478 / 1
0.5646 / 4
0.7186 / 2
nsl-kdd
0.8951 / 5
0.9026 / 4
0.9374 / 3
0.8798 / 6
0.8757 / 7
0.9459 / 2
0.9598 / 1
Appendix
Table 9: AUROC on datasets with mostly categorical features. The number after the slash indicates the relative rank among the seven deep models.
Contamination Ratio
annthyroid
cardio
letter
1%
0.9048
0.9032
0.9195
3%
0.8806
0.8797
0.9126
5%
0.8752
0.8621
0.9005
Appendix
Table 10: Contamination sensitivity analysis of NF-SLT.
Method
magicgamma
satellite
landsat
waveform
Wilt
annthyroid
breastw
cover
fault
fraud
TwoNN
7
15
14
17
5
3
4
3
5
4
MLE
5
9
11
16
4
3
4
4
5
8
IPCA
3
2
2
2
1
1
3
1
5
4
Appendix
Table 11: ID estimates from an alternative estimator IPCA alongside TwoNN and MLE on representative tabular datasets.
Ratio
magicgamma
satellite
landsat
waveform
Wilt
annthyroid
breastw
fault
100%
7
15
14
17
5
3
4
5
90%
7
15
14
17
5
3
4
5
80%
7
14
14
17
5
3
4
5
50%
7
14
13
16
5
4
4
4
Appendix
Table 12: Stability of TwoNN ID estimates under different sub-sampling ratios on representative tabular datasets.
Scaler
magicgamma
satellite
landsat
waveform
Wilt
annthyroid
breastw
fault
No Scaler
7
15
14
17
5
3
4
5
Standard Scaler
7
15
14
16
4
5
4
5
Minmax Scaler
7
15
14
17
4
4
5
4
Appendix
Table 13: Sensitivity of TwoNN ID estimates to common feature-scaling choices on representative tabular datasets.
Model
Hyperparameter search space
PCA
ncomponent_ratio∈{0.75,0.8,0.85,0.9,0.95}
LOF
N∈{1,3,5,10,20}
IF
N∈{30,50,100,200,400}
OCSVM
kernel ∈{linear,rbf}
COPOD
None
ECOD
None
Appendix
Table 14: Hyperparameter search space for each model. η denotes the learning rate.
Model
Optimal hyperparameter
PCA
ncomponent_ratio=0.8
LOF
N=20
IF
N=400
OCSVM
kernel =linear
COPOD
None
ECOD
None
Appendix
Table 15: Optimal hyperparameter combination for each model.
Method
AUROC Diff
Avg Rank Diff
Fail Ratio Diff
DeepSVDD
0.0366
-1.02
-0.21
GOAD
0.1124
-0.68
-0.04
NeuTraLAD
0.0310
-0.53
-0.06
ICL
0.0284
-0.40
-0.15
MCM
0.0302
-0.96
-0.04
DRL
0.0233
-0.32
-0.02
Appendix
Table 16: Hyperparameter sensitivity of deep models. The columns that represent differences represent the differences between the indicators in Table 20 and Table 1 . If it is sensitive to changes in hyperparameters, there will be a large difference in performance when experiments are performed with the optimal hyperparameter combination in the hyperparameter searching space for each dataset, compared to when experiments are performed with the same hyperparameter combination for all datasets.
Model
AUROC ↑
AUPRC ↑
Avg. Rank ↓
Top2 Cum. Ratio ↑
Fail Ratio ↓
NICE
0.8575
0.6398
3.74
0.40
0.06
RealNVP
0.8480
0.6385
4.45
0.30
0.09
Appendix
Table 17: Performance comparison between NICE and RealNVP
Model
Ionosphere
Lymphography
WPBC
thyroid
yeast
glass
pendigits
NICE
0.9581
0.9746
0.5051
0.9840
0.4652
0.8867
0.9930
MAF
0.8406
0.9908
0.5070
0.9752
0.4359
0.7677
0.9926
Appendix
Table 18: Performance comparison between NICE and MAF
Model
AUROC ↑
AUPRC ↑
Avg. Rank ↓
Top2 Cum. Ratio ↑
Fail Ratio ↓
SLT
0.8575
0.6398
3.74
0.40
0.06
Typicality Test
0.8184
0.6270
5.83
0.26
0.30
Appendix
Table 19: Performance comparison between SLT and the typicality test
Method
AUROC ↑
AUPRC ↑
Avg. Rank ↓
Top2 Cum. Ratio ↑
Fail Ratio ↓
PCA
0.7752
0.5240
7.60
0.09
0.51
LOF
0.8447
0.5979
6.15
0.23
0.36
IF
0.8036
0.5099
6.85
0.17
0.36
OCSVM
0.6651
0.3895
10.51
0.04
0.77
COPOD
0.7471
0.4419
9.06
0.06
0.66
ECOD
0.7425
0.4530
9.45
0.04
0.70
Appendix
Table 20: AUROC and AUPRC performance under per-dataset optimal hyperparameter selection.
Dataset
PCA
LOF
IF
OCSVM
COPOD
ECOD
ALOI
0.5492
0.6971
0.5418
0.5038
0.5153
0.5304
Cardiotocography
0.8248
0.7207
0.8150
0.7349
0.6625
0.7856
Hepatitis
0.8145
0.8249
0.7753
0.5905
0.7986
0.7473
InternetAds
0.7012
0.8276
0.4242
0.3755
0.6764
0.6770
Ionosphere
0.9037
0.9550
0.9141
0.5439
0.7975
0.7328
Lymphography
0.9923
0.9843
0.9972
0.8761
0.9986
0.9974
Appendix
Table 21: AUROC performance of shallow models.
Dataset
DAGMM
DeepSVDD
GOAD
NeuTraLAD
ICL
MCM
DRL
NF-SLT
ALOI
0.5024
0.5653
0.5319
0.5700
0.5892
0.4831
0.5858
0.5479
Cardiotocography
0.6067
0.6759
0.3689
0.7626
0.6221
0.5713
0.6862
0.7558
Hepatitis
0.6167
0.6844
0.6054
0.6516
0.6070
0.7985
0.7735
0.7475
InternetAds
0.5590
0.6013
0.7356
0.7112
0.8815
0.7973
0.7603
0.8746
Ionosphere
0.6580
0.9597
0.9459
0.9708
0.9556
0.9574
0.9660
0.9581
Lymphography
0.8643
0.9756
0.9847
0.9779
0.9624
0.9934
0.9847
0.9746
Appendix
Table 22: AUROC performance of deep models.
Dataset
PCA
LOF
IF
OCSVM
COPOD
ECOD
ALOI
0.0711
0.1334
0.0649
0.0592
0.0607
0.0637
Cardiotocography
0.7324
0.6321
0.7085
0.5931
0.5516
0.6598
Hepatitis
0.6398
0.6612
0.5448
0.4062
0.5783
0.4707
InternetAds
0.5689
0.7937
0.2782
0.2448
0.6206
0.6216
Ionosphere
0.9223
0.9609
0.9252
0.7024
0.7988
0.7743
Lymphography
0.8923
0.8121
0.9741
0.6735
0.9830
0.9717
Appendix
Table 23: AUPRC performance of shallow models.
Dataset
DAGMM
DeepSVDD
GOAD
NeuTraLAD
ICL
MCM
DRL
NF-SLT
ALOI
0.0589
0.1186
0.0749
0.0937
0.1058
0.0578
0.1163
0.0831
Cardiotocography
0.4520
0.6307
0.3829
0.6679
0.5864
0.5245
0.6272
0.6742
Hepatitis
0.4622
0.5382
0.4831
0.3848
0.3773
0.5708
0.5664
0.5310
InternetAds
0.3792
0.4077
0.5967
0.4142
0.8345
0.7551
0.6564
0.8399
Ionosphere
0.7007
0.9702
0.9615
0.9761
0.9673
0.9705
0.9731
0.9676
Lymphography
0.5683
0.7607
0.8225
0.7839
0.7166
0.9187
0.8244
0.7691
Appendix
Table 24: AUPRC performance of deep models.
Dataset
PCA
LOF
IF
OCSVM
COPOD
ECOD
ALOI
0.0012
0.0031
0.0025
0.0007
0.0009
0.0008
Cardiotocography
0.0055
0.0208
0.0114
0.0106
0.0046
0.0051
Hepatitis
0.0137
0.0284
0.0341
0.0431
0.0275
0.0373
InternetAds
0.0334
0.0070
0.0526
0.0094
0.0045
0.0044
Ionosphere
0.0153
0.0106
0.0162
0.0667
0.0217
0.0161
Lymphography
0.0061
0.0072
0.0036
0.1011
0.0028
0.0031
Appendix
Table 25: Standard deviation of the AUROC for shallow models.
Dataset
DAGMM
DeepSVDD
GOAD
NeuTraLAD
ICL
MCM
DRL
NF-SLT
ALOI
0.0182
0.0085
0.0030
0.0096
0.0158
0.0063
0.0131
0.0017
Cardiotocography
0.0939
0.0109
0.0144
0.0157
0.0314
0.0141
0.0336
0.0169
Hepatitis
0.0835
0.0753
0.0582
0.0815
0.0963
0.0200
0.0664
0.0787
InternetAds
0.0430
0.0213
0.0442
0.0179
0.0150
0.0013
0.0181
0.0114
Ionosphere
0.0788
0.0075
0.0164
0.0054
0.0082
0.0011
0.0072
0.0085
Lymphography
0.1437
0.0111
0.0087
0.0210
0.0150
0.0020
0.0099
0.0120
Appendix
Table 26: Standard deviation of the AUROC for deep Models
Anomaly detection in tabular data is challenging because abnormal samples often arise as violations of cross-feature dependencies rather than simple marginal deviations. Existing detectors rely on geometric or reconstruction signals, while prior LLM-based approaches mainly fine-tune LLMs with normal samples or generate synthetic anomalies. We propose LLM-Detector, a framework that utilizes the in-context learning capacity of LLMs for structured, prompt-conditioned scoring synthesis, enabling LLMs to derive anomaly detection logic from structured normal-state knowledge. Specifically, normal training data are converted into statistical summaries, causal dependencies, and distilled prototypes that are organized into a prompt for code generation. The resulting scoring engine evaluates statistical deviation, structural inconsistency, and density-based abnormality then computes an anomaly score for each test sample. We evaluate LLM-Detector on 24 tabular datasets, comparing against 15 SOTA baselines. Results show consistent improvements across both mixed-type and continuous-only settings. Moreover, this design eliminates the need for LLM fine-tuning or neural network training, reducing computational cost and enabling practical anomaly detection in real-world tabular systems.
Tu Anh Hoang Nguyen, Dang Nguyen, Thuc Duy Le +2
Applied Artificial Intelligence Initiative (A2I2), Deakin University, Australia · Adelaide University, Australia · Monash University, Australia
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 deploy- ment, 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 sam- ple 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.
Maximilian Bershtman, Niv Cohen
Faculty of Electrical and Computer Engineering Technion – Israel Institute of Technology Haifa, Israel
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