NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

PyOD 2: A Python Library for Outlier Detection with LLM-powered Model Selection

Sihan Chen, Zhuangzhuang Qian, Wingchun Siu, Xingcan Hu, Jiaqi Li, Shawn Li, Yuehan Qin, Tiankai Yang, Zhuo Xiao, Wanghao Ye, Yichi Zhang, Yushun Dong, Yue Zhao

Abstract

Outlier Detection (OD) is a critical task across numerous domains, yet the proliferation of algorithms creates a significant "expertise gap" for practitioners. PyOD 2 addresses this by unifying modern deep learning models under a single PyTorch framework and introducing an LLM-powered "AutoModelSelector." This system analyzes dataset statistics and model metadata to automatically recommend optimal algorithms. Empirical evaluations on the ADBench benchmark demonstrate that this automated approach significantly outperforms manual selection and individual state-of-the-art models, achieving a superior average AUROC rank of 2.4118.

1. Introduction

Outlier Detection (OD)—the identification of rare events or items that deviate significantly from the majority of data—is essential for applications ranging from fraud detection to network security. While the original PyOD library established itself as a global standard, it faced three primary challenges: a lack of support for the latest deep learning models, framework fragmentation between PyTorch and TensorFlow, and an "expertise gap" where users struggle to select the right algorithm from dozens of options. PyOD 2 bridges these gaps by providing a unified deep learning backend and an automated, interpretable selection pipeline.

2. Methodology

PyOD 2 introduces two primary technical advancements: a unified PyTorch backend and an LLM-driven selection pipeline.

2.1 Unified PyTorch Backend

The library refactors 12 state-of-the-art deep learning models—including LUNAR, DevNet, and various GAN-based detectors—into a consistent PyTorch framework. By utilizing a standardized base_dl class, PyOD 2 ensures a uniform API, facilitating easier training, evaluation, and deployment across different hardware accelerators.

2.2 LLM-Powered Model Selection

The core innovation of PyOD 2 is a three-step automated selection pipeline designed to bridge raw data statistics with high-level algorithmic theory:

  1. Model Profiling: GPT-4o is employed to analyze research literature and source code, extracting "symbolic tags" that define model strengths (e.g., "effective for high-dimensional data").
  2. Dataset Profiling: The system calculates statistical metrics (skewness, kurtosis, noise) of the target dataset, which the LLM then maps to descriptive tags (e.g., "imbalanced data").
  3. Symbolic-Neural Reasoning: The system matches dataset tags against model profiles, ranking candidates and performing a final reasoning step to weigh trade-offs and select the optimal model.
The full three-step PyOD 2 pipeline for automated model selection, integrating model profiling, dataset profiling, and symbolic-neural reasoning.

3. Experimental Evaluation

The performance of the AutoModelSelector was evaluated using ADBench, a comprehensive benchmark comprising 17 diverse datasets. These datasets span various domains, including medical (cardio, arrhythmia), image/digit (MNIST, optdigits), and industrial (satellite, shuttle) data.

3.1 Results and Insights

The automated selector was compared against standalone models and an "average performance" baseline (representing random choice). The results indicate that the AutoModelSelector achieved the best average AUROC rank (2.4118), significantly outperforming strong individual models such as the AutoEncoder (rank 2.6471) and LUNAR (rank 3.4118).

AUROC Ranking comparison showing that the AutoModelSelector (with and without notes) achieves the highest rank compared to individual models and average performance.

Key insights from the evaluation include:

  • LLMs as Meta-Consultants: The system effectively uses LLMs to interpret domain literature, acting as a bridge between raw statistics and theoretical strengths.
  • Interpretability: Unlike traditional "black-box" AutoML, the pipeline provides a rationale for its decisions, explaining why a specific model was chosen based on dataset characteristics.
  • Zero-Shot Capability: The selector performs robustly using only statistical attributes, though it can incorporate optional user notes for further refinement.

4. Conclusion and Future Work

PyOD 2 represents a major step toward democratizing advanced outlier detection. By combining a unified deep learning framework with LLM-powered reasoning, it reduces the barrier to entry for non-experts while maintaining state-of-the-art performance. Future work will focus on improving scalability for massive streaming datasets, incorporating domain-specific priors, and addressing data drift through adaptive pipelines.

Summary updated

BibTeX
@misc{chen2024pyod,
  author = {Sihan Chen and Zhuangzhuang Qian and Wingchun Siu and Xingcan Hu and Jiaqi Li and Shawn Li and Yuehan Qin and Tiankai Yang and Zhuo Xiao and Wanghao Ye and Yichi Zhang and Yushun Dong and Yue Zhao},
  title = {{PyOD 2: A Python Library for Outlier Detection with LLM-powered Model Selection}},
  year = {2024},
  eprint = {2412.12154},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2412.12154},
}
Figure