Self-Supervised Contrastive Pre-Training for Multivariate Point Processes

Xiao Shou, Dharmashankar Subramanian, Debarun Bhattacharjya, Tian Gao, Kristin P. BennettarXiv 2024

Abstract

Self-supervision is one of the hallmarks of representation learning in the increasingly popular suite of foundation models including large language models such as BERT and GPT-3, but it has not been pursued in the context of multivariate event streams. We introduce a new paradigm for self-supervised learning for multivariate point processes using a transformer encoder. Specifically, we design a novel pre-training strategy for the encoder where we not only mask random event epochs but also insert randomly sampled "void" epochs where an event does not occur; this differs from the typical discrete-time pretext tasks such as word-masking in BERT but expands the effectiveness of masking to better capture continuous-time dynamics. To improve downstream tasks, we introduce a contrasting module that compares real events to simulated void instances. The pre-trained model can subsequently be fine-tuned on a potentially much smaller event dataset, similar conceptually to the typical transfer of popular pre-trained language models. We demonstrate the effectiveness of our proposed paradigm on the next-event prediction task using synthetic datasets and 3 real applications, observing a relative performance boost of as high as up to 20% compared to state-of-the-art models.

Introduction

In many real-world scenarios—from high-frequency trading and system logs to patient health records—data arrives as a stream of irregularly timed events of various types. These are mathematically modeled as Multivariate Temporal Point Processes (MTPP). While "foundation models" like BERT and GPT have revolutionized natural language processing through self-supervised pre-training on massive unlabeled datasets, the MTPP field has largely stuck to training models from scratch on specific datasets.

The challenge lies in the nature of continuous time: unlike words in a sentence, events in a stream are separated by continuous intervals. Standard discrete-time masking strategies fail to capture the "silence" between events, which is often just as informative as the events themselves. We introduce Event-former, the first self-supervised pre-training paradigm for multivariate point processes. By injecting "void" events and using a novel contrastive masking strategy, the model learns to capture continuous-time dynamics, leading to significant performance boosts in next-event prediction.

Methodology: The Event-former Architecture

The researchers propose a transformer-based architecture designed for transfer learning in event streams. Its core innovations include:

  1. Void Event Injection: To help the transformer understand what happens when nothing is happening, the authors inject "void" (null) events into the stream during pre-training. This forces the model to learn how the "intensity" (likelihood of an event) evolves over continuous time.
  2. Masked Event Model (MEM): Similar to BERT’s masked language modeling, Event-former masks a percentage of events. Crucially, it masks both real events and the newly injected void events, requiring the model to predict not just what happened, but also when nothing happened.
  3. Combined PE + TE Encoding: Standard transformers use Positional Encoding (PE). Point process models often use Temporal Encoding (TE) based on timestamps. The authors found that using TE alone fails during masking (because masked timestamps are set to zero). By combining PE and TE, the model maintains a unique "address" for every event while still understanding its temporal context.
  4. Contrastive Loss: A dedicated module ensures that the representations of real events are distinct from simulated void events, sharpening the model's ability to distinguish signal from noise.
The Event-former framework: Pre-training via Masked Event Modeling with void injection (left) and Fine-tuning for next-event prediction (right).

Experimental Setup and Datasets

The model was evaluated on a mix of synthetic and diverse real-world datasets:

  • Synthetic: Data generated from Hawkes Processes (self-exciting) and Proximal Graphical Event Models (PGEM).
  • DeFi (Decentralized Finance): Transaction logs from the Aave protocol on the Ethereum Mainnet and Polygon.
  • E-commerce: User-level online transaction sequences from "Cosmetics" and "Electronics" stores.
  • Political Conflict: Armed conflict, riot, and protest data from the ACLED database for India and Bangladesh.
Visualization of the Hawkes-Exp synthetic dataset, showing the complex temporal clusters and dynamics the model must learn.

Key Results and Insights

  • Performance Boost: Event-former achieved a relative performance improvement of up to 20% in time prediction compared to state-of-the-art models like the Transformer Hawkes Process (THP).
  • Accuracy: In next-event type prediction, it consistently outperformed baselines across all real-world applications, particularly in the DeFi and E-commerce sectors.
  • The Power of "Silence": Explicitly modeling the absence of events via "void epochs" is a non-parametric way to handle the complex integral terms usually found in point process math. It allows the transformer to "evolve" its internal state between real events.
  • Transferability Across Domains: One of the most striking findings was that pre-training on one dataset (e.g., Cosmetics) significantly improved performance on a different but related dataset (e.g., Electronics). This suggests that different event streams share underlying "motifs" of temporal dynamics.
  • Efficiency: Once pre-trained, the Event-former can be fine-tuned using a much smaller feed-forward network (roughly 20x fewer parameters than a full SOTA model like the Transformer Hawkes Process), making it highly efficient for downstream tasks.

Conclusion and Future Work

The current study focuses on homogeneous transfer, meaning the pre-training and fine-tuning datasets must share the same set of event labels. The authors acknowledge that the next frontier is heterogeneous transfer, where a model pre-trained on one set of labels (like financial transactions) could be adapted to a completely different domain (like medical alerts). They suggest that "model reprogramming"—mapping one label space to another—is a promising direction for creating a truly universal foundation model for event data.

Summary updated

BibTeX
@misc{shou2024self,
  author = {Xiao Shou and Dharmashankar Subramanian and Debarun Bhattacharjya and Tian Gao and Kristin P. Bennett},
  title = {{Self-Supervised Contrastive Pre-Training for Multivariate Point Processes}},
  year = {2024},
  eprint = {2402.00987},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2402.00987},
}
Figure