Hash Codes That Groom Jets: Residual Bit Learning for Pileup-Robust Jet Retrieval

When particles collide at the Large Hadron Collider, heavy particles decay into tight sprays of debris called jets. Every jet is also sprinkled with soft, wide-angle particles that come from unrelated simultaneous collisions (pileup) and from the colliding protons' leftovers. This contamination smears the quantities physicists care about. The Energy Mover's Distance (EMD) is the cost of moving one jet's energy pattern into another's, and it gives jets a principled geometry. That geometry is far too expensive to search over at the scale of modern open datasets.

We propose to compress each jet into a short binary code, a string of bits that can be compared with one XOR and a bit count. The bits are learned one at a time, and each new bit corrects the errors the earlier bits leave behind. The key change is in the training target. Each bit is trained to reproduce the EMD geometry of the clean jets, meaning the same events simulated without pileup, while it only ever sees the contaminated jets as input. The code therefore has to learn to ignore soft wide-angle radiation, so it acts as a learned, discrete groomer. Because the bits are built in order, a short prefix of the code should capture the robust, hard structure of the jet, and later bits should add finer detail. In two sentences: we train sequential error-correcting hash bits on contaminated jets to match clean-jet EMD neighborhoods. We then test whether this yields compact codes that retrieve the right neighbors under pileup better than grooming-then-hashing, or than binarizing a continuous embedding.

Core Claim

Sequential bit optimization from the hashing literature and jet grooming address the same structural problem from opposite sides. In hashing, a hard sign threshold throws information away, and later bits are fit to the leftover error (Sequential Projection Learning for Hashing with Compact Codes). In grooming, hard keep-or-drop thresholds such as Soft Drop's momentum-fraction cut make the output jump when a soft particle crosses the cut. PIRANHA fixes this by moving to continuous optimal-transport subtraction.

Our claim is that a residual-trained binary code, supervised by clean-jet EMD, can deliver two things in a single step at 16 to 64 bits. The first is accurate approximate EMD retrieval on pileup-contaminated jets. The second is a code whose early bits rarely flip when soft contamination is added. Grooming first with Soft Drop or PIRANHA and then hashing is a two-stage pipeline that achieves neither as well at equal bit budget.

The object being learned is a code matrix $\mathbf{B} = [\mathbf{b}_1, \dots, \mathbf{b}_B] \in \{-1,1\}^{N \times B}$ over $N$ contaminated training jets. The target is a signed similarity matrix $\mathbf{S} \in [-1,1]^{N\times N}$ computed from the EMD between the corresponding clean jets, with $S_{ij} = 2\exp(-\mathrm{EMD}^{\text{clean}}_{ij}{}^2/\sigma^2) - 1$ for a length scale $\sigma$. Bit $k+1$ is chosen to fit the residual left by bits $1$ through $k$:

$$R_k = \mathbf{S} - \sum_{m=1}^{k} \mathbf{b}_m \mathbf{b}_m^{T}, \qquad \mathbf{b}_{k+1} = \arg\max_{\mathbf{b}\in\{-1,1\}^N} \mathbf{b}^{T} R_k\, \mathbf{b},$$

which is a signed graph-cut on the residual, solved by the logistic relaxation and coordinate flips of Proximity Preserving Binary Code Using Signed Graph-Cut.

Neither side of the literature does this. The file reports no work that hashes the EMD space of jets. Exploring the space of jets with CMS open data establishes EMD as a metric and uses it to quantify pileup, but works with exact pairwise EMD. Particle Graph Autoencoders and Differentiable, Learned Energy Mover's Distance learns a continuous EMD proxy, but never discretizes it and never targets clean geometry from noisy inputs.

Research Program

Data. We build paired clean and contaminated jets. Following the setup used by PIRANHA, we simulate QCD, W and top jets in Pythia 8, with and without about 50 overlaid pileup interactions, and keep the event-level pairing. Exact EMD is computed on clean jets for a subsampled anchor set, which keeps the quadratic pairwise cost manageable, as the hashing literature does with landmarks.

Hash functions. The hash functions must apply to new jets the code was not trained on. The known weakness here is that sequential methods train one out-of-sample model per bit, which is costly at long codes (Proximity Preserving Binary Code Using Signed Graph-Cut). We address it with a single small particle-graph encoder in the style of the 18,144-parameter interaction network of Interaction networks for the identification of boosted H→bb̄ decays. The encoder carries $B$ linear sign heads. Head $k+1$ is trained on targets from the residual graph-cut, with an encoder update shared across heads and earlier heads frozen. This makes training cost grow with the number of heads rather than the number of full models.

Analysis of soft stability. The analysis question is whether residual training produces codes that change little when soft particles are added. We measure the bit-flip probability of each bit position as a function of injected soft energy. We also ask whether flips concentrate in late bits. If they do, the code is behaving as a coarse-to-fine, groomer-like ordering.

