Subspace method improves detection of unusual words in text

SIM: Subspace Interaction-based Method for Token-Level Text Anomaly Detection

Machine Learning

Summary

Detecting odd or suspicious words inside a piece of text can help catch spam or fake news faster. Existing systems mostly score entire documents, missing subtle problems in single words because they blur details by looking at everything at once. The authors created a new way called SIM that breaks down word information into smaller parts to spot local oddities better. They also introduced a way to make the system practice by creating fake anomalies and trained it to clearly separate normal words from unusual ones. Tests show their method works well, runs efficiently, and helps explain why a word is flagged.

Token-level anomaly detectionSubspace interactionText embeddingsLocal anomaly signalsPre-trained language modelsPseudo-anomaly generationAnomaly scoreProbabilistic boundary loss

Authors

Kehan Yan, Yue Tan, Qingfeng Chen, Shiyuan Li, Yu Zheng, Yixin Liu

Abstract

Token-level text anomaly detection, as an emerging trend of text anomaly detection, moves beyond coarse-grained document-level detection by localizing anomalous tokens within text. By providing fine-grained abnormality prediction, token-level text anomaly detection plays a critical role in various real-world applications, such as spam filtering and fake news detection. However, existing methods still rely on the global distance calculation for scoring, during which the local anomaly signals are severely diluted by numerous redundant normal feature dimensions. Moreover, pre-trained language models used in these methods inevitably smooth out surface anomalies, further limiting their effectiveness in token-level anomaly detection. To address these limitations, we propose a Subspace Interaction-based Method (SIM for short) for token-level text anomaly detection. To prevent local signal dilution, SIM adopts a subspace interaction-based anomaly detector, which decouples high-dimensional token embeddings into multiple low-dimensional ones, amplifying localized anomaly signals hidden within specific dimensions. To counteract the over-smoothing effect, we design a hard pseudo-anomaly generation module to construct pseudo-anomalous tokens, simulating the subtle anomalies obscured by semantic smoothing. Also, a probabilistic boundary loss is developed to standardize anomaly scores into statistical distances, effectively enforcing anomalous instances to deviate significantly from the normal distribution center. Extensive experiments on multiple benchmark datasets verify the effectiveness of SIM and demonstrate its remarkable efficiency, robustness, and interpretability. The source code is available at: https://github.com/yankehan/SIM-TAD.