Isolation Forests as Live Bump-Hunt Indexes

Collider physicists look for new particles as small "bumps": excess events piled up at one value of a mass variable, sitting on a smooth background spectrum. Anomaly detectors help by keeping only unusual-looking events. They carry two known hazards. First, a cut on an anomaly score can bend the smooth background into a fake bump, a failure called mass sculpting. Second, the detectors in current use are deep networks that must be retrained whenever the analyst changes the question, for example by moving the mass window under test. That clashes with the push toward interactive analysis facilities, where physicists expect to adjust a cut and see the new histogram within about half a second.

We propose a random-partition tree ensemble, in the style of an isolation forest, that serves both as the anomaly detector and as the query index. An isolation forest is a set of trees that repeatedly split the data at random, and unusual points end up alone after few splits. In our version the trees split only on the event features, never on the mass. Each leaf stores a small histogram of the mass values of the events that land in it. From these stored counts, three questions can be answered without touching the raw events: which events are anomalous relative to the background interpolated from outside the current mass window, how much background should survive the anomaly cut inside the window, and whether the cut has sculpted the spectrum. Each answer costs time proportional to the number of stored histogram bins, not the number of events.

Core Claim

The isolation literature has a documented weakness that turns out to be the key. ADBench (ADBench: Anomaly Detection Benchmark) evaluated 30 detectors on 57 datasets and found that unsupervised detectors lose a median 16.43% of performance when anomalies are duplicated six times. Clustered anomalies form dense pockets that no longer isolate quickly. A resonance signal is exactly such a clustered anomaly: many near-identical events at one mass. Scoring events by how sparse they are, as a standard isolation forest does, is therefore the wrong test for a bump hunt. The right test is how over-dense a region of feature space is inside the mass window compared with what the neighboring mass sidebands predict.

With per-leaf mass histograms, that comparison becomes a count ratio computed leaf by leaf. Let $T$ be the number of trees and $\ell_t(x)$ the leaf of tree $t$ that contains event features $x$. Let $n^{\mathrm{SR}}_\ell$ be the observed count of leaf $\ell$ in the signal-region mass window. Let $\hat n^{\mathrm{SR}}_\ell$ be the count predicted by fitting a smooth curve to that same leaf's sideband mass bins and interpolating it into the window. The score is

$$R(x) = \frac{1}{T}\sum_{t=1}^{T} \frac{n^{\mathrm{SR}}_{\ell_t(x)}}{\hat n^{\mathrm{SR}}_{\ell_t(x)}},$$

an ensemble-averaged, nonparametric estimate of the ratio between observed and background density. The averaging over trees plays the same smoothing role that Random Forest Density Estimation proves for densities. That paper averages random midpoint-split trees and reports that doing so improves convergence. It also reports a rank-sum of 55 on 20 ODDS datasets, against 72 for a standard isolation forest.

Because any selection $S$, such as "events with $R > \tau$", is a union of leaves in each tree, the background expected to survive in the window follows directly from the same stored summaries:

$$\hat B(S) = \frac{1}{T}\sum_{t=1}^{T}\sum_{\ell \in S_t} \hat n^{\mathrm{SR}}_\ell .$$

In this equation $S_t$ is the set of leaves of tree $t$ whose events pass the cut. Sculpting then stops being a hazard to prevent and becomes a quantity to estimate: the background shape after the cut is modeled leaf by leaf rather than assumed unchanged. When the analyst moves the window, the sidebands, or the threshold, the software recomputes $R$ and $\hat B$ from roughly $T \times$ (leaves per tree) $\times$ (mass bins) stored integers. The claim to test is that this stays under 500 ms at $10^7$ to $10^8$ events while matching the discrimination of retrained deep detectors.

Relation to Prior Work

Three works motivate the gap. Using Machine Learning techniques for Data Quality Monitoring in CMS and ALICE experiments ran isolation forests offline on 10 to 15 minute ALICE detector-occupancy chunks and checked the flags against degraded $K_S^0$ mass peaks. It used isolation trees for detector health, not for physics discrimination, and it did not study sculpting or latency. What's Anomalous in LHC Jets? showed that K-means density estimation matches deep generative models on dark-jet signals: AUC 0.71 to 0.73 on Aachen and above 0.80 on Heidelberg. It also showed that the best preprocessing depends on the unknown signal. This supports shallow methods and argues for letting analysts explore preprocessing, but that paper never builds trees or an interactive loop. The LHC Olympics 2020 found that most blind entries missed the cascade-decay signal in Black Box 3, so any new method must be judged there and not only on easy two-body resonances.

