Abstract
High-quality representation of transactional sequences is vital for modern banking applications, including risk management, churn prediction, and personalized customer offers. Different tasks require distinct representation properties: local tasks benefit from capturing the client's current state, while global tasks rely on general behavioral patterns. Previous research has demonstrated that various self-supervised approaches yield representations that better capture either global or local qualities. This study investigates the integration of two self-supervised learning techniques - instance-wise contrastive learning and a generative approach based on restoring masked events in latent space. The combined approach creates representations that balance local and global transactional data characteristics. Experiments conducted on several public datasets, focusing on sequence classification and next-event type prediction, show that the integrated method achieves superior performance compared to individual approaches and demonstrates synergistic effects. These findings suggest that the proposed approach offers a robust framework for advancing event sequences representation learning in the financial sector.
Introduction
In the financial technology sector, accurately modeling customer behavior through transaction history is essential for effective risk management and personalized service delivery. However, learning robust representations (embeddings) for these event sequences presents significant challenges. Existing self-supervised learning (SSL) methods typically specialize in one of two areas:
- Contrastive Learning (e.g., CoLES): These models excel at capturing "global" behavioral patterns by comparing different sequences. However, they often overlook "local" temporal details.
- Generative Learning (e.g., Masked Language Modeling): These models are proficient at "local" tasks, such as predicting the next event, but frequently fail to grasp the broader context of a user's entire history.
Furthermore, transactional data is inherently multi-modal, combining categorical variables (like Merchant Category Codes) with continuous variables (like transaction amounts). Standard generative models, often designed for text, struggle with this complexity without resorting to cumbersome multi-headed loss functions.
Methodology: The CMLM + CoLES Framework
To address these limitations, this research proposes a hybrid SSL framework that integrates contrastive and generative objectives, termed CMLM + CoLES.
Architecture and Latent Space Prediction
The model processes raw transactions by first embedding categorical and numerical features into a unified latent space. These features are concatenated to form a transaction embedding, which is then passed through a sequence model (typically a single-layer LSTM) to produce contextualized embeddings.
A key innovation is the Contrastive Masked Language Modeling (CMLM) objective. Instead of predicting raw features, CMLM predicts the embedding of a masked transaction in the latent space. This approach avoids the "multiple prediction heads" problem and allows the model to focus on essential informational content rather than noise.
Hybrid Learning Objective
The framework optimizes a joint loss function: $$\mathcal{L} = \mathcal{L}_{CoLES} + \lambda \mathcal{L}_{CMLM}$$
- CoLES (Global): Pulls embeddings of subsequences from the same user closer together while pushing those from different users apart.
- CMLM (Local): Uses a contrastive loss (InfoNCE) to ensure the predicted embedding of a masked event is similar to the actual masked embedding.
The hyperparameter $\lambda$ serves as a "knob" to balance the extraction of global versus local features depending on the downstream application.
Experimental Evaluation
The method was evaluated on four diverse public transactional datasets: Churn (Rosbank), Gender (Sber), Age (Sber), and DataFusion (VTB). These datasets range in scale from 490,000 to 26 million transactions, providing a rigorous testing ground for the framework's scalability and robustness.
Key Results and Insights
The hybrid approach consistently outperformed standalone models across both global and local benchmarks:
- Superior Performance: On global classification tasks, the hybrid model achieved a mean rank of 1.500, surpassing the previous state-of-the-art (CoLES at 2.000). In local tasks (next-event prediction), it dominated with a mean rank of 1.250.
- Synergistic Effects: The integration of objectives provided a performance boost that exceeded the sum of its parts. For instance, on the Churn dataset, the hybrid model improved results for both sequence classification and local event prediction simultaneously.
- Robustness: A $\lambda$ value between 0.01 and 0.05 was found to be a stable "out-of-the-box" configuration, delivering high performance across varying datasets.
Conclusion
The CMLM + CoLES framework demonstrates that uniting contrastive and generative learning creates more versatile and powerful representations for transactional event sequences. By operating in the latent space, the model effectively handles multi-modal financial data while balancing the needs of both global and local downstream tasks. Future research may explore applying this method to other domains, such as medical records or system logs, and investigating more complex sequence backbones like Transformers or State Space Models.
Summary updated