arXiv:2610.41387cs.LGOct 2026

Manuscript Offprint

arXiv:2610.41387

Anomalies as Residuals: Cauchy Displacement Networks

Yang Cao, Zihao Guo

Yang Cao

School of Computing and Information Technology,

Great Bay University;

Tsinghua Shenzhen International Graduate School,

Tsinghua University

China

charles.cao@ieee.org

Zihao Guo ∗^{*}

Institute for Advanced Research,

Great Bay University;

China

guozh@gbu.edu.cn

Abstract—Neighbourhood-based detectors such as KNN, LOF and LUNAR remain among the most accurate methods for tabular anomaly detection, but they compare every query with the stored training set, so their inference cost and memory grow with the data and the data must be kept at deployment. We ask whether the neighbourhood geometry these detectors exploit can be compiled into a small network that scores a query with a single forward pass. We propose the Cauchy Displacement Network (CDN), which regresses each normal point onto the mean of its kk nearest training neighbours with a single-hidden-layer network of Cauchy activations and scores a query by the length of its predicted displacement. This displacement is an empirical mean-shift vector, whose fixed-radius population counterpart locally approximates a scaled gradient of the log density. We show that Cauchy units exactly represent the score fields of a structured family of Student-tt expert densities, and establish a constructive approximation bound for the corresponding population neighbourhood-mean map using a single-hidden-layer Cauchy network. We further show that the bounded network output guarantees asymptotically linear residual-score growth along every fixed direction. On 46 benchmark datasets against 28 baselines, CDN obtains the best mean rank under both AUC-ROC and AUC-PR, while scoring 10410^4 queries in a few milliseconds on a single CPU thread, up to three orders of magnitude faster than neighbourhood-based detectors, with a model whose size does not depend on the training set.

Index Terms—anomaly detection, Cauchy function, mean shift

I. INTRODUCTION

Anomaly detection identifies observations that deviate from the dominant patterns of a dataset and supports applications such as fraud detection, intrusion detection, log monitoring and industrial quality control [1]–[5]. In many of these applications a detector is trained once on historical normal data and then deployed to score new records over a long period, often on devices with limited computation or in settings where the training data cannot be retained. The cost that matters at deployment is therefore the cost of scoring a query, together with the memory and data that must be kept to compute that score.

On tabular data, neighbourhood methods such as KNN [6], LOF [7] and LUNAR [8] are strong baselines [9]. These methods require access to reference data at inference time. Under brute-force search, scoring a query involves O(n)O(n) distance evaluations and O(nd)O(nd) arithmetic operations. Reconstruction and one-class networks [10]–[13] avoid this dependency but can lag behind neighbourhood methods, while recent diffusion and flow-matching detectors [14], [15] introduce more expensive models. This creates an accuracy–deployment trade-off.

In data-intensive monitoring systems, historical records may be maintained in a central repository, while anomaly scoring is performed by services with limited memory or strict latency requirements. Reference-based detectors must either access these records at query time or maintain a searchable copy of them. Our goal is to remove this deployment dependency while retaining the local geometric information used by neighbourhood detectors.

This raises the question of whether the neighbourhood geometry exploited by these detectors can be encoded into a compact parametric model, allowing queries to be scored without retaining the training data. A natural alternative is self-reconstruction, where a network is trained to reproduce normal inputs. However, the reconstruction objective does not explicitly enforce neighbourhood geometry. When the hypothesis class is sufficiently expressive, an identity-like mapping may achieve a small training loss while also reconstructing unseen anomalies accurately. Although bottlenecks and regularisation can mitigate this effect, they do not directly impose the local geometric supervision provided by neighbourhood statistics.

We propose the Cauchy Displacement Network (CDN), which combines neighbourhood-mean regression with a compact single-hidden-layer Cauchy architecture. During training, each normal point is mapped to the mean of its k nearest training neighbours rather than to itself. The identity map generally has nonzero loss for this target, encouraging the network to learn local neighbourhood geometry. At test time a query is scored by the length of the displacement between the query and the network output, which requires one forward pass of a single-hidden-layer network and no neighbour search. The network uses the Cauchy activation of XNet [16], a rational function derived from the Cauchy integral formula. We refer to the discrepancy between a query and its predicted

∗^{*}Corresponding author.

neighbourhood mean as its residual. Normal observations are expected to produce smaller residuals, whereas anomalous observations may produce larger ones.

This design has a direct statistical interpretation. The displacement from a point to the mean of its neighbours is the mean-shift vector, which is approximately proportional to the gradient of the log density [17], [18], that is, the score function of the data distribution. CDN therefore learns a neighbourhood-mean mapping whose displacement is locally related to the score field, and uses the magnitude of the predicted displacement as its anomaly score. We further show that the Cauchy activation is particularly relevant to this setting because its rational form exactly represents the score fields of a structured family of Student-t expert [19] densities. We further establish a constructive approximation bound for the corresponding population neighbourhood-mean map. In addition, the bounded output of the direct Cauchy network ensures asymptotically growing residual scores for sufficiently distant queries. This latter property is shared by other bounded-activation architectures, whereas the exact score representation exploits the specific rational structure of Cauchy units.

The main contributions of this work are to:

  • Propose CDN, which regresses each normal point onto the mean of its kk nearest training neighbours with a single-hidden-layer Cauchy network and scores a query by the length of its displacement in one forward pass, without storing the training data or searching for neighbours.
  • Establish a statistical interpretation of neighbourhood-mean regression through a fixed-radius population mean-shift expansion, and show that Cauchy units exactly represent the density scores of products of Student-t experts.
  • Derive a constructive approximation bound for the corresponding population neighbourhood-mean map, establish conditional preservation of anomaly-score margins, and prove asymptotically linear far-field growth of the residual score.
  • Evaluate CDN on 46 benchmark datasets against 28 baselines, where it obtains the best mean rank under both AUC-ROC and AUC-PR while scoring queries up to three orders of magnitude faster than neighbourhood-based detectors.

References (57)