TL;DR
Hawkes processes are the gold standard for modeling "domino-effect" events—like earthquakes triggering aftershocks or viral memes spreading—but fitting them to massive datasets has always been bottlenecked by strictly sequential computation. By uncovering a hidden sparse matrix structure in the underlying math, the authors transform this step-by-step bottleneck into a parallel prefix scan that unleashes the full power of modern GPUs. The result is exact, approximation-free model training that scales to tens of millions of events with orders-of-magnitude speedups.
What Problem Does This Paper Address?
Many phenomena in nature and society are self- or mutually-exciting: a stock trade triggers algorithmic reactions, a crime increases the risk of nearby retaliation, or a neuron firing excites its neighbors. Multivariate Hawkes processes model these continuous-time cascades cleanly, with parameters that directly tell you how much Node A influences Node B.
The catch is scale. Naively calculating the likelihood of $N$ events takes $O(N^2)$ time because every event's probability depends on summing up the lingering influence of all past events. If you use standard exponential decay kernels, a classic trick reduces this to an $O(N)$ step-by-step recurrence. While $O(N)$ sounds great on paper, a sequential loop is Kryptonite for modern GPUs, which achieve speed through massive parallelization, not fast single-core clock speeds. Previous attempts to scale further relied on approximations (like low-rank assumptions or stochastic sampling) that sacrifice the model's exactness and clean interpretability.
Methods
The authors bridge classical point-process math and modern GPU parallelization (similar to the tricks powering state-space models like Mamba).
- What’s standard: Using an affine recurrence to update the excitation state from one event timestamp to the next, and using the Blelloch parallel prefix scan algorithm—a classic parallel primitive that computes cumulative products across $P$ processors in roughly $O(N/P)$ time, provided the operation is associative.
- What’s new:
- Sparse Matrix Reformulation: By appending a
1to the $M$-dimensional state vector (where $M$ is the number of nodes), the authors turn the affine recurrence into a linear multiplication of $(M+1) \times (M+1)$ transition matrices. Crucially, these matrices are mostly zeros and an identity block; multiplying two of them takes just $O(M)$ operations and $O(M)$ memory instead of $O(M^3)$ and $O(M^2)$. - Manual Scan-Based Gradients: Letting PyTorch's
autogradbackpropagate through a parallel scan creates a massive memory-traffic jam. The authors derive analytic parameter gradients that also follow affine recurrences, computing the backward pass with custom prefix scans. - Exact Constant-Memory Batching: Because each batch of events only depends on the final state vector of the previous batch, long sequences can be chunked to cap GPU memory without introducing any approximations.
Datasets
No new benchmarks are introduced; the authors evaluate on synthetic cascades and two large-scale real-world datasets:
- Synthetic Data: Hub-and-spoke and sparse scale-free networks simulated up to $2^{26}$ ($\sim 6.7 \times 10^7$) events and $2,000$ nodes.
- MemeTracker: Real-world information cascades tracking memes across active websites, tested on subsets ranging from $\sim 6.4 \times 10^4$ to $\sim 3.27 \times 10^7$ events across up to $2,494$ nodes.
- Chicago Crime Data: Over $7.83$ million incident-level crime records (2001–2025) across $22$ police districts, analyzed both in aggregate and split by crime type (theft, battery, burglary, etc.).
Key Insights and Ideas
- Sparsity is intrinsic to the model: Unlike modern sequence models (like linear RNNs) that have to restrict their transition matrices to diagonal or low-rank forms to make parallel scans fast, the linear exponential Hawkes process gets an $O(M)$ associative multiply for free, purely from the math of scalar exponential decay.
- Autograd isn't enough for parallel scans: Having fast math on the forward pass only gets you halfway there. Bypassing PyTorch's automatic differentiation with manual prefix-scan gradients is essential to prevent memory overhead from wiping out arithmetic gains—and it unlocks exact batching.
- Sequential GPUs lose to CPUs: In their ablation study, running the classic $O(N)$ sequential loop on an A100 GPU is actually slower than running it on a CPU due to kernel launch overhead and weak single-thread speeds. You have to change the algorithm to unlock the hardware.
Key Results
- Massive Synthetic Scaling: On a single Nvidia A100 (80GB) GPU, the method fits $6.7 \times 10^7$ events across $2,000$ nodes (with 3 decay kernels) in $246.67$ seconds per epoch, with batching capping peak memory stably at $47.31\text{ GiB}$.
- Orders-of-Magnitude Speedups: On MemeTracker subsets up to $400\text{k}$ events, per-epoch runtimes ($0.06\text{ s}$ to $0.46\text{ s}$) are roughly $10\times$ faster than previously reported approximate/lazy methods, while scaling up to $32.7$ million events ($48.33\text{ s}$/epoch)—a scale previously out of reach for exact MLE.
- Numerical Exactness: Despite floating-point reordering during parallel scans, maximum relative errors compared to sequential evaluation stay below $10^{-5}$ for intensities and $10^{-4}$ for gradients.
- Interpretable Real-World Fits: Fitting $7.83$ million Chicago crimes takes just $1.012\text{ seconds}$ per epoch, cleanly recovering distinct spatial dynamics (e.g., strong localized self-excitation for burglary vs. hub-and-spoke diffusion across districts for all crimes).
Limitations and Future Work
- Hardware & Scale Dependent: The method relies on parallel hardware; without a GPU (or many CPU cores), or on very short event sequences (e.g., $N \lesssim 10^3$), parallel scan overhead means naive or sequential methods are just as fast or faster.
- Exponential Kernels Only: The state-augmentation trick relies entirely on the Markovian nature of exponential decay (and finite mixtures of exponentials). It does not directly extend to arbitrary non-exponential kernel families (like power-law kernels often used in seismology).
- Future Directions: Future work is not explicitly detailed by the authors, though they release an open-source library (
HawkesTorch) to enable applying exact Hawkes inference to new, large-scale domains, and note that their likelihood speedups remain compatible with orthogonal optimizations like low-rank parameterizations.
Summary updated