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

TOD: Tensor-based Outlier Detection

Yue Zhao, George H. Chen, Zhihao JiaarXiv 2021

Introduction

Outlier detection (OD) is a critical task in data science, used for fraud detection, system health monitoring, and data cleaning. Despite the explosion of deep learning (DL) hardware, classical OD algorithms have largely failed to benefit from GPU acceleration. TOD (Tensor-based Outlier Detection) is the first system to bridge this gap by treating outlier detection as a series of optimized tensor operations, allowing classical algorithms to tap into the massive power of modern hardware.

The Scalability Challenge

Many popular OD methods suffer from high computational complexity, often reaching $O(n^2)$ or $O(n^3)$ in time and space due to pairwise distance calculations. While GPUs are ideal for such parallel tasks, existing implementations are often specialized, "one-off" solutions. There is a lack of a general-purpose framework that can handle diverse OD algorithms on modern GPU clusters without succumbing to "Out of Memory" (OOM) errors on large datasets.

The TOD Framework

TOD introduces a unified system to translate OD algorithms into the language of deep learning infrastructure through three main pillars.

The TOD system architecture, illustrating the flow from programming model to provable quantization and multi-GPU execution.

1. Algorithmic Abstraction

TOD decomposes complex OD algorithms into a hierarchy of operators. It identifies Basic Tensor Operators (BTOs)—such as matrix distance (cdist), top-k selection (topk), and singular value decomposition (SVD)—which are then assembled into Functional Operators (FOs) like k-Nearest Neighbors or density estimation. This allows OD to inherit a decade's worth of optimization in GPU kernels.

Hierarchy of outlier detection algorithms decomposed into Basic Tensor Operators (BTOs) and Functional Operators (FOs).

2. Provable Quantization

To mitigate the limited VRAM of GPUs, TOD employs a "provable quantization" strategy. It performs computations in lower precision (16-bit or 32-bit) to save memory and increase speed. To ensure accuracy, TOD uses mathematical error-bounding to verify results. If a rounding error could potentially alter the final ranking or outcome, the system selectively re-calculates those specific elements in 64-bit precision. This provides the speed of low precision with the guaranteed accuracy of high precision.

3. Automatic Batching and Multi-GPU Support

To scale beyond the memory limits of a single GPU, TOD automatically partitions data into batches. It utilizes operator fusion to minimize the movement of large intermediate matrices between CPU and GPU memory, effectively preventing OOM crashes on datasets with millions of samples.

Evaluation and Results

The researchers evaluated TOD against PyOD (the industry-standard CPU library) using 11 real-world benchmarks (e.g., MNIST, CIFAR-10) and 3 synthetic datasets.

  • Performance: TOD achieved an average 10.9x speedup over PyOD, with specific algorithms reaching up to 38.9x faster execution.
  • Scalability: TOD successfully processed 1.5 million samples in under an hour, whereas existing GPU baselines failed due to memory constraints.
  • Efficiency: Provable quantization reduced GPU memory usage by approximately 70% while maintaining 100% accuracy relative to 64-bit implementations.
  • Distributed Scaling: The system showed near-linear scaling (over 90% efficiency) in multi-GPU environments.

Conclusion and Future Work

TOD demonstrates that OD algorithms can be effectively reimagined as tensor algebra. By leveraging DL optimizations like quantization and batching, TOD enables classical OD to scale to massive datasets. Future work includes extending support to tree-based algorithms (like Isolation Forests) and optimization-based methods (like One-Class SVM), as well as exploring approximate nearest neighbor searches for even greater scalability.

The library is available as an open-source project named pytod.

Summary updated

BibTeX
@misc{zhao2021tod,
  author = {Yue Zhao and George H. Chen and Zhihao Jia},
  title = {{TOD: Tensor-based Outlier Detection}},
  year = {2021},
  eprint = {2110.14007},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2110.14007},
}
Figure