The largest-scale clustering of galaxies can reveal whether the universe's initial density ripples were perfectly Gaussian, meaning random in the simplest possible way. If they were not, halos (the dark-matter clumps that host galaxies) cluster more strongly or more weakly on very large scales, in a way that grows as one over the wavenumber squared. The size of that excess is set by the product of two numbers: the primordial non-Gaussianity amplitude $f_{NL}$, which is the quantity of interest, and a tracer-dependent response $b_\phi$, which says how strongly a given population of halos reacts to the primordial potential. Recent simulations show that $b_\phi$ is not fixed by halo mass alone. It shifts with halo concentration, the tidal shear of the environment, and the accretion rate (Modest set of simulations of local-type primordial non-Gaussianity in the DESI era). If $b_\phi$ is mis-set, the measured $f_{NL}$ is wrong by the same factor, however precise the clustering data are.
Our proposal is to learn, halo by halo, a weight computed from each halo's growth history and its changing neighborhood. The weights are chosen so that the weighted halo field has the largest possible signal-to-noise for $f_{NL}$, and so that its $b_\phi$ is measured directly in simulations rather than assumed. To produce the weight we use a factorized spatio-temporal attention model. Along one axis, it attends over the snapshots of a halo's main progenitor. Along the other, it attends over the neighbors present at each snapshot. The scientific question is concrete and falsifiable: does the time-resolved assembly history carry $f_{NL}$ information that summaries taken at the observation time (concentration, accretion rate, shear) do not? If it does, the answer also yields calibrated $b_\phi$ values for survey-like samples. If it does not, the same experiment shows that simple tabular weights are enough.
Where this sits
The connection between primordial non-Gaussianity and scale-dependent bias is well established. Constraints on local primordial non-Gaussianity from large scale structure derived the $k^{-2}$ bias and the "universal" relation $b_\phi = 2 f_{NL}\,\partial \ln n/\partial \ln \sigma_8$ under the peak-background split, which treats long-wavelength modes as a slowly varying background for short-wavelength collapse. Verifying the consistency relation for the scale-dependent bias from local primordial non-Gaussianity confirmed this relation for mass-selected halos in N-body simulations. Scale-dependent bias from an inflationary bispectrum: the effect of a stochastic moving barrier showed analytically that non-spherical collapse changes the bias amplitude, most strongly for low-mass halos.
These papers motivate the proposal: they show that $b_\phi$ depends on how halos form. The Hadzhiyska et al. result constrains it: it tells us which secondary properties matter and supplies the ABACUSPNG simulations. None of this work asks whether one can choose tracers, or weight them, using formation history in order to control $b_\phi$.
Machine-learning approaches to non-Gaussianity address a different question. Cosmology with persistent homology: parameter inference via machine learning trains convolutional networks, multilayer perceptrons, and gradient-boosted trees on persistence images. These are two-dimensional maps summarizing the loops, clusters, and voids in single-snapshot halo positions. The persistence of large scale structures. Part I. Primordial non-Gaussianity takes a similar topological approach. Both compress the spatial pattern at one redshift. We instead keep the standard, physically interpretable $k^{-2}$ estimator and learn only which halos to count and how much. The design choice is deliberate: the output stays a two-point statistic with a measurable $b_\phi$, and does not become a black-box summary whose calibration against astrophysical modeling is opaque.
The method comes from human-motion recognition. GestSync uses attention factorized into separate passes over body joints and over frames. Skeleton-Based Action Recognition with Multi-Stream Adaptive Graph Convolutional Networks shows that supplying second-order inputs, such as bone vectors and velocities, alongside joint positions is essential. STA penalizes attention that jumps erratically between frames. We reuse each ingredient. In our setting the joints become neighboring halos, the frames become simulation snapshots, and the bone vectors become halo-to-neighbor displacement and relative-velocity vectors. That last choice is motivated by the role of velocity bias in clustering (Halo velocity bias).
Core Claim
A halo's contribution to the primordial signal depends on when and how it gathered its mass, not only on its final mass. This dependence can be learned from simulations with known $f_{NL}$ and known initial potential. A weight derived from that learned dependence should do two things. It should reduce the systematic error from assuming universal $b_\phi$, and it should reduce the statistical error $\sigma(f_{NL})$ relative to mass-only or single-property tracer selections. The distinctive part is the temporal axis. The claim is only interesting if weights built from the full history beat weights built from end-state summaries.
Research Program
For each halo at an observation redshift $z_{obs}$, we trace its main progenitor across roughly ten to twenty earlier snapshots. At each snapshot we record the progenitor's mass, maximum circular velocity, and concentration proxy, along with its $K$ nearest neighbors. For each neighbor we record the displacement vector, the relative velocity, and the neighbor's mass. The model alternates two kinds of attention. The first runs among the neighbors within one snapshot. The second runs across snapshots for the halo and for each neighbor slot. This costs order $K^2T + T^2K$ rather than $(KT)^2$, where $T$ is the number of snapshots. A Frobenius penalty on changes in attention between adjacent snapshots, adapted from STA, discourages temporally incoherent attention. The network outputs a positive weight $w_i$ for each halo.
Training uses the fact that in a simulation the initial potential $\phi$ and the matter field $\delta_m$ are known exactly. For the weighted halo field $\delta_w$, we measure $b_1^w$ and $b_\phi^w$ by cross-correlating with $\delta_m$ and with $\phi$ on large scales. Cross-correlating with the known fields removes most sample variance, which matters because only a handful of large-scale modes exist per box. The training objective is the Fisher signal-to-noise for $f_{NL}$ of the weighted field:
$$\mathcal{S}(w) = \sum_{k<k_{max}} N_k\,\frac{\left[\,2 b_1^w\, b_\phi^w\, \mathcal{M}^{-1}(k)\, P_m(k)\right]^2}{2\left[(b_1^w)^2 P_m(k) + 1/\bar n_w\right]^2}.$$
Here $N_k$ is the number of modes in bin $k$, $\mathcal{M}(k)$ is the linear factor that converts potential to density and scales as $k^2$ at large scales, $P_m$ is the matter power spectrum, and $\bar n_w$ is the effective number density of the weighted sample, which sets the shot noise. Every term is differentiable in the weights. We maximize $\mathcal{S}$ and hold out whole simulations for evaluation.
A second output is a calibration. For any fixed survey-like selection, such as an HOD-populated luminous red galaxy (LRG) sample, the trained model predicts $b_\phi$ from the histories of the selected halos. This prediction can be compared with the universal-relation value and with the directly measured value.
Because real surveys do not observe merger trees, we treat the history-based model as an upper bound on how much assembly information is available. We then run a distillation step. A student model that sees only quantities with observational proxies at $z_{obs}$ (mass, concentration, local density, shear, and a mock star-formation-history summary) is trained to reproduce the teacher's weights. The gap between teacher and student measures how much information is locked in history that we cannot see directly.
Baselines
The naive reference is uniform weighting of a mass-thresholded halo sample, analyzed with the universal $b_\phi$ relation of Slosar et al. This is the standard analysis. It is evaluated in two ways: by its $\sigma(f_{NL})$, and by the bias in recovered $f_{NL}$ when the universal $b_\phi$ is used in place of the measured value.
The strongest existing reference point is the setup of Hadzhiyska et al.: HOD-populated DESI-like LRGs and quasars in ABACUSPNG, with $b_\phi$ calibrated using separate-universe simulations. That paper reports forecasted errors of $\sigma(f_{NL}) \approx 15$ for LRGs at $z=0.5$, 8 for LRGs at $z=0.8$, and 7 for quasars at $z=1.4$ (Modest set of simulations of local-type primordial non-Gaussianity in the DESI era). We will reproduce their pipeline on the same boxes and redshifts, number densities, and scale cuts before comparing. Beating it means one of two things. Either the learned weights lower $\sigma(f_{NL})$ at matched effective number density, or they remove a measurable $f_{NL}$ bias that the universal relation leaves, with no loss of precision. We found no reported result on Lacuna for learned or optimal per-halo weighting schemes for $f_{NL}$, so that comparison has no published number to beat.
The strongest competitor on the core question is a tabular one. A gradient-boosted tree, or a small multilayer perceptron, is given end-state concentration, accretion rate, shear, and mass, and trained with the same objective $\mathcal{S}$. The motivation is that Cosmology with persistent homology: parameter inference via machine learning found such trees roughly match neural networks for local $f_{NL}$ at lower cost. The tree receives the same training simulations and the same hyperparameter search budget, measured in trials, as the attention model. Because trees do not pass gradients through $\mathcal{S}$, the tree regresses the attention model's objective through a two-stage fit. As a fairer alternative, we also train an MLP end-to-end on the same features.
Three ablations isolate the key ingredient. The first gives the attention model only the $z_{obs}$ snapshot, removing the temporal axis. The second shuffles snapshot order, which keeps the information content but destroys causal ordering. The third replaces temporal attention with a GRU, a standard recurrent network. We also remove the second-order displacement and velocity inputs to test whether the skeleton-model lesson transfers.
Why not just…?
Why not just feed concentration, accretion rate, and shear to a gradient-boosted tree? This is the real threat. Hadzhiyska et al. already identify these properties as the main drivers of $b_\phi$, and trees performed well on local $f_{NL}$ in the persistent-homology study. Our hypothesis is that end-state summaries collapse information that only the history preserves, such as the epoch of major mergers or when a halo entered a filament. The tabular baseline and the end-snapshot ablation settle this directly. If they match the full model within the scatter across held-out simulations, we will report that history adds nothing. That is a useful negative result: it would mean survey calibration needs only a few observable proxies.
Why not just split the sample by one secondary property and do a multi-tracer analysis? Splitting by concentration or color is the conventional way to exploit a $b_\phi$ contrast, and it is interpretable. But a split along one hand-chosen axis is a special case of the learned weight. The weighted field includes any such split as a possible solution, and the objective $\mathcal{S}$ will find it if it is optimal. We include the best single-property two-tracer split, chosen on training boxes, as an additional baseline. If the learned weights do not beat it, the added complexity is not justified.
Why not just run a field-level network or persistence images on the density field? Such models can extract more information in principle. But their output is a learned summary with no explicit $b_\phi$. The central failure mode here is miscalibration of the galaxy-halo connection, and a black-box summary makes that failure harder to diagnose, not easier. The persistence-image work also compared its results against combined power spectrum and bispectrum summaries, which makes that comparison hard to align with ours. Our approach deliberately stays inside the two-point estimator. We will still report the persistence-image network's performance on Quijote-PNG local-$f_{NL}$ boxes as a reference for the information ceiling. We found no reported $\sigma(f_{NL})$ number on Lacuna for that method; the file gives only $R^2$ comparisons.
Proposed Experiments
Training uses the Quijote-PNG local-$f_{NL}$ Latin-hypercube boxes. They have many realizations, which the few-mode objective needs. We first confirm that merger trees or multi-snapshot halo catalogs are available, and regenerate them from snapshots if they are not. Held-out testing uses ABACUSPNG ($f_{NL} \in \{-100,-30,0,30,100\}$, 2 Gpc/h boxes), which also tests transfer across simulation codes and resolutions. The Eos suite serves as a third, independent check.
The first decisive check is calibration. On held-out boxes, for HOD samples that include assembly bias, we compare the predicted $b_\phi$ against the value measured by cross-correlation with $\phi$. The model succeeds if its residual is smaller than the residual of the universal relation, and if recovered $f_{NL}$ is unbiased at $f_{NL}=\pm 30$.
The second decisive check is precision. We compare $\sigma(f_{NL})$ at matched effective number density against the reproduced Hadzhiyska et al. values at the three redshifts.
The third decisive check is the history ablation. The gap between the full model and the end-snapshot model, and between the full model and the tree, answers whether spatio-temporal attention earns its place.
Finally, we inspect the attention maps to see which epochs and which neighbors drive the weights, and we measure the teacher-student gap to estimate how much of any gain survives with observable proxies. A result in which the gain survives distillation would translate directly into priors on $b_\phi$ for DESI-like samples.
References
- Modest set of simulations of local-type primordial non-Gaussianity in the DESI era
- Constraints on local primordial non-Gaussianity from large scale structure
- Verifying the consistency relation for the scale-dependent bias from local primordial non-Gaussianity
- Scale-dependent bias from an inflationary bispectrum: the effect of a stochastic moving barrier
- Cosmology with Persistent Homology: Parameter Inference via Machine Learning
- The persistence of large scale structures. Part I. Primordial non-Gaussianity
- GestSync: Determining who is speaking without a talking head
- Skeleton-Based Action Recognition With Multi-Stream Adaptive Graph Convolutional Networks
- STA: Spatial-Temporal Attention for Large-Scale Video-Based Person Re-Identification
- Halo velocity bias