SMURF-THP: Score Matching-based UnceRtainty quantiFication for Transformer Hawkes Process

Zichong Li, Yanbo Xu, Simiao Zuo, Haoming Jiang, Chao Zhang, Tuo Zhao, Hongyuan Zha

Introduction

Temporal Point Processes (TPPs), particularly the Hawkes process, serve as the mathematical foundation for modeling sequences of discrete events occurring in continuous time. These models are critical in domains ranging from high-frequency trading and social media dynamics to clinical patient monitoring. While modern "Neural Hawkes Processes" utilize Transformer architectures to capture complex, long-range dependencies, they are frequently hindered by two significant challenges: the "Integration Trap" and the "Point Estimate Problem."

The Integration Trap refers to the computational burden of Maximum Likelihood Estimation (MLE). To calculate the likelihood of an event not occurring within a specific interval, one must integrate the intensity function over time—a process that rarely yields a closed-form solution and necessitates slow, potentially inaccurate numerical approximations. The Point Estimate Problem stems from the tendency of these models to predict a single timestamp for the next event. Given that event timings often follow long-tail distributions, a single point estimate is frequently unreliable. Users require calibrated uncertainty quantification—confidence intervals that accurately reflect the likelihood of an event occurring within a specific window.

Methodology

To address these limitations, we introduce SMURF-THP (Score Matching-based UnceRtainty quantiFication for Transformer Hawkes Process). This framework shifts the training objective from maximizing probability density to matching the score function—defined as the derivative of the log-density with respect to time.

Score Matching and Denoising

By focusing on the derivative of the log-density, the normalization constant—which contains the intractable integral—is eliminated from the training equation. This significantly streamlines the training process. To enhance numerical stability and ensure the model learns effectively in "low-density" regions where data is sparse, SMURF-THP employs Denoising Score Matching. This involves adding controlled Gaussian noise to the timestamps during the training phase.

Uncertainty Quantification via Langevin Dynamics

A primary advantage of the score-based approach is its generative capability. Because the model learns the score function, it can utilize Langevin Dynamics during inference. This technique allows the model to "walk" toward high-probability regions, generating a distribution of possible future timestamps rather than a single value. To ensure these predicted arrival times remain physically plausible (i.e., non-decreasing), the framework incorporates Tweedie’s Formula as a post-sampling denoising step.

Experimental Setup

The efficacy of SMURF-THP was evaluated across four diverse real-world datasets:

  • StackOverflow: Reward history (badges) for 6,633 users over a two-year period.
  • Retweet: 24,000 tweet sequences categorized by follower counts.
  • MIMIC-II: Clinical visit records for 650 patients in intensive care units.
  • Financial Transactions: 0.7 million buy/sell records for a specific stock from the New York Stock Exchange.

Key Insights and Results

Calibration vs. Accuracy

SMURF-THP demonstrates a superior ability to quantify uncertainty without compromising predictive performance. On the StackOverflow dataset, the model achieved a Calibration Score of 0.65%, a significant improvement over the 4.13% recorded by the standard Transformer Hawkes Process (THP). This indicates that the confidence intervals generated by SMURF-THP are highly representative of actual outcomes. Furthermore, the model produced narrower (more precise) intervals while maintaining better coverage of the ground truth. Despite the shift in the training objective, event-type prediction accuracy remained within 0.3% of traditional likelihood-based methods.

Parametrization Strategies

Ablation studies conducted during the research revealed that parameterizing the intensity function and subsequently deriving the score from it is more effective than parameterizing the score function directly. This constraint helps the model converge more rapidly by restricting the search space to valid point process structures.

Generative Uncertainty

The transition to a score-based objective naturally transforms the model into a generative one. Uncertainty quantification becomes an intrinsic feature of the architecture rather than a post-hoc addition, allowing for the sampling of entire distributions of possible future events.

Limitations and Future Directions

While SMURF-THP offers significant advantages in calibration and training efficiency, it introduces certain trade-offs. The use of Langevin Dynamics for sampling increases the computational overhead during the inference phase compared to simple point-estimate models. Additionally, the model's performance is sensitive to hyperparameters such as the noise scale ($\sigma$) and the weight of the score-matching loss ($\alpha$), which currently require manual grid searching.

Future work will focus on automating hyperparameter selection and exploring multi-intensity functions to better capture systems where different event types exhibit radically different temporal behaviors.

Summary updated

BibTeX
@inproceedings{li2023smurf,
  author = {Zichong Li and Yanbo Xu and Simiao Zuo and Haoming Jiang and Chao Zhang and Tuo Zhao and Hongyuan Zha},
  title = {{SMURF-THP: Score Matching-based UnceRtainty quantiFication for Transformer Hawkes Process}},
  booktitle = {International Conference on Machine Learning},
  year = {2023},
  url = {https://openreview.net/forum?id=ZeEkuTENLH},
}
Figure