arXiv:2608.28375stat.MLAug 2026

Manuscript Offprint

arXiv:2608.28375

Localizing Global Discrepancies: Marginal Contributions and Contextual Anomaly Detection

Tommaso dorigo

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

Abstract

Global goodness-of-fit and discrepancy statistics can establish that a sample departs from a reference distribution without identifying which observations drive the departure. We develop a unified framework for this localization problem by assigning to each observation its conditional or marginal contribution across random statistical contexts. Marginal-attribution constructions are familiar from resampling diagnostics and modern data valuation; here we connect them systematically to projection theory and to event-level anomaly detection. For any symmetric statistic, fixed-size replacement is exactly equivalent to centered conditional localization. For U-statistics, the corresponding addition score equals the first Hoeffding/Hájek contribution; for smooth distributional functionals the score is related at leading order to the influence function; and for the unbiased known-background maximum mean discrepancy (MMD) it reduces exactly to the MMD witness.

The above viewpoint reveals how to construct more efficient estimators of the same local quantity. Matched-context subtraction removes fluctuations unrelated to the observation, while for pairwise MMD the event-containing terms yield a particularly simple localizer. On the LHC Olympics benchmark, a particle physics anomaly detection dataset, the pair estimator converges to the direct empirical MMD witness with the predicted 1/(Rm2)1/(Rm^2) finite-resampling scaling, with mm the batch size and RR the number of batches. At m=1000m = 1000 and R=5×106R = 5 \times 10^6, it reproduces the witness almost exactly, reaching correlation 0.9993 and essentially identical AUC.

We separately study when the surrounding sample contains information about an event beyond that contained in its own features. To isolate this possibility, we construct a shared-latent toy model in which the full single-event distributions of signal and background are identical by construction, forcing every isolated-event classifier to have AUC = 0.5. Discriminating information survives only in the dependence between events induced by the latent parameter shared across signal observations. In this setup, the ensemble reveals the common latent alternative and recovers class information, whereas an independent-latent control does not. This separates two roles of context: efficient localization of a global discrepancy, and genuinely additional class information when the alternative contains shared structure. The framework thereby connects classical attribution and projection ideas to event-level anomaly detection and clarifies what contextual methods can and cannot learn.

1 Introduction

Searches for unexpected phenomena are often formulated as tests of whether an observed data sample is compatible with a reference probability distribution. This setting is typical in high-energy physics (HEP). In experimental HEP analyses, Standard Model processes may be accurately simulated or otherwise constrained, thanks to well-developed theoretical calculations and high-fidelity simulations; the probability distribution of Standard Model data is not known in closed form, but can in principle be determined to high accuracy. The probability distribution associated with possible new physics is instead a priori completely unknown. A wide class of modern anomaly-search methods therefore aims to identify departures of collider data from a well-specified reference without committing to a particular signal model [14, 16].

A distinction needs to be made between identifying an anomalous sample and identifying the individual observations associated with the sample-level departure. An event can lie in an ordinary region of background phase space while belonging to an anomalous population because too many events with similar properties occur in the data. Conversely, an isolated event exhibiting extreme features need not support a coherent distributional discrepancy. Thus “atypicality under the background” and “contribution to the observed departure” are different statistical notions.

Assigning a global quantity back to individual observations is itself a well-established statistical idea. Case-deletion and jackknife methods study the sensitivity of statistics to individual data points, and the jackknife-after-bootstrap extracts such information from an existing ensemble of bootstrap replicates [2]. Related constructions appear in data valuation, where Shapley-based and distributional approaches average the marginal effect of adding an observation over many subsets or random contexts [4, 5, 6, 7]. Global-test diagnostics have likewise been used to expose observation- or variable-level contributions to an aggregate result [3], while for kernel two-sample tests the maximum mean-discrepancy (MMD) witness directly identifies regions in which two distributions disagree [22]. The mentioned research directions establish important pieces of the problem, but they arise in different settings and with different objectives.

The anomaly-detection motivation considered here has an independent history in the Inverse Bagging algorithm. That idea was conceived by the author in 1992 for the top quark search at the Tevatron collider, but was rapidly abandoned due to its impossible CPU demands. The algorithm was then studied more systematically 25 years later [1]. Inverse Bagging repeatedly constructs small subsets of a mixed data sample, evaluates their compatibility with the background hypothesis, and attributes the resulting information back to the events appearing in those subsets. The historical construction was phrased in terms of bootstrap aggregation. The perspective we develop here is broader: we wish to discuss how conditional subset scores, marginal contributions, statistical projections, and event-containing terms can be viewed as different representations of the same localization operation when the parent object is a global discrepancy statistic.