One work constrains the design. Robust Anomaly Detection for Particle Physics Using Multi-Background Representation Learning, known as NuRD, removes the dependence between the learned features and jet mass with importance weighting and an adversarial critic. It reaches AUROC 0.914 with maximum-logit scoring and a Jensen-Shannon divergence (JSD, a distance between the background mass shapes before and after the cut) of 0.118 with Mahalanobis scoring. NuRD sets the accuracy and sculpting bar. It achieves decorrelation by gradient training on labeled background classes. We get it by never splitting on mass and by estimating the background per leaf, with no labels and no retraining.

Two systems works supply the latency goal and the index idea. Towards a Benchmark for Interactive Data Exploration defines the 500 ms threshold and a penalty metric $P$ that sums latency above that threshold. Riding from Urban Data to Insight Using New York City Taxis (TaxiVis) used a k-d tree, a search tree that splits space along coordinate axes, to answer spatial queries over 170M taxi trips in 2 s versus 24 s in PostgreSQL. That index only retrieves records and computes no statistics. The Analysis Facilities for the HL-LHC White Paper asks for sub-second interactive cut exploration but proposes no discrimination algorithm. We reuse the idea of a partition tree as an index and make its leaves carry the statistics that the physics question needs. The "mass" view of partitions, meaning leaf occupancy as a similarity or density signal, comes from isolation kernels as described in Anomaly Detection Based on Isolation Mechanisms: A Survey.

Research Program

Structure. Trees are grown on a subsample using features only. Mass never appears as a split variable. We test two splitting rules: random-axis isolation splits and RFDE-style midpoint splits. One streaming pass over all events then fills each leaf's mass histogram. Storage is $T \cdot 2^p \cdot B$ counts, where $p$ is tree depth and $B$ is the number of mass bins. With $T=100$, $p=10$ and $B=50$ this is about five million integers, independent of $N$.

Statistics. The main risk is selection bias. Leaves that look over-dense partly because of Poisson noise get selected, and their backgrounds are then estimated from the same counts. We handle this by cross-fitting. Trees and leaf selections are built on one half of the events, counts are fitted on the other half, and the halves are then swapped. For each leaf, the background model is a low-order smooth fit to the sideband mass bins. Leaves with too few events are pooled with their sibling leaves. We will state and test the assumption this relies on: within a leaf, the background mass spectrum is smooth across the window.

That assumption can break when features correlate strongly with mass. In the LHC Olympics data, for example, the individual jet masses correlate with the dijet mass. We will measure how much the per-leaf interpolation fails as that correlation grows. We will also report the classical isolation score on the interpolated background density alongside $R$. Their difference separates "rare-looking" events from "over-dense-in-the-window" events.

Interaction. Moving the window, changing the sidebands, re-binning mass and changing the threshold are all answered from leaf summaries. Changing the feature parameterization, such as the $p_T^n$ reweighting studied by Buss et al., requires a rebuild. For that case we measure a progressive build that updates the display as chunks of events stream in, and we score the whole session with the $P$ metric.

Baselines

The naive reference is a plain isolation forest trained on features without mass, with a single global score cut and a smooth fit to the resulting spectrum. It shows how much sculpting and masking a careless isolation approach suffers. We will quantify it on the same data rather than assume it.

The strongest existing method on the hls4ml jet dataset is NuRD, as reported in Robust Anomaly Detection for Particle Physics Using Multi-Background Representation Learning: AUROC 0.914 and significance improvement 2.32 for maximum-logit scoring, JSD 0.118 for Mahalanobis scoring, against a VAE baseline at AUROC 0.881 and JSD 0.255. We will quote these numbers and, where code allows, rerun NuRD on our splits. We will not expect an unlabeled method to beat a method that uses background class labels. NuRD sees QCD versus W/Z labels, so we will also report our method with those labels used to form per-class leaf histograms. Beating NuRD means matching its JSD within statistical error while staying within 0.02 AUROC, and doing so at interactive latency. Accuracy parity plus a latency gain of several orders of magnitude is the result we are after.

One mismatch must be disclosed. NuRD uses 50×50 calorimeter images, and axis-aligned trees on raw pixels are a poor fit. We therefore give the trees a fixed low-dimensional summary of the images: principal components or standard substructure variables, computed once. We will also run NuRD's network on the same summaries so that representation choice does not confound the comparison.

