arXiv:2610.06133cs.LGOct 2026

Manuscript Offprint

arXiv:2610.06133

Machine learning for journal entry testing: A type-aware evaluation of anomaly detectors under a review budget

Jan Gronewald, Michel Scherer, Nijat Mehdiyev

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

Abstract

Journal entry anomaly detectors are commonly evaluated on the full population with ROC-AUC, precision and recall, ignoring the review budget and which anomaly types are found. We propose a type-aware evaluation combining per-type recall, fair-share type recall (FSR), which caps each type's credit at its budget share, type coverage and first-hit rank. We evaluate nine unsupervised detectors, a supervised reference and feedback-driven Deep Semi-Supervised Anomaly Detection (DeepSAD) on four real client ledgers with injected typed anomalies and a public synthetic ledger. On the largest client ledger, principal component analysis (PCA), an autoencoder (AE) and a variational autoencoder (VAE) each place on average 98 anomalies among the first 100 postings, but at least 95.8 belong to one type. FSR instead favours a nearest-neighbour (kNN) detector and changes the top-ranked detector on three of four client ledgers. Representation also matters: one-hot encoding exposes unseen accounts, whereas frequency encoding leaves unseen contra accounts largely undetected. On the public ledger, the Histogram-Based Outlier Score (HBOS) and Empirical Cumulative Distribution-Based Outlier Detection (ECOD) reach all eight markings within 1,386 entries, whereas kNN, the hit leader at 1,000 entries, first reaches cross-linked clearing at rank 4,641, and the supervised row-level reference misses this marking within 1,000 entries. There, the adaptive DeepSAD review protocol raises mean hits per 100 reviews from 40.0 to 68.3 but type coverage only from 2.7 to 3.0.

*Corresponding author.

Email address: jan.gronewald@extern.uni-saarland.de (Jan Gronewald)

These findings show that high hit rates can conceal systematic blind spots and suggest that feedback can reinforce existing detection patterns without broadening anomaly coverage.

Keywords: Journal entry testing, Anomaly detection, Machine learning evaluation, Human-in-the-loop learning, Review budget, Diversity-aware evaluation, Audit analytics

1. Introduction

Journal entry testing is among the most direct applications of machine learning in auditing. International Standard on Auditing (ISA) 240 requires the auditor to test the appropriateness of journal entries recorded in the general ledger (International Auditing and Assurance Standards Board, 2025a), yet a single client's ledger for one fiscal year holds thousands to hundreds of thousands of postings, of which an engagement team can examine only a few in detail. Practice therefore selects entries by risk criteria (Droste and Tritschler, 2024), and guidance from the International Auditing and Assurance Standards Board (IAASB) accepts that auditors follow up only a selection of the items that automated tools flag (International Auditing and Assurance Standards Board, 2023). Because genuine misstatements are rare and almost never labelled, the natural tool is an unsupervised anomaly detector that learns the regularities of the postings, scores every entry and hands the auditor a ranking to work through from the top. The result is an expert system in which the model proposes and the auditor disposes, and its value in practice is decided by the review budget, the number k of entries that the auditor actually reviews. Evaluating detectors for this setting therefore means asking what the first k entries of a ranking contain.

The measures with which machine learning compares anomaly detectors answer this question only in part. Precision at kk (P@k), average precision (AP) and the area under the receiver operating characteristic curve (ROC-AUC) measure how well a ranking places anomalies ahead of normal instances, but they treat anomalies as exchangeable and ignore which kinds they are. Benchmark studies have shown that this matters: the ranking of algorithms changes with the anomaly type, because each algorithm carries an inductive bias, a built-in assumption about what makes a point anomalous, that fits some deviations but not others (Steinbuss and Böhm, 2021; Han et al., 2022; Foorthuis, 2021). These studies, however, evaluate one type per dataset. In a general ledger the types coexist in one ranking, and for the auditor they are not interchangeable: an extreme amount, an unusual payment period, a posting to a never-used account and an unusual pair of accounts point to different risks, and ISA 330 asks for procedures that respond to each assessed risk (International Auditing and Assurance Standards Board, 2025b). A type-blind measure therefore rewards a model whose inductive bias happens to match the most numerous or most separable type, and it cannot reveal that the review list leaves the other risks untested.

