TripletAD: Weakly Supervised Anomaly Detection in Embedding Space with Rare Anomalies and Scarce Labels
Abstract
As AI and agentic systems automate more processes with less human review, data is increasingly represented, and passed between systems, as embeddings produced by pre-trained models. Detecting rare deviations in these embeddings is becoming a critical guardrail, yet anomaly detection methods were largely developed for hand-built tabular features, where gradient-boosted trees remain the method of choice. We propose TripletAD, a weakly supervised detector for embedding spaces in which anomalies are rare. TripletAD learns a triplet-margin embedding in which every triplet contains an anomaly, so the few anomalies are reused across the entire training set instead of being diluted by it, and calibrates a linear scoring head with a partial cross-entropy on anomalies and a relative-contrast hinge that separates the mean scores of anomalous and normal samples. Across 28 embedding datasets spanning text, images, speech and industrial inspection, TripletAD is consistently among the best-performing methods, matching or exceeding established state-of-the-art weakly supervised detectors (DevNet, PReNet and DeepSAD), supervised contrastive learning and gradient-boosted trees, and it outperforms them when anomalies are rare. On naturally rare speech data it is 43% above the strongest baseline and more than twice the established detectors; at a 1% anomaly rate it has the highest mean AUCPR of seven methods, 20% above DevNet; and pooled over 74 rare-anomaly settings it has the best average rank, with statistically significant gains over every baseline. In a case study on AI-agent traces, it locates the failing step more often than all six baselines, with accuracy on par with or above that reported for frontier LLM judges, at 0.17 ms per step. The method needs no per-dataset tuning and is insensitive to its loss weights and training length.
Create a lesson
Related papers
MambaPD: Bidirectional Selective State Space Model for Parkinson's Disease Detection from Resting-State EEG
Shared title terminology · Ayesha Zulfiqar
Boundary Mass in Feature Space as a Label-Budget Diagnostic for Representations
Shared title terminology · Siming Zhang, Zhehui Shen, Shijie Chen et al.
PIA: Agentic Physics-Informed Runtime Anomaly Detection
Shared title terminology · Ali Mohammadi Ruzbahani, Abbas Yazdinejad, Hadis Karimipour
Self-contained Data Cleaning for Unsupervised Anomaly Detection
Shared title terminology · Jordan F. Masakuna, Ahmed Yacine, Djeff K. Nkashama et al.
Spectrogram-Based CNN Autoencoder for One-Class Anomaly Detection in Machining Vibration Signals
Shared title terminology · Sebastian Zeleny, Christian Gawron
FedSGN: Federated Sparse Grassmann Newton Learning for IoT Anomaly Detection
Shared title terminology · Jingjing Liu, Xiansen Ju, Xianchao Xiu et al.