Let TmT_m be a sample-level statistic computed on a batch of mm observations, assumed to be permutation-invariant (symmetric) in its arguments. Two natural questions can be asked about an observation xx: First, what value does TmT_m tend to take when xx is present? And second, how much does TmT_m tend to change because xx is present? The first question leads to conditional localization,

LT,m(x)=E[Tm∣X1=x]−E[Tm],L_{T,m}(x)=\mathbb{E}[T_{m}\mid X_{1}=x]-\mathbb{E}[T_{m}],

where E[] indicates the expectation value; while the second leads to a marginal-contribution construction. These are not competing definitions. Replacing an ordinary member of a random context by x gives exactly LT,m(x)L_{T,m}(x) for any symmetric statistic; for unbiased U-statistics, adding x to a context of size m - 1 gives the same quantity exactly. The marginal form is also computationally important because matched-context subtraction cancels fluctuations that carry no information about the identity of x.

Starting from those questions and motivated by the attempt to understand under what conditions and to what extent the Inverse Bagging algorithm works, we studied the above landscape of ideas. The contribution we provide with this paper is threefold. First, we give a unified statistical account of discrepancy localization: for U-statistics the local score is the first Hoeffding/Hájek projection, for smooth functionals it connects at leading order to the influence function, and for known-background MMD it becomes the witness function. These component results are classical or closely related to established constructions; here we stress their common interpretation as event-level localization of a global discrepancy. Second, that interpretation exposes variance-efficient estimators based on matched marginal contributions and, for U-statistics, on terms that explicitly contain the event being scored. We derive their scaling and test it from analytically controlled examples to collider-scale data. Third, we separate localization from the distinct question of whether other observations contain new class information about a given event, and identify shared latent structure as a mechanism by which such information can arise.

Maximum mean discrepancy [12] provides an especially transparent realization for our study, as we can derive all properties exactly. Its unbiased known-background estimator is a second-order U-statistic, its conditional localization is exactly proportional to the MMD witness function, and its event-containing pair terms can be isolated analytically. This allows a direct comparison between the population localizer, finite-sample witnesses, and Monte Carlo estimators, and makes the cancellation of context-only fluctuations explicit.

A separate question is whether the surrounding ensemble merely helps to estimate an event-level localizer, or whether it can contain genuinely new information about the class of a particular observation. In an ordinary IID mixture with fully specified signal and background distributions, once an event's own features are known, the remaining independent observations provide no additional information about its class. This limiting case is closely related to the analysis of single-event and multi-event collider classifiers in Ref. [13]. The situation changes when the alternative itself contains an unknown property shared across signal events. The ensemble can then constrain that common property and use it to reinterpret individual observations. We construct an extreme example in which isolated signal and background events have exactly identical marginal distributions, yet their shared latent structure makes class membership recoverable from context.

The numerical studies we offer in this work follow the above conceptual hierarchy. Experiment I provides an analytically soluble Gaussian validation and quantifies the variance reduction that can be obtained by marginal and event-containing estimators. Then, we perform experiment II where we show how to isolate genuinely collective information with a shared latent alternative and an independent-latent control. In experiment III we finally get to a HEP context; we decided to use the LHC Olympics benchmark [15] in the standard CATHODE signal region to study convergence at collider-scale sample size. Writing ρ\rho for the correlation with the direct empirical witness, the pair estimator obeys ρ−2−1≃C(Rm2)−α\rho^{-2} - 1 \simeq C(Rm^2)^{-\alpha} with α=0.9995\alpha = 0.9995 in the high-statistics regime and recovers the direct empirical witness to correlation 0.9993, with essentially identical AUC. Together, the three experiments distinguish validation of the localization principle, the existence of genuinely contextual class information, and the efficient recovery of the localizer in a HEP context.

The paper is organized as follows. Section 2 positions the construction relative to resampling diagnostics, data valuation, projection theory, and anomaly detection. Section 3 introduces conditional and marginal localization. In Section 4 we develop the connections with U-statistics, influence functions, MMD, and efficient event-containing estimators. In Section 5 we discuss how localization is separated from genuinely collective class information. Section 6 discusses finite-sample estimation, practical localization estimators, and the historical relation to Inverse Bagging. In Section 7 we present the three numerical studies mentioned above, and Section 8 discusses their implications, computational consequences, and limitations. We conclude in Section 9 where we summarize the work and discuss its possible extensions.

References (29)