On Aachen and Heidelberg, the baselines are MLLED, a K-means density estimator, together with the DVAE and INN models from What's Anomalous in LHC Jets?. These report AUC 0.71 to 0.73 on Aachen and above 0.80 on Heidelberg. On the LHC Olympics 2020 data we found no reported numeric result on Lacuna for any participant. We will therefore run the plain isolation forest, the K-means leaf variant described below, and a retrain-per-window deep density baseline ourselves. All methods get the same events, the same window scan and a matched tuning budget of hyperparameter trials, and none sees signal labels during tuning.

Three ablations isolate the key ingredients. The first replaces the sideband-interpolated ratio $R$ with the standard sparsity score, testing whether the reframing of masking matters. The second replaces cross-fitting with same-sample counting, testing whether the selection-bias fix matters. The third uses a single tree instead of an ensemble, testing whether averaging matters.

Why not just…?

Why not just precompute an anomaly score per event and filter it with a fast columnar engine? For a fixed detector this is as fast as our approach, and we concede that. It breaks for bump hunting, where the reference background should come from the sidebands of the current window. Every window move then requires retraining and rescoring all $N$ events. Our latency experiment times exactly this retrain-and-rescore loop against leaf-summary queries across a window scan. If retraining an isolation forest and rescoring stays under 500 ms at $10^8$ events on the facility hardware, the index half of the proposal is unnecessary and we will say so.

Why not just set the threshold per mass bin, so that a fixed fraction passes in each bin? Per-bin quantile cuts remove sculpting cheaply for any score, and this is a real threat to any claim of better decorrelation. Our claim is narrower. On unlabeled data the per-bin quantiles inside the window are contaminated by the signal itself, which makes the signal look less anomalous. The leaf-wise sideband interpolation avoids that contamination and produces $\hat B(S)$ as a by-product. We will run a plain isolation forest with per-bin quantile cuts as a baseline. If it matches our significance on the LHC Olympics signal-fraction scan, the statistical part of our contribution reduces to engineering.

Why not just use K-means clusters as the leaves? A Voronoi partition, the cells around K-means centers, can store mass histograms just as trees can, and MLLED is already competitive with deep models on jets. We include this variant directly, with cells as leaves and the same cross-fitting. Trees should win only if ensemble averaging over random partitions reduces variance in the small-count regime, as RFDE's results suggest, or if subsample-built trees rebuild faster than K-means iterations. If K-means cells tie on both counts, we will report the method as partition-agnostic.

Why not just use rectangular cuts on known observables? Rectangular cuts are fast and transparent, but they encode a prior guess about the signal. The LHC Olympics blind test showed that such guesses miss cascade topologies like Black Box 3. We still report a hand-tuned cut on the substructure variables as a reference in each benchmark.

Proposed Experiments and Decisive Checks

The first check is false-discovery control, and it gates everything else. On LHC Olympics Black Box 2, which contains background only, a full window scan must produce local significances consistent with the look-elsewhere-corrected null. The same must hold on R&D background with no injected signal. A method that sculpts or overfits leaves will fail here. The same-sample ablation is expected to fail, which would confirm that cross-fitting is necessary.

The second check is sensitivity. We inject R&D $Z'$ signal at a decreasing sequence of signal-to-background fractions and record the smallest fraction reaching $3\sigma$. We compare $R$ against the sparsity score, which should degrade under masking as ADBench predicts, and against the other baselines. We then apply the frozen procedure blind to Black Box 1 and Black Box 3, reporting whether the resonance mass is recovered.

The third check is portability. On hls4ml jets we report AUROC, significance improvement and JSD against NuRD's published values, and on Aachen and Heidelberg we report AUC against MLLED. As a sanity check on generic tabular data, we run the ADBench duplicated-anomaly setting with no mass variable and a random split standing in for sidebands, to see whether the over-density score reduces the 16.43% median drop.

The fourth check is latency. Using R&D background bootstrap-resampled to $10^7$ and $10^8$ events, used only for timing, we measure the median and 99th-percentile response time for window moves, threshold changes and re-binning. We also measure the progressive rebuild time for a feature re-parameterization, and we report the $P$ metric over scripted exploration sessions that replay a sliding-window scan. The proposal succeeds if it passes the Black Box 2 test, comes within statistical error of the strongest baseline on the Black Box 1 injection scan and on hls4ml JSD, and keeps summary-level queries under 500 ms at $10^8$ events while the retrain-and-rescore baseline does not.