SPOT-FM: A Zero-Shot Hypothesis Test for Tabular Anomalies via In-Context Synthetic Contrasts

Mayank Jauhari, Amir Raza, Abishek Sankararaman, Anurag Tripathi, Vipul Joshi, Vikash Sharma, Boris N. OreshkinHypothesis Testing @ ICML 2026

In the world of machine learning, tabular data is the "bread and butter" of industry, yet it remains one of the hardest domains to generalize. While Large Language Models (LLMs) have mastered zero-shot reasoning for text, Anomaly Detection (AD) for tables usually requires a "fit-per-dataset" approach—training a brand-new model every time you encounter a new schema.

A new paper from researchers at Amazon and AWS, titled SPOT-FM, introduces a "Foundation Model" approach that treats tabular anomaly detection as a zero-shot hypothesis test. By using a frozen transformer and a clever synthetic contrast sampler, they’ve created a system that can spot outliers in datasets it has never seen before, with no training required at deployment.

TL;DR

SPOT-FM is a zero-shot foundation model that detects anomalies in tabular data without any per-dataset training or hyperparameter tuning. By framing anomaly detection as a composite hypothesis test and using a novel "minimal-subset" perturbation strategy, it achieves state-of-the-art results (0.915 AUC-ROC) across 17 benchmarks while being up to 4,000x faster than deep learning baselines.

What Problem Does This Paper Address?

Traditional tabular anomaly detection is a slow, manual process. If you have a new dataset, you typically have to:

  1. Select an algorithm (like Isolation Forest or DeepSVDD).
  2. Perform Hyperparameter Optimization (HPO).
  3. Train the model on your "normal" reference data.

This "fit-per-dataset" paradigm is computationally expensive and hard to scale. Recent "zero-shot" attempts (like FoMo-0D) tried to solve this by pre-training on synthetic data, but they relied on "global" perturbations—essentially adding noise to every feature at once. This fails to catch the most dangerous types of anomalies: unusual combinations of otherwise normal features (e.g., a patient with a normal heart rate and normal blood pressure, but whose combination of the two is medically impossible).

Methods

SPOT-FM (Synthetic Perturbation Outlier Test - Foundation Model) shifts the paradigm by using In-Context Learning (ICL).

1. The Architecture: Tab2D Transformer

The model uses a Tab2D backbone, which features alternating row attention (comparing different samples) and column attention (comparing different features). This allows the model to jointly reason about inter-sample similarity and intra-sample feature interactions.

2. Minimal-Subset Perturbation

The "secret sauce" is how the model is trained to recognize "bad" data. Instead of changing every feature, the authors use a minimal-subset sampler. It perturbs only a small fraction ($\mu$) of features while keeping the rest identical to a "normal" row.

  • Small $\mu$: Creates "hard" negatives that are nearly indistinguishable from normal data.
  • Large $\mu$: Creates "easy" negatives that are clearly outliers.

3. Curriculum Learning

The model undergoes a "curriculum" during pre-training, starting with easy, high-$\mu$ anomalies and gradually moving toward subtle, low-$\mu$ contrasts. This forces the transformer to learn the intricate "boundary structure" of what constitutes a normal relationship between features.

4. Zero-Shot Inference

At test time, the model is frozen. You provide a reference set of normal data ($X_{ref}$) and a query point. The model performs a single tensorized forward pass across a grid of 216 different configurations (varying perturbation strategies and feature permutations) to produce a final anomaly score.

Datasets

  • Pre-training: The model was trained on a massive "prior pool" of 22 synthetic data generators. These include hand-crafted distributions (Gaussian, Mixtures, Heavy-tail), supervised models (XGBoost, Random Forest, kNN), and Structural Causal Models (SCMs).
  • Evaluation: The authors tested SPOT-FM on 17 ODDS (Outlier Detection DataSets) benchmarks, covering diverse domains like medical imaging (Mammography), marketing (Campaign), and pixel patterns (Optdigits).

Key Insights and Ideas

  • Locality is Key: By only perturbing a subset of features, the model learns that anomalies often hide in the correlations between features, not just in the raw values of individual columns.
  • AD as a Hypothesis Test: The authors formally prove that their model acts as a valid statistical test. They establish exchangeability, meaning the order in which you provide the reference data doesn't change the result—a critical property for a robust test statistic.
  • The "Sampler-Label Residual": The paper provides a mathematical decomposition of risk. It identifies that when zero-shot transfer fails, it’s usually because the real-world anomaly mechanism falls outside the "family" of synthetic perturbations the model was trained on.

Key Results

  • Accuracy: SPOT-FM achieved an average 0.915 AUC-ROC and 0.752 AUC-PR across the 17 ODDS benchmarks, outperforming both classical methods (Isolation Forest) and the previous state-of-the-art zero-shot model (FoMo-0D).
  • Speed: Because it requires zero training at test time, inference takes only ~11ms per 1,000 rows on a single V100 GPU. This makes it roughly 4,000x faster than deep learning methods that require per-dataset fitting.
  • Robustness: It showed significant gains on datasets where anomalies violate feature-level regularities, such as medical imaging features (+0.21 ROC on Mammography).

Limitations and Future Work

  • Alternative Hypothesis Coverage: The model's primary limitation is its "power envelope." If an anomaly stays entirely within the "quantile box" of normal data (e.g., a subtle change in the shape of a distribution's tail), SPOT-FM may not have the statistical power to catch it.
  • Heavy-Tail Data: The model slightly underperformed on a few small, heavy-tailed datasets (like Glass and Pima) where the synthetic sampler was less aligned with the real anomaly mechanism.
  • Future Directions: The authors suggest broadening the training mixture with real tabular corpora and exploring anytime-valid inference via e-value calibration, which would allow users to stop the test early once a certain confidence threshold is met.

Summary updated

BibTeX
@inproceedings{jauhari2026spot,
  author = {Mayank Jauhari and Amir Raza and Abishek Sankararaman and Anurag Tripathi and Vipul Joshi and Vikash Sharma and Boris N. Oreshkin},
  title = {{SPOT-FM: A Zero-Shot Hypothesis Test for Tabular Anomalies via In-Context Synthetic Contrasts}},
  booktitle = {Hypothesis Testing @ ICML},
  year = {2026},
  url = {https://openreview.net/forum?id=U30xTGaauJ},
}
Figure