Who Decides What Is Normal? Domain-Pretrained Judges for Absorbing False Alarms in Log Anomaly Detection

Log anomaly detectors learn what a system's normal log messages look like and raise an alarm on anything that looks different. That works until the system changes in harmless ways. A software patch rewords a message, an administrator runs a yearly audit, or a new service starts up. Each of these produces text the detector has never seen, and today's language-model detectors treat "never seen" as "broken." The obvious repair is to let the detector learn from its own false alarms while it runs: collect high-scoring messages that are probably benign and fold them into its model of normal. Doing this safely comes down to one decision, namely which flagged messages to absorb. If the rule is wrong, the detector learns to accept real failures.

We propose to make that decision with a separate judge: an encoder pretrained on logs from many other systems and paired with those systems' labeled normal and failure messages. The target detector itself should not make the call. The bet is that a model which has seen how many systems word routine events can tell "reworded but routine" apart from "unfamiliar because something is failing" much better than a detector that has only ever seen one system. In that detector's view, every unseen message is equally far from normal. The claim can be measured directly on public benchmarks, because their labels let us count how many real anomalies end up absorbed into the normality memory.

Core Claim

Continued self-supervised pretraining on logs from many systems produces a better judge for test-time false-positive absorption than either the target detector's own representation or a general-web encoder. The judge absorbs a larger share of benign unseen messages while absorbing fewer true anomalies. This lowers false alarms on benign unseen text without the recall loss that uncurated adaptation causes. Here, the domain pretraining serves as the safety mechanism for adaptation. It is not being used to raise benchmark F1.

The proposal sits between two lines of prior work, and each supplies part of it. CANDI establishes that false alarms at test time are a useful adaptation signal. It mines likely-benign high-scoring samples by latent similarity and adapts a small module while the backbone stays frozen, gaining up to 59.0% AUROC on SMD_3-2. CANDI works on numeric time series, however, and mines in the detector's own latent space. It names contamination of the mined set as its open risk. Parser-free log language models, namely LAnoBERT (masked-token probability under a BERT trained on one system's normal logs) and ContraLog (a message encoder and a sequence encoder with a point-anomaly distance to known normal embeddings), motivate the problem. Their scoring rules flag reworded benign messages by construction, and neither adapts after deployment. We take CANDI's mining-and-adaptation idea and move it to logs. We then replace its mining criterion with a cross-system domain judge and evaluate it on the question CANDI leaves open.

Research Program

The judge is a message encoder, first initialized from a general BERT and then given continued masked-language-model pretraining on raw, lightly regex-masked messages. The masking follows LAnoBERT's NUM/IP convention. The corpus pools every benchmark system except the one being evaluated, drawn from HDFS, BGL, Thunderbird, Spirit, and Liberty, plus the GitHub log-instruction corpus from ADLILog. Pretraining uses a dedicated domain corpus rather than a small slice mixed into web text. This follows the evidence that specialized signal is washed out when mixed into general corpora (Durrani et al.; MONOCODER). It also follows the evidence that compact in-domain models can match much larger general ones (APEX; BERTHop).

Alongside the encoder we keep a reference bank of messages from the held-out-excluded systems, tagged normal or anomalous using those benchmarks' own labels. This bank is the main difference from ADLILog. ADLILog uses developer-assigned severity levels (info versus error) as auxiliary negatives, and the file notes these are frequently mislabeled. Our bank instead uses what actually happened at runtime on other machines.

The target detector is a standard single-system log language model: ContraLog's architecture, and LAnoBERT as a second backbone. It runs unchanged except for a normality memory, which is a set of message embeddings treated as normal when its point score is computed. When the detector flags a message $m$ at test time, the judge admits $m$ to the memory only if the following rule holds:

$$ \text{admit}(m) \iff \frac{\sum_{j \in N_k(m)} w_j\,[y_j = \text{normal}]}{\sum_{j \in N_k(m)} w_j} \ge \tau \;\text{ and }\; c(m) \ge r . $$

Here $N_k(m)$ is the set of $k$ nearest reference-bank messages to $m$ in the judge's embedding space. $w_j$ is the cosine similarity of neighbor $j$ to $m$, and $y_j$ is its label. $\tau$ is a purity threshold. $c(m)$ counts how often messages within a fixed radius of $m$ have recurred in the stream without an alarm on the following window, and $r$ is a minimum recurrence. The first condition asks whether messages like this are routine on other systems. The second asks whether this system keeps running normally after emitting it.

Admitted messages lower future point scores for similar text. The backbone is never retrained, so adaptation cannot reshape the representation around a single failure.

