Abstract
Pretext training followed by task-specific fine-tuning has been a successful approach in vision and language domains. This paper proposes a self-supervised pretext training framework tailored to event sequence data. We introduce a novel alignment verification task that is specialized to event sequences, building on good practices in masked reconstruction and contrastive learning. Our pretext tasks unlock foundational representations that are generalizable across different down-stream tasks, including next-event prediction for temporal point process models, event sequence classification, and missing event interpolation. Experiments on popular public benchmarks demonstrate the potential of the proposed method across different tasks and data domains.
Introduction
In computer vision and natural language processing, pre-training on massive unlabeled datasets using "pretext" tasks has become the standard for building robust models. However, event sequence data—such as financial transactions, medical records, or user clickstreams—presents unique challenges. These sequences consist of discrete event types occurring at irregular, continuous timestamps. Existing self-supervised methods often fail to capture the intricate coupling between what happens and when it happens. This research introduces a specialized pretext training framework to bridge this gap, enabling models to learn underlying temporal dynamics without human-labeled data.
Methodology
The proposed framework utilizes a three-pronged pretext training strategy to develop foundational representations of event sequences.
- Masked Reconstruction: Inspired by BERT, the model masks parts of the sequence. Instead of random individual events, the authors use a "density-preserving" strategy, masking continuous time intervals. The model must then reconstruct both the event type and the precise timing.
- Contrastive Learning: The model learns global similarity by identifying different "views" of the same sequence. Views are generated through subsequence sampling, Gaussian noise injection in embeddings, or event masking. The objective is to minimize the distance between related views while maximizing the distance from unrelated sequences.
- Alignment Verification: This novel binary classification task requires the model to distinguish between "real" and "misaligned" sequences.
Alignment Verification Detail
The alignment verification task is designed to force the model to understand the logical consistency between event types and their arrival times. For example, in a medical context, certain symptoms must logically precede a diagnosis. To create negative samples for this task, the authors employ several strategies, including shuffling event types within a sequence or performing a "swap" between two different sequences.
Key Insights and Results
The research highlights that these three pretext tasks are highly complementary. Masked reconstruction focuses on local context, contrastive learning captures global similarity, and alignment verification ensures logical sequence consistency. Combining all three consistently yielded the best performance across benchmarks.
Performance Benchmarks
The framework was evaluated on diverse real-world datasets, including StackOverflow (user awards), Mooc (student interactions), Reddit (user posts), and MIMIC-II (clinical records).
- Next-Event Prediction: The method achieved state-of-the-art results in Negative Log-Likelihood (NLL) and Root Mean Squared Error (RMSE) for time prediction, outperforming models like SAHP and Neural Flows.
- Few-Shot Learning: Pre-training acts as a significant force multiplier. A model pre-trained on only 25% of the data often outperformed baseline models trained from scratch on 100% of the data.
- Specialized vs. General Models: When compared to large language models (LLMs) like GPT-3.5, the specialized framework demonstrated superior accuracy in predicting event types, as LLMs often lack the specific in-domain context required for irregular time series.
Conclusion
This self-supervised pretext training framework provides a powerful foundation for modeling irregular event sequences. By integrating masked reconstruction, contrastive learning, and a novel alignment verification task, the model learns rich representations that generalize across prediction, classification, and imputation tasks. Future work will explore the use of synthetic data for augmentation and scaling the architecture for real-time streaming data.
Summary updated