arXiv:2609.03826cs.LGSep 2026

Manuscript Offprint

arXiv:2609.03826

Witnesses Explain Anomalies

Lamine Diop

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Lamine Diop

EPITA Research Laboratory, Le Kremlin-Bicêtre FR-94276, France, lamine.diop@epita.fr

Abstract—Unsupervised anomaly detection scores each point of an unlabelled, contaminated sample in a single pass, and increasingly must also explain why a point is flagged. Yet the dominant detectors give a score with no account of which features drive it, and explanations are bolted on post-hoc with SHAP or LIME, which re-query the detector thousands of times per point and only approximate it. We introduce WAND, an unsupervised tabular anomaly detector that is explainable by design. WAND organises its computation around directions on the unit sphere, scoring each point by how far its projection escapes a sub-Gaussian extreme-value baseline. The originality of our approach is that the witness directions that flag a point, being vectors in feature space, are its explanation, a per-feature attribution obtained at no cost over scoring and, since the score is differentiable, recoverable by gradients. Scoring is linear in the sample size, and a probe-efficiency bound guarantees every anomaly a witness, hence an explanation. Across 47 ADBench datasets WAND attains the best mean Friedman rank at ROC-AUC parity with 16 unsupervised baselines, so the gain is interpretability at no accuracy cost; its native explanations are more accurate and faithful than post-hoc SHAP/LIME and ECOD at a fraction of the query cost. WAND is thus a practical, interpretable solution for explainable anomaly detection.

Index Terms—anomaly detection, explainable AI, witness directions, feature attribution, differentiable algorithms

I. INTRODUCTION

We study unsupervised anomaly detection on tabular data: assign each point of an unlabelled, contaminated sample a real-valued score in a single pass, and, increasingly, explain why a point is flagged. The dominant detectors (Isolation Forest [1], LOF [2], OCSVM [3], KNN [4], PCA [5], ECOD [6]/COPOD [7]) return a score but no account of which features drive it; explanations are bolted on post-hoc with SHAP [8]/LIME [9], which re-query the detector thousands of times per point and only approximate it. We introduce WAND, a detector that is explainable by construction, down to raw-pixel saliency when an encoder is available (Fig. 1).

WAND organises its computation around directions on the unit sphere: for each, it measures how far the projected sample's extreme exceeds a sub-Gaussian baseline (calibrated by median/MAD, robust to up to half the data being contaminated), and aggregates these excesses into a per-point score. Anomalies have low halfspace depth [10], so one or more directions expose them as extreme, and those witness directions are, literally, the explanation: vectors in feature space whose large coordinates name the responsible features. A per-feature attribution thus falls out of scoring at no extra cost, and, since the score is differentiable, the same explanation is recoverable by gradients (and the score can serve as a loss in a learnable pipeline). The geometry also bounds cost on two axes. Scoring runs in O(Knd)O(Knd) time, linear in the sample size; and the number of directions K needed to expose every anomaly scales with the answer size (anomaly count and depth margin), not the sample size [11]. This latter is a probe-efficiency guarantee: each direction still requires a full scan of the data, so it bounds a budget rather than promising sub-linear runtime, and is most useful in low-to-moderate dimension (Section VII).

The main contributions of the paper are as follows:

  • We propose WAND, an unsupervised tabular anomaly detector that is explainable by design. It scores each point by aggregating, over directions on the unit sphere, the excess of the projected sample's extreme over a sub-Gaussian baseline, and the witness directions that flag a point, read in feature space, are its per-feature explanation, obtained at no cost over scoring (Section IV-H). Since the score is differentiable, the same explanation is also recoverable by gradients.

  • We establish the guarantees of the method. We prove that scoring is linear in the sample size, and that the number of directions needed to expose every anomaly is bounded by the anomaly count and a halfspace-depth margin, independently of the sample size (Theorem 1); equivalently, this bounds the budget at which every anomaly is guaranteed a witness, hence an explanation. We pair this with a median/MAD-calibrated tail statistic of 1/(d+1)1/(d+1) breakdown (Theorem 3).

  • We present an extensive empirical study on 47 ADBench datasets, comparing detection against sixteen unsupervised baselines and explanation quality against post-hoc (SHAP, LIME) and AD-native (ECOD) explainers, under both synthetic ground truth and real deletion/insertion faithfulness. WAND is competitive for detection while producing more accurate and more faithful explanations at a fraction of the query cost, and stays effective on heavy-tailed inliers and against deep detectors (Section VI).

The remainder of the paper is organised as follows. Section II reviews related work on unsupervised and explainable anomaly detection. Section III introduces the basic definitions and the formal problem statement. We present WAND and its directional-witness explanations in Section IV, and analyse the method's guarantees in Section V. We evaluate our approach in Section VI and conclude in Section VII.

References (45)