The analysis centers on the mined set itself. For every run we record how many flagged messages were admitted, what fraction of those were truly anomalous (contamination), and how many later anomalies were missed because a similar message had been absorbed. We run this analysis separately for three judges: the target detector's own space, a general-web encoder as used by NeuralLog, and the domain-pretrained encoder. That comparison isolates whether domain pretraining is the ingredient that makes absorption safe.

Baselines

The naive reference is the frozen target detector with a fixed threshold, which is ContraLog or LAnoBERT exactly as published. On standard splits these are already strong: ContraLog reports F1 of 96.86% on BGL and 97.38% on Thunderbird, and LAnoBERT reports F1 0.9990 on Thunderbird. These numbers come from splits where unseen benign text is rare. We found no reported result on Lacuna for false-positive rate on unseen benign messages for any of these models. Beating this reference means a lower false-positive rate on the unseen-benign subset at matched recall.

The strongest existing drift-handling method is BERT-LogAnom. It adds a two-speed dynamic threshold, a fast moving average plus a slow gated network, on top of a BERT and BiLSTM detector. It reports temporal-split F1 of 90.04% on HDFS against 88.41% for a fixed threshold, which is the most relevant published number because it is measured under drift. We will rerun it on our temporal splits with its published configuration and the same tuning budget as ours. Tuning will be on the same validation slice from the early part of the test period. We will also bolt its thresholding module onto our backbone, so that threshold adaptation is compared against memory adaptation on identical scores. Beating it means a higher temporal-split F1 and a lower unseen-benign false-positive rate without a larger miss rate on anomalies that follow benign bursts.

The key ablations keep everything fixed except the judge. The first uses the detector's own latent space, which is CANDI-style mining ported to logs. The second uses general BERT. The third is our domain encoder with the reference bank's labels hidden, using density only. The fourth drops the recurrence condition. The claim holds only if the domain judge with labels has lower contamination than all of these at equal admission volume.

A cross-system supervised message classifier, trained on the same reference bank and applied directly to the target system, is included as the baseline most likely to make the detector redundant.

Why not just…?

Why not just use the detector's own embedding space to mine false positives, as CANDI does? This is the most natural port. The trouble is that a single-system detector places a reworded routine message and a brand-new failure message both far from everything it knows. Its similarity scores therefore carry little information about which flagged messages are safe. CANDI itself flags contamination as unresolved. The first ablation measures this directly: if self-space mining matches the domain judge on contamination, our central claim fails and we will report it.

Why not just smooth the threshold over time? Threshold adaptation shifts every score by the same amount. It cannot lower the score of one reworded message while leaving an equally unfamiliar failure message untouched. BERT-LogAnom's own results show that the fast moving average alone was insufficient and needed a slow learned layer. The file also notes that a benign spike can inflate the threshold and hide concurrent failures. Running its thresholding module on our backbone settles whether per-message memory beats global threshold movement.

Why not just train a supervised classifier on other systems' labels and skip the detector? This is a real threat, because our judge already uses those labels. It should fail on failures specific to the target system that look routine elsewhere, and on target-normal messages that resemble other systems' alerts. For this reason the judge only gates absorption and the target detector still does the scoring. If the classifier alone matches our full system on leave-one-system-out evaluation, the honest conclusion is that cross-system supervision, not adaptive detection, is what matters. We would then redirect the work accordingly.

Why not just prompt a general large language model to decide whether a flagged message is benign? LogLLM reports that feeding raw log streams to general models runs out of memory and distracts them. Its working system needed a domain BERT embedder and supervised alignment, and skipping its first training stage cost nearly 30% F1. A general-model judge is also unaffordable per flagged message at log rates, given the latency limits in Practitioners' Expectations. We include the general-BERT judge as the affordable version of this alternative.

Proposed Experiments

All experiments use leave-one-system-out evaluation over HDFS, BGL, Thunderbird, Spirit, and Liberty, with chronological train/test splits. HDFS labels are per block, so we attribute block labels to messages only for the contamination count and report HDFS results separately. We tag a test message as unseen-benign when its masked form never appears in the training period and its label is normal.

The primary metrics are false-positive rate on unseen-benign messages at fixed recall, overall F1 and AUROC, contamination of the normality memory, and recall on anomalies that arrive after absorption begins.

A controlled stress test simulates software updates. We rewrite the phrasing of a sample of benign message types partway through the test stream, keeping meaning but changing words and field order. We also inject known failure messages from the same system at matched novelty. A useful judge must absorb the rewrites and reject the injected failures. The single-system detector, by design, treats the two groups the same.

The decisive check is a comparison at matched admission volume. It passes if the domain-pretrained judge absorbs at least as many unseen-benign messages as the self-space and general-BERT judges while showing clearly lower contamination, and if this translates into a lower unseen-benign false-positive rate with no loss in recall. If contamination does not drop, domain pretraining is not buying safety and the proposal's premise is wrong.