Abstract
Outlier detection (OD) has a vast literature as it finds numerous real-world applications. Being an unsupervised task, model selection is a key bottleneck for OD without label supervision. Despite a long list of available OD algorithms with tunable hyperparameters, the lack of systematic approaches for unsupervised algorithm and hyperparameter selection limits their effective use in practice. In this paper, we present FoMo-0D, a pre-trained Foundation Model for zero/0-shot OD on tabular data, which bypasses the hurdle of model selection altogether. Having been pre-trained on synthetic data, FoMo-0D can directly predict the (outlier/inlier) label of test samples without parameter fine-tuning—requiring no labeled data, and no additional training or hyperparameter tuning when given a new task. Extensive experiments on 57 real-world datasets against 26 baselines show that FoMo-0D is highly competitive; outperforming the majority of the baselines with no statistically significant difference from the 2nd best method. Further, FoMo-0D is efficient in inference time requiring only 7.7 ms per sample on average, with at least 7x speed-up compared to previous methods.
Introduction
Outlier detection (OD) is a critical task in fields ranging from fraud detection to medical diagnosis. However, it suffers from a major bottleneck: because it is usually an unsupervised task, practitioners lack labels to determine which algorithm or hyperparameter (HP) setting is actually effective. In supervised learning, a validation set can be used to tune a model; in OD, practitioners often rely on "default" settings or heuristics, which frequently fail because OD performance is notoriously sensitive to HPs (such as the $k$ in k-Nearest Neighbors).
FoMo-0D aims to make model selection obsolete by creating a foundation model that works "out of the box" on unseen datasets without any additional training or tuning. By shifting the computational burden to a one-time offline pre-training phase, FoMo-0D enables zero-shot scoring on new real-world datasets.
Methodology
The core of FoMo-0D is the Prior-data Fitted Network (PFN) paradigm. Instead of training on specific real-world data, the model is trained on a massive scale of synthetic data generated from a mathematical "prior."
The Data Prior and Synthesis
The model learns the characteristics of "normal" data by observing millions of datasets generated from Gaussian Mixture Models (GMMs). Outliers are simulated as points that fall into low-probability regions or exist in "inflated" subspaces. To manage the computational cost of generating 1.6 million unique datasets, the authors use linear transformations ($Wx + b$) to "spin" and "stretch" existing synthetic datasets, creating new distributions 20x faster than re-sampling from scratch.
Architecture and In-Context Learning
FoMo-0D utilizes a Transformer-based architecture that treats the training data as "context." It employs In-Context Learning (ICL) to predict the outlier score of a test point by comparing it to provided unlabeled inlier data.
To handle large datasets, the authors address the quadratic complexity ($O(n^2)$) of standard Transformers by implementing a "router mechanism." This mechanism learns a small number of representatives to aggregate information, effectively reducing complexity to linear time ($O(n)$).
Experimental Evaluation
Datasets
The model was pre-trained on 1.6 million synthetically generated datasets based on GMMs with varying dimensions (up to $D=100$). For evaluation, it was tested on 57 real-world datasets from the ADBench benchmark, covering domains like healthcare, finance, and astronautics. Additionally, the model's Out-of-Distribution (OOD) generalization was tested on OpenOOD, an ImageNet-level benchmark, using embeddings from pre-trained computer vision models.
Key Results
- Competitive Performance: Across 57 datasets, FoMo-0D performed on par with the second-best baseline (a heavily tuned kNN) and outperformed the majority of the 26 other baselines. On datasets with dimensions $d \leq 100$, there was no statistically significant difference between FoMo-0D and the best manually tuned models.
- Inference Speed: FoMo-0D is highly efficient, requiring only 7.7 ms per sample on average. This represents a 7x speedup over traditional methods that require model re-training or complex tree-building for every new task.
- Zero-Shot Generalization: The model maintained strong performance even on ImageNet-level OOD tasks, demonstrating that a relatively simple prior (GMMs) is sufficient to learn a generalized concept of an anomaly that applies to complex real-world distributions.
Discussion and Future Work
FoMo-0D demonstrates that synthetic data can be sufficient for training models that generalize to real-world distributions. By operating in a zero-shot manner, it moves the burden of work from the end-user to the pre-training phase.
However, limitations remain. The current model is trained primarily on continuous data; incorporating discrete feature priors could improve performance on categorical tabular data. Furthermore, while GMMs proved effective, more complex priors like Structural Causal Models (SCMs) or Bayesian Neural Networks could capture more intricate data dependencies. Future work will also focus on scaling the context size to even larger datasets and incorporating ethical metrics such as fairness and bias detection.
Summary updated