Introduction
In social networks, events such as posts, comments, or likes are rarely isolated incidents. Instead, they form part of a Temporal Point Process (TPP), where the occurrence of past events significantly influences the probability of future ones. Modeling these dynamics accurately is crucial for understanding user behavior and predicting network evolution.
Traditional statistical models, notably the Hawkes Process, offer high interpretability through "trigger kernels" that explicitly quantify how one event type excites another. However, these models often lack the flexibility to capture the complex, non-linear patterns found in real-world data. Conversely, modern deep learning approaches like the Transformer Hawkes Process (THP) provide superior predictive power but operate as "black boxes." These models typically rely on parameterized extrapolation to estimate intensity between events, which obscures the underlying causal relationships and limits their ability to model fluctuating patterns.
To bridge this gap, we present the Interpretable Transformer Hawkes Process (ITHP). ITHP redesigns the Transformer architecture to maintain the predictive strength of deep learning while exposing the transparent causal mechanisms characteristic of classical Hawkes processes.
Methodology
The ITHP model introduces three fundamental modifications to the standard Transformer architecture to ensure both performance and interpretability:
- Concatenated Embeddings: Standard Transformers typically sum temporal and event-type embeddings ($Z+E$). We demonstrate that this summation introduces "cross-similarity" noise, muddling the independent contributions of time and type. ITHP instead concatenates these embeddings ($[Z, E]$), ensuring that time-based and type-based similarities are captured independently, aligning with classical statistical theory.
- Simplified Attention as Trigger Kernels: By removing the learnable projection matrices ($W^Q, W^K$) from the attention mechanism, ITHP allows the attention weights to directly represent shift-invariant trigger kernels. This transformation enables the attention mechanism to serve as a readable map of event-to-event influence over time.
- Fully Attention-Based Intensity: Rather than using a simple linear formula for intensity between events, ITHP applies the attention mechanism across a fine temporal grid. This allows the model to capture complex, non-linear intensity fluctuations, such as periodic or sinusoidal patterns, even during intervals without events.
Experimental Evaluation
The model was evaluated against several benchmarks, including synthetic datasets with known ground-truth kernels (Exponential Decay and Half-Sinusoidal) and diverse real-world datasets:
- StackOverflow: User badge award sequences.
- Amazon & Taobao: User shopping behaviors.
- NYC Taxi: Borough-level pick-up and drop-off sequences.
- Conttime: A standard synthetic Hawkes process benchmark.
Results and Discussion
ITHP achieved competitive or superior Test Log-Likelihood (TLL) and Accuracy (ACC) across all datasets, often outperforming the standard THP despite having fewer parameters. For instance, on the Amazon dataset, ITHP significantly outperformed the baseline THP in log-likelihood.
Interpretability and Visual Verification
A key strength of ITHP is its ability to recover the underlying logic of event sequences. On the StackOverflow dataset, the model successfully identified logical progressions, such as the correlation between "Nice Answer" and "Enlighten" badges.
In synthetic tests, ITHP's learned intensity functions showed remarkable alignment with ground-truth curves. Unlike standard THP, which often fails to capture fluctuations between events, ITHP accurately tracks complex intensity patterns.
The "Cross-Similarity" Trap
Our analysis highlights a common flaw in deep TPP models: the summation of time and type embeddings. This practice creates artificial mathematical relationships that do not exist in the data, potentially degrading model performance and interpretability. ITHP's concatenation approach effectively avoids this "trap."
Conclusion
The Interpretable Transformer Hawkes Process (ITHP) successfully reconciles the predictive power of Transformers with the transparency of Hawkes processes. By simplifying the attention mechanism and refining embedding strategies, ITHP provides a robust tool for unveiling the complex causal interactions driving social network dynamics. Future work will explore extending ITHP to incorporate static network structures via Graph Neural Networks.
Summary updated