NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Mamba Hawkes Process

Anningzhe Gao, Shan Dai, Yan HuarXiv 2024

TL;DR

The paper introduces the Mamba Hawkes Process (MHP) and its hybrid variant (MHP-E), which adapt selective state space models (SSMs) to model irregular, asynchronous event sequences. By embedding temporal intervals directly into Mamba's discretization mechanism, the models capture long-range event dependencies with linear computational scaling. The proposed architectures achieve state-of-the-art performance, significantly outperforming RNN- and Transformer-based baselines in both log-likelihood and prediction accuracy.

What Problem Does This Paper Address?

Many real-world domains—such as high-frequency finance, social media interactions, and electronic health records—produce data in the form of asynchronous event sequences, where the irregular time intervals between events carry critical predictive information. These are traditionally modeled using Temporal Point Processes (TPPs), most notably Hawkes processes, which capture how past events trigger future ones.

However, traditional Hawkes processes struggle with complex nonlinear dynamics and mutual inhibition (where one event type suppresses another). While deep learning solutions like Recurrent Neural Networks (RNNs) and Transformers have been introduced to solve this, they hit fundamental architectural walls:

  • RNNs struggle to maintain long-term dependencies and suffer from vanishing or exploding gradients during training.
  • Transformers handle long-range context well but suffer from quadratic computational complexity ($O(L^2)$), making them highly inefficient for long event sequences (e.g., extended financial transaction histories).

This paper addresses the need for a model that can capture long-range temporal dependencies efficiently without sacrificing the ability to model continuous-time dynamics.

Methods

The authors propose two novel architectures:

1. Mamba Hawkes Process (MHP)

MHP adapts the selective state space architecture (Mamba/S6) to temporal point processes. In standard Mamba, continuous-time state equations are discretized using a step size ($\Delta$). The core innovation of MHP is mapping the actual physical time difference between events ($\Delta_i = t_i - t_{i-1}$) directly into this discretization step.

The model makes the state-space matrices $B$ and $C$ time-dependent by projecting them from event embeddings, allowing the hidden states to evolve naturally based on both the event type and the elapsed time.

Algorithm 1: The architecture of Mamba Hawkes Process

2. Mamba Hawkes Process Extension (MHP-E)

Inspired by hybrid architectures like Jamba, MHP-E combines Mamba and Transformer layers. The sequence first passes through Mamba layers to simultaneously encode temporal intervals and event features. The resulting time-aware representations are then fed into standard Transformer blocks.

Datasets

The models were evaluated on five distinct datasets spanning different sequence lengths and event types:

  • Synthetic Dataset: A simulated Hawkes process containing 5 event types with an average sequence length of 60.
  • Financial Transactions: A massive dataset containing a day's worth of stock transaction records ("Buy" and "Sell"). This dataset features very long sequences, averaging 2,074 events, making it an ideal test for Mamba's linear scaling.
  • StackOverflow: A history of user interactions on the Q&A platform, encompassing 22 event types with sequence lengths up to 736.
  • Retweet: Tweet threads tracking user response times and popularity, categorized by follower count group.
  • MIMIC-II: A standard medical benchmark containing ICU patient admission records, timestamps, and diagnoses.

Key Insights and Ideas

  • Time as a Natural Discretization Step: The most elegant "aha" moment of the paper is using the physical time gap ($\Delta t$) between asynchronous events as the mathematical step size ($\Delta$) for the SSM. This perfectly bridges the gap between Mamba's continuous-to-discrete control theory roots and the continuous-time intensity functions of TPPs.
  • Theoretical Convergence to RNNs: The authors prove that under specific constraints ($N=1, A=-1, B=1$), the MHP recurrence mathematically degenerates into a traditional RNN structure similar to the Recurrent Marked Temporal Point Process (RMTPP). This provides a solid theoretical link between state space models and classic neural TPPs.
  • Implicit Positional Encoding: Because the Mamba layer in MHP-E processes temporal differences and event features simultaneously, the subsequent Transformer blocks do not require absolute or relative positional encodings. The time-awareness is already inherently baked into the hidden representations.

Key Results

The proposed models were compared against standard baselines, including RMTPP, Neural Hawkes Process (NHP), Self-Attentive Hawkes Process (SAHP), and Transformer Hawkes Process (THP).

Log-Likelihood Performance

MHP and MHP-E achieved the highest log-likelihood scores across all datasets. MHP performed best on long-sequence data like the Financial (0.974) and Synthetic (0.993) datasets, while MHP-E dominated on Retweet (2.016) and Mimic-II (1.186).

Accuracy and RMSE

When predicting the next event type and its exact timestamp, MHP-E consistently outperformed all other models:

  • Financial Dataset: MHP-E achieved the highest event prediction accuracy (62.7%) and the lowest Root Mean Squared Error for time prediction (0.556).
  • MIMIC-II Dataset: MHP-E tied for the highest accuracy (85.5%) and achieved the lowest RMSE (0.588).

Limitations and Future Work

The authors note that their current architecture is explicitly tailored to the self-exciting and triggering dynamics characteristic of Hawkes processes. Consequently, the model structure may not generalize directly to other broad classes of temporal point processes without further modifications to the intensity function and architectural design. Future work could involve extending this framework to more generalized TPP formulations.

Summary updated

BibTeX
@misc{gao2024mamba,
  author = {Anningzhe Gao and Shan Dai and Yan Hu},
  title = {{Mamba Hawkes Process}},
  year = {2024},
  eprint = {2407.05302},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2407.05302},
}

Loading related content...

Figure