A single example from our benchmark shows how far the two criteria can drift apart. In a real client ledger of about 280,000 postings with five injected anomaly types, principal component analysis (PCA), an autoencoder (AE) and a variational autoencoder (VAE) each place on average 98 anomalies among their first 100 postings, a nearly perfect result by any hit-based measure. Yet at least 95.8 of these hits are of one kind, postings to an account never used before. We attribute this to the interplay of inductive bias and representation: the three models score a posting by how poorly it is reconstructed from structure learned from the data, and in a one-hot encoding an unused account becomes a column of its own that no learned structure explains. A measure that credits each type only up to its fair share of the budget, fair-share type recall (FSR@k, Section 3), reverses the verdict: a k-nearest-neighbour detector (kNN) that finds only a third as many anomalies but spreads them over several types scores higher (FSR@100 of at least 0.284 against at most 0.226).

This paper develops a type-aware evaluation for anomaly detection under a review budget and tests whether it changes the conclusions of a hit-based comparison. The evaluation consists of per-type recall read against the most the budget can hold, type coverage, FSR@k with optional risk weights, the first-hit rank of each type and a budget scaled to ledger size. The measures need only model scores and anomaly types, so they apply to any detector. They adapt diversity-aware evaluation of ranked lists from information retrieval to three features of the audit setting: the expert reads the whole list, the types differ greatly in size, and their weights come from a risk assessment rather than from the probability of a query intent (Fig. 1).

We apply the evaluation to three learning regimes on two complementary data sources. Typed synthetic anomalies of five kinds are injected into four real client ledgers of 3,461 to 279,975 postings under a protocol frozen before the experiments, and a public synthetic ledger of 102,429 journal entries carries eight markings defined by its generator (Gronewald et al., 2026c),

Figure

Figure 1: Type-aware budget evaluation. Four client ledgers with injected types T1 to T5 and a public ledger with markings M1 to M8 are ranked by nine unsupervised detectors and a supervised LightGBM reference; an auditor reviews the first k units. The conventional view counts the anomalies among them, the type-aware view asks which types they are. The example lists are schematic.

independently of our injection protocol and open to anyone. The unsupervised regime comprises nine detectors whose inductive biases range from isolation and local density to linear subspaces, neural reconstruction and learned entity embeddings. In the supervised regime, gradient-boosted trees trained on the labels serve as a supervised reference that indicates which types the row-level representation makes separable at all. In the third regime the auditor's reviews become labels for a semi-supervised deep one-class model, DeepSAD (Ruff et al., 2020). Such labels come from the top of the model's own ranking, a sample known to be unrepresentative of the data (Dasgupta and Hsu, 2008; Pelleg and Moore, 2004), which raises the question whether learning from the expert widens the range of risks reached or only deepens the one already found. Five research questions structure the study.

RQ1 How do the detectors compare by conventional, hit-based criteria under a review budget?

RQ2 Which anomaly types reach the reviewer within the budget, and does the type-aware view change the comparison?

RQ3 How do budget size, contamination and difficulty move both views?

RQ4 Which findings hold on a public ledger whose anomalies were generated independently of this benchmark?

RQ5 Do auditor reviews fed back to a semi-supervised detector reach more anomaly types, or only more anomalies?

The answers show that the two readings disagree where it matters. On three of the four client ledgers the model with the highest FSR@100 is not the one with the most hits, and on the largest this reversal requires the fair-share normalisation: macro-averaged recall would keep the hit leaders on top. On the public ledger FSR orders the detectors as precision does, but coverage and first-hit ranks do not: two per-field detectors with low precision reach all eight markings within 1,400 entries, whereas kNN, the leader in hits at a budget of 1,000 entries, first meets a cross-linked clearing at rank 4,641. Relational anomalies almost never enter the first 1,000 entries of any unsupervised detector, and the supervised learner misses cross-linked clearings as well, which points to a limit of the row-level representation rather than of the model. The adaptive review protocol with DeepSAD adds about 17 to 49 anomalies per 100 reviews over its static starting ranking. On the public ledger a control without labels attributes this gain on average to the auditor's labels, yet the labelled hits concentrate on one marking per seed and reach no more markings than retraining without labels, evidence of an exploitation bias in ranking-derived feedback.

The paper makes three contributions: a type-aware evaluation framework for budget-constrained anomaly detection in human-in-the-loop decision support, including the fair-share normalisation required when anomaly categories of very unequal size coexist in one ranking; a benchmark that combines typed injection into four real client ledgers with a public synthetic ledger and compares unsupervised, supervised and expert-feedback learning; and evidence, together with the mechanisms behind it, that the type-aware view changes which model would be selected under a type-aware criterion. The detectors and the injection method are established; the new elements are the fair-share normalisation, its combination with coverage and first-hit ranks into a budget-bound evaluation profile, and the evidence that this profile changes which model would be selected. Section 2 reviews related work, Section 3 defines the evaluation, Section 4 describes the benchmark, Section 5 reports the results, Section 6 discusses mechanisms, implications and limitations, and Section 7 concludes.