Scale demonstration. The scale demonstration is Hamming-space nearest-neighbor search over the roughly 178 million real jets of Aspen Open Jets. There we report query throughput and qualitative neighbor quality, since no clean truth exists for real data.

Baselines

Brute-force exact EMD. The naive reference is exact EMD computed directly on contaminated jets, which is the "do nothing" approach to contamination. Its variants compute exact EMD after Soft Drop grooming ($z_{\text{cut}}=0.1$, $\beta=0$, the CMS Open Data choice) and after PIRANHA's soft-continuous recursive subtraction with $f=1/2$. These are not compressed methods. They set the accuracy ceiling that each grooming choice permits, and the cost that hashing must beat. Beating ungroomed EMD at matching clean neighbors is the minimum bar for the proposal. Approaching groomed-EMD accuracy at a few thousand times lower query cost is the practical bar.

Two-stage pipelines. These groom first with Soft Drop or PIRANHA and then hash the groomed jets with the same encoder and the same sequential procedure, but with the target computed on groomed rather than clean jets. They are the most natural way to combine the two directions. They also test whether learning the grooming inside the code matters at all.

Binarized continuous embedding. This is the strongest competitor. We train the same encoder with the same pileup-augmented pairs to regress clean EMD as a continuous embedding, the approach that EMD-GNN shows can track EMD closely. We then binarize the embedding by principal-component projection plus sign, and separately by a learned rotation plus sign. For the continuous proxy, the reported accuracy is a mean relative difference of −0.003% with a 1.6% relative standard deviation against true EMD on LHCO jet pairs (Particle Graph Autoencoders and Differentiable, Learned Energy Mover's Distance). We found no reported result on Lacuna for binary codes or retrieval quality on jets of any kind, so every comparison here is new.

Simultaneous discrete hashing. We also train the same encoder with a tanh-relaxed loss over all bits at once.

Fairness and ablations. All learned methods share the same data, encoder size, training epochs and a matched hyperparameter search of 30 trials each. Two ablations isolate the proposal's ingredients. In the first, sequential residual training uses a target computed on contaminated jets, which removes the clean supervision. In the second, simultaneous training uses the clean target, which removes the sequential ordering. Beating the strongest baseline means two things at 16 and 32 bits, both outside the spread across five seeds. Recall@100 of the clean-EMD neighbors must be higher, and the flip rate of the first eight bits under pileup must be lower.

Why not just…?

Why not just groom with Soft Drop or PIRANHA and hash the result? This may work, and it is run directly as a baseline. The argument against it is that Soft Drop's hard cut makes groomed jets jump under small perturbations (PIRANHA), and those jumps propagate into any code computed after grooming. PIRANHA removes the jumps, but no fixed groomer is tuned to the retrieval objective. If PIRANHA-then-hash matches the end-to-end code, we will report that grooming should stay a separate stage.

Why not just learn a continuous EMD embedding and take its sign? This is the real threat. The evidence against it comes only from images. There, sequential signed graph-cut codes reached a precision-recall area of 0.355 at 128 bits on CIFAR-10 versus 0.129 for spectral hashing (Proximity Preserving Binary Code Using Signed Graph-Cut). Greedy bit-by-bit updates gave up to 4.88% higher mean average precision than simultaneous discrete baselines (A Scalable Optimization Mechanism for Pairwise Based Discrete Hashing). Whether these gains transfer to jets is unknown. The matched-encoder comparison settles it, and the advantage should appear mostly at short codes if it appears at all.

Why not just compute EMD faster and skip discretization? Exact EMD is a linear program that grows roughly cubically with the number of particles (SPECTER). A learned pairwise proxy still needs one network evaluation per pair, so neither scales to all-pairs scans over 178 million jets. Hamming comparisons do. This alternative bounds accuracy rather than competing on cost.

Proposed Experiments

The decisive experiment is clean-neighbor retrieval on the simulated paired dataset. Queries and database are contaminated jets, and the ground truth is the 100 nearest clean jets by exact EMD. We report recall@100 and precision-recall area at 16, 32 and 64 bits, for every baseline and ablation.

The second check is soft stability, run separately for each bit position. We inject increasing soft wide-angle energy and plot the flip probability for each bit. The proposal predicts monotonically lower flip rates for early bits only under sequential, clean-supervised training. If this prediction fails, the "discrete groomer" interpretation is wrong, even if retrieval improves.

The third check tests whether the code preserves physics rather than merely cluster structure. For each query we take the median groomed mass of its Hamming neighbors and compare its resolution with that of Soft Drop mass on the contaminated query.

Finally, we run the full Hamming scan over Aspen Open Jets and report wall-clock time against brute-force exact EMD on a subsample. As a feasibility note, not a claim, we estimate the resources needed to deploy the encoder through the fixed-point toolflow of Fast inference of deep neural networks in FPGAs for particle physics, which reported 75 ns inference for a small compressed network. We would treat a trigger application as follow-up work only if the stability result holds.